Pot Home Getting started Documentation Demo stack Sources

Documentation

This is the reference for pot 0.4.0. Look up commands, flags, the manifest and profiles, thread output, exit status, and environment overrides.

On this page

Synopsis

pot [--quiet] <COMMAND>

pot discovers pot.toml by walking up from the working directory, unless POT_ROOT names the stack root. Most commands exit 2 for a manifest or usage error and 1 for a runtime failure.

Global options

OptionWhat it does
--quiet Suppress progress on stderr. Warnings and errors still print. POT_QUIET=1 does the same.
-h, --help Print help for pot or a subcommand.
-V, --version Print current pot version number.

pot up

pot up <PROFILE> [--thread <T>] [--branch <B>] [--base <REF>] [--dry-run]
Argument or optionWhat it does
PROFILEProfile from pot.toml.
--thread TThread name. Default: the profile name. Letters, digits, ., _, and -; no leading dot.
--branch BBranch created or resumed in every repo. Default: stack/<thread>.
--base REFRef to branch from when creating. Default: each repo's ref, then [stack].default_branch.
--dry-runPrint the commands. Clone nothing, write no worktrees, create no project, start no devenv. Still reads wt list to choose create or resume.

Before writing anything, pot checks the backend executable (wt, or git-twig with worktree_backend = "twig"), devenv, the profile directory, and devenv.nix. It then creates .pot/threads/<thread>, writes a profile marker, and for each repo: clones the canonical checkout if missing, checks whether the branch exists, creates or resumes the worktree, and verifies the resulting path. It prints repo -> path on stdout for each ready worktree.

The final command runs in the thread project:

devenv --from path:<profile> -o <repo> path:<worktree> ... up

pot replaces its process with devenv, so devenv owns the terminal and its exit status becomes the command's exit status.

pot down

pot down <PROFILE> [--thread <T>]

Stops the devenv process manager for one thread. The default thread is the thread containing the current directory, or the profile name when run from the stack root. Worktrees, branches, and the thread project stay on disk.

The command runs devenv --from path:<profile> down from .pot/threads/<thread>. If the thread has no project directory, pot exits 1 and tells you to run pot up.

pot status

pot status [<THREAD>] [--json]

Prints one row per repo that has a worktree directory. With no argument, it reports the thread containing the current directory when run under threads/<thread> or .pot/threads/<thread>, otherwise every thread.

THREAD  REPO  BRANCH      STATE  AHEAD  PATH
demo    api   stack/demo  clean  -      /home/me/stack/threads/demo/api
demo    web   stack/demo  dirty  ↑1     /home/me/stack/threads/demo/web

STATE is clean or dirty. dirty means staged, modified, untracked, renamed, deleted, or conflicted changes. AHEAD is commits ahead of the default branch; - means zero. A repo with no worktree directory is skipped.

--json prints one array of rows. Each row has this shape:

FieldTypeMeaning
threadstringThread name.
repostringRepo name from the manifest.
branchstringBranch name, or - for a detached worktree.
pathstringAbsolute worktree path.
modified, untrackedbooleanWorktrunk change flags.
ahead, behindintegerCommits ahead of and behind the default branch.
dirtybooleanAny uncommitted change, including staged, renamed, deleted, or conflicted.

pot clean

pot clean <THREAD> [--dry-run] [--force]

Removes a thread's worktrees, branches, threads/<thread>, and .pot/threads/<thread>. Before removing anything, pot checks the thread's project marker and asks devenv whether the process manager is still running.

It refuses when any repo is dirty, when a branch has commits that are not on the default branch, when the thread directory holds a repo with no worktrunk row, or while the stack is running. --force removes dirty worktrees, unmerged branches, and stray directories. It does not override the running-stack check; run pot down first.

--dry-run still checks the running stack and worktree state, then prints the wt remove commands and the rm -rf lines without changing anything.

pot clone

pot clone <PROFILE> [--dry-run]

Creates any missing canonical checkout with git clone <url> <clone>. An existing git checkout is reused. An existing non-empty directory that is not a git checkout is an error. --dry-run prints the git commands.

pot up and pot ci run the same step before they need a repo, so this command is optional.

pot pull

pot pull [<PROFILE> [<REPO>]] [--all] [--dry-run]

Fetches each selected repo's ref, fast-forwards its canonical clone to origin/<ref>, then rebases every thread worktree that lists a selected repo. No argument opens a numbered checklist; PROFILE selects the profile's repos, PROFILE REPO selects one, and --all selects every repo in repo-name order. Stop the thread with pot down first.

It refuses a dirty canonical clone, a clone on another branch, a local ref with commits not on its origin, a running thread, a worktree already mid-rebase, and a dirty worktree. It does not reset, autostash, or abort; the run stops at the first such state and keeps the pins it already moved. --dry-run prints the git commands and moves nothing. pull uses git only.

pot doctor

pot doctor [--json]

Read-only. It checks: pot, the manifest, git, wt, devenv 2.4 or newer, git-twig when the twig backend is enabled, each profile directory and its devenv.nix/devenv.yaml, and each canonical clone. Every failure includes the command that fixes it.

The process exits 1 when a required check fails. --json prints one report:

FieldTypeMeaning
okbooleanTrue when no check failed.
failed, warnedintegerCounts by status.
checks[]arrayEach has name, status (ok, warn, fail), and detail.

pot ci

pot ci <PROFILE>

Ensures the profile's canonical clones exist, then runs devenv test in the profile directory with no worktree overrides. This is verification against the canonical refs. The process is replaced by devenv, so devenv's exit status is the command's.

pot ls

pot ls

Prints profiles: with each profile's repos, then threads: with the number of directories in each thread. Both sections are sorted by name. No subprocess runs.

Manifest

pot.toml at the stack root:

[stack]
default_branch = "main"
worktree_backend = "worktrunk"   # or "twig"

[repos.api]
url = "https://gitlab.example.com/team/api.git"
clone = "repos/api"
ref = "main"

[repos.web]
url = "https://gitlab.example.com/team/web.git"

[profiles.chat]
repos = ["api", "web"]
devenv_dir = "profiles/chat"
copy_ignored_from = "cache"   # optional
FieldDefaultRules
[stack].default_branchrequiredNon-empty string.
[stack].worktree_backendworktrunkworktrunk or twig. Twig creates worktrees with git-twig.
[repos.<name>].urlrequiredNon-empty string passed to git clone.
[repos.<name>].clonerepos/<name>Relative path below the stack root. No ...
[repos.<name>].ref[stack].default_branchBase for a new thread branch. Non-empty.
[profiles.<name>].reposrequiredOne or more known repo names, no duplicates.
[profiles.<name>].devenv_dirprofiles/<name>Relative path below the stack root. No ...
[profiles.<name>].copy_ignored_fromunsetThread name whose gitignored files seed new threads of the profile.

Repo and profile names use letters, digits, ., _, and -, and do not start with a dot. Unknown keys are errors, so branch = instead of ref = fails instead of being ignored. Malformed TOML, an empty value, an empty profile, a duplicate repo, a bad name, or a path that leaves the stack root exits 2.

A profile that names an unknown repo is an error when the profile is resolved. The error lists the known repos. pot doctor reports the same problem without stopping the other checks.

Profiles

A profile directory holds the devenv project that composes the stack. Its devenv.yaml declares one input per repo and imports them:

inputs:
  nixpkgs:
    url: github:cachix/devenv-nixpkgs/rolling
  api:
    url: path:../../repos/api
    flake: false
  web:
    url: path:../../repos/web
    flake: false

imports:
  - api
  - web

devenv.nix is the profile's module. It can be empty. pot runs the profile with --from path:<profile> from the thread project and overrides every profile repo with that thread's worktree. The relative path: values are the canonical inputs used by pot ci and pot doctor.

Any other relative input in a profile resolves against the thread project directory, not the profile directory. Use an absolute path for a local input outside the repo set.

Threads

A thread is one branch across every repo of a profile, plus a devenv project with its own process manager. The default branch is stack/<thread>. Two threads of one profile can run at the same time. They do not share ports, processes, or .devenv state.

The project directory holds a profile marker and a devenv.lock for that thread. pot clean uses the marker to find the profile before it asks devenv whether the stack is running.

With worktree_backend = "twig", pot creates the worktrees with git-twig, which shares unchanged tracked files with a nearby checkout through copy-on-write. Worktrunk still lists, reports, and removes them, so status and clean do not change.

When a profile sets copy_ignored_from, pot up copies that thread's gitignored files into a new thread before devenv starts. Build caches, node_modules, and .env files arrive warm; worktrunk reflinks where the filesystem supports it. A missing seed worktree is a warning, and the thread still starts.

Stack layout

pot.toml
profiles/<profile>/          devenv.nix, devenv.yaml
repos/<name>/                canonical clone per repo
threads/<thread>/<repo>/     worktree per repo, one branch across all
.pot/threads/<thread>/       per-thread devenv project and .devenv state
.pot/threads/<thread>/profile  profile name used by pot clean

pot sets WORKTRUNK_CONFIG_PATH to .pot/worktrunk.toml for every worktrunk call, so the user's worktrunk config cannot change pot's behavior. The file does not need to exist.

Output

stdout carries results: the pot status table, JSON, --dry-run command lists, the pot doctor report, the repo -> path line when a worktree is ready, and whatever pot down forwards from devenv.

stderr carries progress and errors. On a terminal, pot prints a phase line and a spinner for the running action. Through a pipe it prints one line per action, the command, an ok in 0.4s line when the action finishes, and a still running (15s) heartbeat while a long child runs. --quiet and POT_QUIET=1 suppress progress; warnings and errors still print. POT_NO_TUI=1 forces the plain log, and NO_COLOR=1 removes color without changing the layout.

When stdout is not a terminal and DEVENV_TUI is unset, the foreground devenv child gets DEVENV_TUI=false. An explicit value is left alone.

Exit status

StatusWhen
0The command finished, or devenv exited 0 for up and ci.
1A subprocess failed or could not run, a worktree or clone operation failed, pot clean refused, or pot doctor found a failed check.
2Manifest, config, or usage error: missing or malformed pot.toml, invalid values, unknown profile, repo, or thread, invalid thread name, missing profile directory.

pot up and pot ci replace their process with devenv. The exit status is devenv's.

Environment

VariableDefaultWhat it does
POT_ROOTwalk up for pot.tomlSet the stack root explicitly.
POT_WTwtWorktrunk executable.
POT_DEVENVdevenvdevenv executable.
POT_TWIGgit-twiggit-twig executable used by the twig backend.
POT_GITgitGit executable used for clones and pulls.
POT_QUIETunset1 suppresses progress. Same as --quiet.
POT_NO_TUIunset1 keeps the plain log on a terminal.
NO_COLORunsetRemove color without changing the layout.
DEVENV_TUIunsetWhen stdout is a pipe, pot sets false for devenv unless this is set.

Installer

https://pot.slopkit.dev/install.sh downloads the 0.4.0 Linux x86_64 artifact, checks its SHA-256, and installs it. The artifact carries pot, devenv 2.4 or newer, worktrunk, and git-twig; git is the only host tool it needs. It accepts:

VariableDefaultWhat it does
POT_VERSION0.4.0Version in the artifact URL.
POT_INSTALL_DIR$HOME/.local/binInstall directory.
POT_SHA256the 0.4.0 checksumExpected SHA-256.

Troubleshooting

no pot.toml at ...

Run from the stack root, or set POT_ROOT.

cannot parse ... or ... must contain only

Fix the named value in pot.toml. Unknown keys are errors.

unknown profile, unknown repo, unknown thread

Run pot ls; declare the repo or profile in pot.toml.

repo 'x' has no canonical clone

Run pot clone <profile>, or pot up <profile>, which clones it.

devenv, wt, or git-twig not found

The cram artifact carries all three. A source build needs them on PATH: nix profile add nixpkgs#devenv nixpkgs#worktrunk nixpkgs#git-twig. Or set POT_DEVENV, POT_WT, or POT_TWIG.

pot needs devenv 2.4 or newer

Upgrade devenv. pot uses --from for per-thread projects.

thread 'x' is still running

pot down <profile> --thread x, then pot clean x.

thread 'x' has commits not on the default branch

Merge them into the default branch, or use pot clean x --force.

thread 'x' has no devenv project

pot up <profile> --thread x.

profile ... directory is missing or has no devenv.nix

Create the profile's devenv.nix and devenv.yaml. pot doctor names the path.

No process manager is running

Start the stack with pot up <profile>. devenv processes list only reads a running manager.

path ... is required, but there is no substituter

Lower max-substitution-jobs and set narinfo-cache-negative-ttl = 0, then retry. A single path can be restored with nix-store --realise <path>.

database disk image is malformed after an interrupted Nix install

Remove ~/.cache/nix/binary-cache-v8.sqlite* and retry. Nix rebuilds it.

install.devenv.sh fails while evaluating its flake

Install nixpkgs#devenv instead. It is the same 2.4.x line without the extra inputs.

artifact exits with libgcc_s.so.1 or glibc

Old dynamic artifact. Use the current static release or build from source.

artifact reports an empty private store after an interrupted run

Remove ~/.local/share/cram/store and run it again.