Packages
Pin a release archive, solve a coherent Conda environment or import a Pixi lock. Nothing installs into a global prefix; the lockfile is the only source of versions.
Packages · dotfiles · environments · services · tasks
Describe your tools and configuration in one typed TypeScript file. Review what grip plans to change, apply it as a transaction, and roll back to a retained generation without rebuilding your packages.
Linux x86_64 & WSL2 Alpha MIT What's new in v0.62.0
01 / How it works
Setting up a machine is usually a pile of commands nobody can replay. Gripsack turns it into a file you can read, review and roll back.
Write gripsack.ts: packages from release archives or Conda, dotfiles with explicit ownership, environments, Docker services, tasks.
Evaluation runs in a sandbox. Review destination changes and the exact paths selected inside locked packages, without downloading those packages to inspect them.
grip planBefore changing a file, grip journals its prior state and re-checks the destination for edits. One atomic rename makes the new generation current.
grip applyEach apply records a generation. Rollback uses its retained files and launchers without rebuilding packages; garbage collection lets you retire older generations.
grip rollback02 / What you declare
Bring the user-space pieces you manage into one catalog. Leave the operating system to its own package manager.
Pin a release archive, solve a coherent Conda environment or import a Pixi lock. Nothing installs into a global prefix; the lockfile is the only source of versions.
grip run and grip shell put selected packages on your path for one command or one shell, without touching your dotfiles.
Keep a file as a symlink, deploy a tracked copy that detects local edits, or own just one marked block inside a shared file.
Digest-pinned PostgreSQL, Redis or any image, on loopback ports with explicit health checks. grip down keeps the volumes.
Run named commands with prerequisites, locks and postconditions. Watch task stdout as it arrives; step and check progress goes to stderr, not into your pipeline.
systemd user timers that run the same tasks on a calendar, and signed package bundles you can hand to another machine or registry.
03 / Safety
Before replacing a file, gripsack has two jobs: decide whether it may write, then carry out that decision on your filesystem. The rings show where the proof of the first ends and testing of the second begins.
The release gate translates the shipped Rust kernel to Lean 4 and checks the proofs. It does not prove the CLI, Linux or the effects of your hooks and containers. Read the guarantees and their assumptions →
04 / Quick start
A file-only workspace needs no package download and no Docker. Three commands later you have a generation you can roll back to.
Save this as gripsack.ts in its own repository (or run grip init my-env for a scaffold):
import {
defineWorkspace, file, literalText, managedBlock, profile, workspace,
} from "@gripsack/core";
const dotfiles = profile("dotfiles", {
files: [file({
content: literalText("export EDITOR=vi\n"),
destination: managedBlock("~/.profile", "gripsack-editor"),
})],
});
export default defineWorkspace(() => workspace({ outputs: [dotfiles] }));
From declaration to deployment
After installing grip, then:
grip checkgrip plan dotfilesgrip apply dotfilesThe rest of ~/.profile stays yours: a managed block owns only the section between its markers. grip generations lists what you can return to; grip rollback returns to it.
05 / Three more shapes
Each tab is a complete workspace from the guides. The release checks evaluate, check and plan the Conda and Docker examples without starting their services or running their tasks.
import {
defineWorkspace, environment, githubRelease, pkg, provider,
targetPlatform, workspace,
} from "@gripsack/core";
const target = targetPlatform({ os: "linux", arch: "x86_64", abi: "musl" });
const ripgrep = pkg("ripgrep", {
producer: provider(githubRelease({
repo: "BurntSushi/ripgrep",
asset: "ripgrep-{version.bare}-x86_64-unknown-linux-musl.tar.gz",
})),
archiveRoot: { kind: "single_directory" },
commands: { rg: "rg" },
target,
layout: { kind: "relocatable" },
});
const search = environment("search", { packages: ["ripgrep"], target });
export default defineWorkspace(() => workspace({ outputs: [ripgrep, search] }));A release archive becomes a package; an environment puts rg on the path for one command. Packages guide →
grip update
grip build ripgrep
grip run --env search -- rg --versionimport {
defineWorkspace, exec, lit, service, task, workspace,
} from "@gripsack/core";
const postgres = service("postgres", {
image: "docker.io/library/postgres@sha256:979bccfde35445db618c65107d27d08c6c21339d8dc3ad4c830c6633947be0e4",
ports: [{ address: "127.0.0.1", host: 55432, container: 5432 }],
volumes: [{ name: "gripsack-guide-postgres18", target: "/var/lib/postgresql" }],
env: {
POSTGRES_USER: { kind: "literal", value: "app" },
POSTGRES_DB: { kind: "literal", value: "app" },
POSTGRES_PASSWORD: { kind: "inherited", name: "GRIPSACK_POSTGRES_PASSWORD" },
},
health: {
kind: "command",
argv: ["pg_isready", "-U", "app", "-d", "app"],
interval_seconds: 2,
timeout_seconds: 2,
retries: 30,
},
});
const databaseReady = task("database-ready", {
services: ["postgres"],
steps: [exec({ argv: [lit("/usr/bin/printf"), lit("postgres is healthy\\n")] })],
});
export default defineWorkspace(() => workspace({ outputs: [postgres, databaseReady] }));A digest-pinned PostgreSQL on loopback, a health check, and a task that requires it to be healthy. The password is inherited from your environment, never written down. Services guide →
: "${GRIPSACK_POSTGRES_PASSWORD:?}"
grip up postgres
grip task run database-ready --closed-stdin
grip down postgres # keeps the volumeimport {
bash, conda, defineWorkspace, environment, lit, packageCommand,
pkg, provider, targetPlatform, task, workspace,
} from "@gripsack/core";
const target = targetPlatform({ os: "linux", arch: "x86_64", abi: "gnu" });
const shell = pkg("shell", {
producer: provider(conda.environment({
channels: ["conda-forge"],
packages: { bash: "*" },
systemRequirements: {
libc: { family: "glibc", version: "2.28" },
linux: "4.18",
},
})),
commands: { bash: "bin/bash" },
target,
layout: { kind: "prefix_materialized" },
});
const dev = environment("dev", { packages: ["shell"], target });
const greet = task("greet", {
environment: "dev",
steps: [
bash`printf '%s\n' "$MESSAGE"`
.interpreter(packageCommand("shell", "bash"))
.env("MESSAGE", lit("two words"))
.build(),
],
});
export default defineWorkspace(() => workspace({ outputs: [shell, dev, greet] }));A literal Bash body with a pinned interpreter from Conda and a typed environment binding; no JavaScript interpolation into shell. Tasks guide →
grip update
grip task run greet --closed-stdin06 / Install
A musl-linked grip with its TypeScript frontend embedded. Docker Engine is needed only for container services; systemd only for schedules. Nothing runs in the background.
Linux x86_64 / WSL2 · Alpha
Install v0.62.0 Release notes and checksums ↗Keep your OS package manager.
Declare the user-space pieces you choose.
07 / Documentation
Start with a file-only workspace, or go straight to the kind of declaration you need.
grip plan.A clear boundary
Keep system packages with apt or your distribution. Gripsack takes the user-space layer — tools, project commands, personal files, project services — and makes it reviewable, repeatable and reversible. Where gripsack fits →