@mcclowes/clip
v0.5.0
Published
CLI capabilities shared by people and agents
Maintainers
Readme
CLIP
Command Line Interface Protocol. Register CLI tools, describe their capabilities, and generate skills that let agents use the same tools you do.
CLIP keeps execution on the command line. It doesn't proxy commands or manage credentials. Agents call the original executable with its existing authentication and permissions.
Documentation and tool directory · CLI Spec v0.2
Install
brew install mcclowes/clip/clip
clip --versionThe Homebrew formula installs Node.js 24 or later. No runtime npm dependencies are needed.
Use
clip discover
clip registry search git
clip schema show git
clip registry add git --purpose "Review repository changes"
clip syncThis writes .agents/skills/clip-git/SKILL.md, with a usage line per command and reference files in commands/, to your project, and adds a one-line pointer to it in AGENTS.md. Adding a registry schema requires the executable to be installed already. It doesn't install or execute the tool.
If you need to install a CLI first, getcli provides a separate registry for discovering, installing, and verifying command-line tools. CLIP can then describe the installed tool and generate its agent skill.
For tools with native introspection:
clip register mytool --purpose "Manage deployments" --probe schema
# Or: --probe capabilities
clip syncFor tools without it:
clip schema init mytool --purpose "Manage deployments" --file mytool.json
# Add real operations to the draft's commands list.
clip lint mytool.json
clip register mytool --purpose "Manage deployments" --schema mytool.json
clip syncOr let your agent draft it. clip sync installs a clip-schema-authoring skill that walks the tool's --help output, sets mutation markers conservatively, and loops on clip lint until the draft is clean.
A minimal capability document:
{
"name": "mytool",
"commands": [
{ "name": "list", "description": "List deployments", "mutating": false }
]
}CLIP accepts capabilities instead of commands, and preserves richer native CLI Spec fields, including nested commands. Missing mutation markers mean unknown. Schemas describe capabilities; they never grant authorization.
Fewer permission prompts
clip permissions # proposes Claude Code allow rules, writes nothing
clip permissions --write # merges them into .claude/settings.local.jsonEach command marked mutating: false becomes a rule such as Bash(gh pr list:*), so your agent stops asking before read-only calls. Only reviewed bundled schemas qualify; add --trust <tool> for one you wrote. Mutating commands, unknown markers, parent commands, and paths with placeholders or flags never get a rule, so they keep prompting. The output lists the rules it would add and why everything else was skipped.
Use clip list and clip remove mytool to maintain registrations, or clip ui to manage them and browse the registry interactively. Inside a Git project, changes default to the uncommitted .clip/tools.local.json. Use --scope shared for the repository's .clip/tools.json, or --scope global for ~/.config/clip/tools.json. Local registrations override shared registrations, which override global ones. Removing an inherited tool disables it in the selected project scope.
Run clip sync after changes. Set --skills-dir to your agent's skills directory. CLIP refuses to replace unowned skill directories; generated files should be edited through their source schemas.
Sync also keeps a block in AGENTS.md listing project registrations with their purpose and skill path, so harnesses without skill support still find them. Global registrations are kept out of this shared file. CLIP edits only between its <!-- clip:begin --> and <!-- clip:end --> markers, preserves existing file permissions, and refuses a damaged block. Use --agents-file CLAUDE.md for another file, or --target skills or --target agents-md to sync just one.
For the project's own scripts, describe them in .clip/commands.md, a Markdown runbook whose decorators tell agents what each command does:
- Check: `npm run check` — what CI runs #safe #ci
- Deploy: `npm run deploy` #destructiveRun clip commands init to seed one from local task manifests without running their tools, clip commands check --strict in CI to catch manifest drift and missing effects, and clip sync to list the commands in AGENTS.md. The seed leaves effects unknown, so review and decorate each command. Use <!-- clip:ignore npm run private-task --> for a manifest task agents should not see. See project commands.
After updating registered tools or CLIP's bundled registry, run clip doctor to check for missing executables and schema drift. clip refresh reloads file and native-probe schemas, then shows the rendered agent-facing diff for each registry update without adopting it. Mutation-marker changes are called out separately. Run clip refresh --accept <tool> to adopt a reviewed update, or clip refresh --accept-all in CI. Manual registrations have no schema source to refresh. Native diagnosis and refresh rerun the explicitly registered, bounded probe command.
CLI behavior
clip schemaandclip capabilitiesdescribe CLIP offline without configuration.--output auto|json|textselects output; pipes default to JSON.- List results use an
itemsenvelope withtotalandtruncated.--limitdefaults to 100. - Failures exit 1 and write a structured error to stderr.
- Discovery scans PATH without executing tools. Native probing is explicit, shell-free, and bounded to five seconds and 1 MiB.
- Registrations merge from global, shared project, and local project configuration.
CLIP_HOMEchanges the global directory. - Each release bundles the community registry. Upgrade CLIP, review the
clip refreshoutput, then accept catalog updates explicitly. Local schema files and native probes use the same refresh workflow.
Development
npm ci
npm test
npm run build
npm run registry:check
node packages/cli/dist/main.js --help
node scripts/site-registry.mjs
cd site
npm ci
npm run devThe CLI is TypeScript with no runtime dependencies, and a test keeps it that way. The docs site is a static Docusaurus build; its build fails unless every npm package in the client bundle matches the reviewed license inventory in site/third-party/, and it publishes their notices at /third-party-notices.txt. Registry JSON is the source of truth for both surfaces.
See the specification, eval findings, contributing, the changelog, and release instructions. Report vulnerabilities privately as described in SECURITY.md. Everyone taking part follows the code of conduct.
