jj-util
infrequently used Jujutsu utilities (completions, gc, exec)
TLDR
SYNOPSIS
jj util (completion | config-schema | exec | gc | install-man-pages | markdown-help | snapshot | backend) [args]
DESCRIPTION
jj util groups commands that are not part of the daily edit/rebase/push loop: shell completions, schema dumps, man-page install, explicit snapshots, and garbage collection.jj util gc only reclaims objects that are already unreachable. To drop old operation history first, run `jj op abandon ..<old-operation>` and then jj util gc.jj util exec exists so aliases can run arbitrary programs through jj. The child sees `JJWORKSPACEROOT`. Official docs warn that this is a convenience for running code on your system: a bad alias can break `jj undo` or destroy files, and the feature may be replaced by an embedded scripting language.jj util snapshot is the documented way to force a working-copy snapshot from a script (for example so a sandwich of snapshots around other jj commands keeps those operations distinct in `jj op log`). Humans almost never need it; `jj operation log --limit 1` also snapshots.
CONFIGURATION
Typical alias using exec (the `--` is required so flags reach the script):
my-script = ["util", "exec", "--", "my-jj-script"]
SUBCOMMANDS
completion SHELL
Print a completion script. SHELL is one of bash, elvish, fish, nushell, power-shell, zsh.config-schema
Print the JSON schema for jj's TOML config format.exec COMMAND [ARGS...]
Run an external command with `JJWORKSPACEROOT` set. Intended for aliases. Put -- before the command so flags go to the child, not to jj.gc [--expire now]
Backend-dependent garbage collection. Default: prune obsolete objects and operations older than two weeks. --expire currently accepts only the string now.install-man-pages PATH
Write man pages under PATH (`man1/` is appended). Example: `/usr/share/man`.markdown-help
Print CLI help for every subcommand as Markdown.snapshot
Snapshot the working copy if it changed. Almost every jj command already does this; this subcommand is for scripts that need a distinct operation.backend name
Print the name of the storage backend used by the current repo (typically `git`).
INSTALL
CAVEATS
Subcommand of jj. gc --expire does not yet accept arbitrary timestamps. exec runs arbitrary commands. Completions must be regenerated after jj upgrades.
SEE ALSO
jj(1), jj-operation-abandon(1), jj-operation-log(1), jj-config(1)
