Type to search the docs and updates.

Browse documentation

Maintain and set up

revert

Undo a sync --backup. For every emitted file and entry-point file (CLAUDE.md, AGENTS.md, GEMINI.md, CONVENTIONS.md, .agnostic-ai/AGNOSTIC_AI.md), revert restores <path>.bak and removes the .bak. It also restores a nested CLAUDE.md that sync deleted for Claude's scoped rules. Files without a .bak stay unless you pass --force.

FlagDescription
-t, --only, --exceptSelect targets, as in sync.
--dry-runReport intended actions without touching disk
--forceAlso delete emitted files that lack a .bak, including generated entry-point files and user files sharing their paths.
--jsonSame schema as sync --json. Actions: "restore" (.bak applied), "remove" (deleted), "preserve" (no .bak, no --force), "skip" (already absent).

Paths under sync.unmanaged are never restored or removed.

cleanup

Remove the <path>.bak backups sync --backup wrote for emitted paths. Unrelated .bak files are never touched.

agnostic-ai cleanup
agnostic-ai cleanup --dry-run   # preview deletions

packs

Manage shareable spec packs. Packs load as a layer below the project, so a project spec overrides a pack entry with the same name. Full guide in packs.

agnostic-ai packs add github.com/chemaclass/go-rules@v1.2.0
agnostic-ai packs add ./path/to/pack
agnostic-ai packs list
agnostic-ai packs update [name]
agnostic-ai packs remove go-rules

install-hook

Install a pre-commit hook that runs sync --check, or, with --post-checkout, a hook that regenerates tool files after a checkout. See git hooks.

agnostic-ai install-hook            # writes .git/hooks/pre-commit (local)
agnostic-ai install-hook --shared   # writes .githooks/ and sets core.hooksPath
agnostic-ai install-hook --global   # gates commits to a global home kept in git

agnostic-ai install-hook --post-checkout            # writes .git/hooks/post-checkout (local)
agnostic-ai install-hook --post-checkout --shared   # writes .githooks/post-checkout

An existing hook keeps its content and the checks go at its end. A hook that already holds them stays as it is. A hook that would stop before reaching them (no sh or bash shebang, an exec, or an unindented exit) is left alone, and the command prints the lines to add by hand.

  • --shared writes .githooks/<hook> at the root of the main working tree, from any linked worktree. It stops when core.hooksPath already points elsewhere.
  • --global is for the global home, which must be the root of its own git repository. The hook runs lint --global --strict, validate --global, and sync --global --check; the commit fails when any fails. In a linked worktree it skips sync --global --check. It stops when run anywhere else, when core.hooksPath points elsewhere, or when the hook still runs the project sync --check. Not with --shared or --post-checkout.
  • --post-checkout runs agnostic-ai sync -q from the worktree root on a branch or worktree checkout (never a single-file checkout), when the binary and agnostic-ai.yaml are found. The hooks directory is shared across linked worktrees, so one install covers git worktree add everywhere.

completion

Generate a shell completion script.

agnostic-ai completion bash > ~/.local/share/bash-completion/completions/agnostic-ai  # or /etc/bash_completion.d/
agnostic-ai completion zsh > "${fpath[1]}/_agnostic-ai"
agnostic-ai completion fish > ~/.config/fish/completions/agnostic-ai.fish
agnostic-ai completion powershell | Out-String | Invoke-Expression

Restart your shell or source the file. Completing --target reads agnostic-ai.yaml in the current directory, or offers every target. See agnostic-ai completion <shell> --help.

upgrade

Upgrade the running binary to the latest release with the method it was installed with. update is an alias.

agnostic-ai upgrade --version v0.56.1
FlagDescription
--checkPrint install details and exit without changing anything. With --version, adds a Requested: line and downloads nothing.
--version <tag>Install one release, downgrades included. The leading v is optional. Standalone binaries only; package-manager installs are told to pin through their manager.
--runAccepted for compatibility; upgrading is the default.
Binary locationUpgrade
*/Cellar/*, */Caskroom/*, /opt/homebrew/*, /home/linuxbrew/.linuxbrew/*brew update && brew upgrade --cask Chemaclass/tap/agnostic-ai
$GOBIN or $GOPATH/bin (defaults to $HOME/go/bin)go install github.com/chemaclass/agnostic-ai/cmd/agnostic-ai@latest
*\scoop\apps\*, *\scoop\shims\*scoop update agnostic-ai
*\Microsoft\WinGet\*winget upgrade Chemaclass.agnostic-ai
*/node_modules/*npm install -g agnostic-ai@latest
Standalone binary on macOS or LinuxDownload the release, verify checksum and version, replace the binary atomically.
Standalone binary on WindowsUse the PowerShell install script; Windows cannot replace a running executable.

Scoop, WinGet, and node_modules markers match case-insensitively. upgrade also lists any other agnostic-ai on PATH that shadows the resolved executable.

lsp

Start the Language Server on stdin/stdout. Point your editor at agnostic-ai lsp for spec files (.agnostic-ai/**/*.md, *.mdc). It pushes lint diagnostics on open and save.