adocs-cli
v0.1.2
Published
CLI for inspecting and locally overriding repository instruction files
Readme
adocs
Quick Start
Run without installing:
npx adocs-cliInstall globally:
npm install -g adocs-cliThen use:
adocs
adocs ./repo
adocs override --source ~/docs/agent-context
adocs restoreOverview
adocs is a CLI for managing repository-local AGENTS.md and CLAUDE.md files.
It was built for a simple reason: many repositories add too many AI instruction files, often spread across nested directories, and they end up adding noise instead of clarity. When you work locally, you may want a short, consistent set of instructions that matches how you prefer to work, without editing the repository for everyone else.
adocs automates that local workflow. It helps you inspect instruction files, temporarily override them on your machine, and restore the tracked versions later.
How It Works
adocs supports three main workflows:
- Find instruction files and show them as a pruned tree.
- Remove tracked instruction files locally and mark them with Git
skip-worktree. - Copy your local override directory into the target root, then restore the tracked files later when needed.
By default, mutating commands operate only on Git-tracked instruction files so the original state can be restored safely.
Commands
Show instruction files
npx adocs-cli
npx adocs-cli ./repo
npx adocs-cli --json
npx adocs-cli --excludedShows all discovered AGENTS.md and CLAUDE.md files under the target directory as a pruned tree. Excluded directories such as node_modules are hidden unless --excluded is passed.
Apply a local override
npx adocs-cli override --source ~/docs/agent-context
npx adocs-cli override --source ./agent-context ./repo
npx adocs-cli override --source ./agent-context --excludedThis command:
- Resolves the Git repository root.
- Finds tracked
AGENTS.mdandCLAUDE.mdfiles in scope. - Removes those tracked files and any tracked root
.claudeor.codexfiles from the working tree. - Marks those tracked files with Git
skip-worktree. - Removes root
AGENTS.md,CLAUDE.md,.claude, and.codexbefore applying the new override. - Copies
AGENTS.mdfrom the source directory into both rootAGENTS.mdand rootCLAUDE.mdwhen present. - Recursively copies source
.claudeand.codexdirectories when present. - Adds the generated local artifacts to
.git/info/exclude.
The source path must be a directory. Missing AGENTS.md, .claude, or .codex entries are allowed and will simply be omitted from the override.
Restore tracked files
npx adocs-cli restore
npx adocs-cli restore ./repoThis clears skip-worktree, restores tracked files from HEAD, removes temporary root override artifacts that were not tracked, and clears the local .git/info/exclude entries added by adocs.
Local Development
Install dependencies:
bun installRun the local source tree:
bun run ./index.tsRun tests:
bun test