@@ -14,10 +14,12 @@ maps to a command directory like:
1414.cli/gh/pull/script.ts
1515```
1616
17- The v1 contract is defined in ` SPEC.md ` . The package implements local and
18- user-global command discovery, command resolution, script execution,
19- machine-readable listing, ` --which ` , ` --new ` , ` --mv ` , context-file pointers,
20- help, command copy, and version output.
17+ The contract is defined in ` SPEC.md ` . The package implements local and
18+ user-global command discovery, command resolution, script execution with a
19+ trust model for local overlays, machine-readable listing, ` --which ` , command
20+ scaffolding with templates, command copy/move/remove, ` --edit ` , command packs
21+ via ` --add ` , shell completions, a tree doctor, an MCP server mode,
22+ context-file pointers, help, and version output.
2123
2224## Install
2325
@@ -52,24 +54,80 @@ cli --list --json
5254cli --which gh pull
5355cli --new gh pr
5456cli --new gh pr --root
57+ cli --new gh pr --template worker
58+ cli --edit gh pull
59+ cli --rm gh pull
5560cli --cp gh pull
5661cli --cp gh pull --to local
5762cli --mv gh pull
5863cli --mv gh pull --to local
64+ cli --add https://example.com/org/pack.git
65+ cli --trust
66+ cli --trust --status
67+ cli --untrust
68+ cli --doctor
69+ cli --completions bash
70+ cli --mcp
5971cli --agents
6072cli --agents --write
6173cli --agents --check
6274cli --agents --claude --write
6375cli --version
6476```
6577
66- Command scripts run from the caller's original working directory. ` .js ` and
67- ` .mjs ` scripts run directly with Node; ` .ts ` and ` .mts ` scripts use Node 24
68- native type stripping.
78+ Command scripts run from the caller's original working directory by default;
79+ a ` // cli-cwd: project-root ` or ` // cli-cwd: script-dir ` head comment changes
80+ that per script. ` .js ` and ` .mjs ` scripts run directly with Node; ` .ts ` and
81+ ` .mts ` scripts use Node 24 native type stripping.
6982
7083Use ` --cp ` to clone a command directory between local and user-global command
7184trees without removing the source. Use ` --mv ` when the source should be
72- transferred instead.
85+ transferred instead, and ` --rm ` to delete a command directory.
86+
87+ ## Trust
88+
89+ Repo-local ` .cli/ ` overlays are refused at execution time until you trust
90+ them, because cloned repositories can shadow your user-global commands:
91+
92+ ``` sh
93+ cli --trust # trust the local overlays discovered from here
94+ cli --trust --status # trusted | changed | untrusted per overlay
95+ cli --untrust # revoke
96+ ```
97+
98+ Trust records a content hash of the overlay; any change requires re-trusting.
99+ Listing and ` --which ` never require trust. Set ` ASYNC_CLI_TRUST=off ` to
100+ disable enforcement in controlled environments.
101+
102+ ## Completions
103+
104+ ``` sh
105+ eval " $( cli --completions bash) " # or zsh
106+ cli --completions fish | source # fish
107+ ```
108+
109+ ## Doctor
110+
111+ ` cli --doctor [--json] ` audits every command root: ambiguous script
112+ directories, ` ../ ` imports that break ` --cp ` /` --mv ` , empty command
113+ directories, untrusted overlays, missing descriptions, shadowed commands, and
114+ stale ` --agents ` pointer blocks.
115+
116+ ## MCP
117+
118+ ` cli --mcp ` serves the command tree as MCP tools over stdio (JSON-RPC 2.0,
119+ zero dependencies), so agent runtimes can discover and call the same commands
120+ humans use. Untrusted local overlays are excluded.
121+
122+ ## Packs
123+
124+ Install commands from any Git repository that carries a ` .cli/ ` tree:
125+
126+ ``` sh
127+ cli --add https://example.com/org/pack.git # into ~/.cli
128+ cli --add https://example.com/org/pack.git --prefix vendor
129+ cli --add https://example.com/org/pack.git --to local # into this repo
130+ ```
73131
74132## Development
75133
0 commit comments