@ctrlai/cli
v0.1.4
Published
ctrlai — your Context Key, in one command. `npx @ctrlai/cli init` writes CLAUDE.md / .cursorrules / AGENTS.md from one source (no account, nothing leaves your machine); also emit, fetch ready-to-inject context, and seed your self from a repo. A thin clien
Maintainers
Readme
@ctrlai/cli — your Context Key, in one command
The 60-second try, no account needed: run one command in any repo and the files your AI tools read — CLAUDE.md, .cursorrules, AGENTS.md — appear, written from one source. Nothing leaves your machine.
npx @ctrlai/cli init # scan THIS repo → write CLAUDE.md · .cursorrules · AGENTS.md from one sourceThat's it — no key, no signup, no network. It reads your rules files + stack locally and writes the unified rules files your tools already load. Re-run any time; your own lines outside the managed block are always kept.
When you want your context live in every tool (always fresh, scoped per tool, revocable), get a free Context Key and the same CLI serves it:
export CTRL_KEY=ck_live_… # from <web>/control-panel → Keys → Issue
export CTRL_API=http://localhost:3000 # dev (default: https://api.ctrlai.com)
npx @ctrlai/cli emit # writes the files from your bound face, live
npx @ctrlai/cli context --task "write a SQL migration" # the task-shaped, ready-to-inject block
npx @ctrlai/cli seed . # scan THIS repo locally → propose atoms to ratify in the webInstalled globally (npm i -g @ctrlai/cli), the command is ctrlai.
Commands
| Command | What | Account? |
|---|---|---|
| ctrlai init [dir] [--dry] | scan the repo locally → write CLAUDE.md · .cursorrules · AGENTS.md from one source. --dry previews. Preserves your lines outside the managed block. | no |
| ctrlai emit [--dir .] [--targets …] [--local] | write the rules files. --local = render from a local repo scan (no key). Default = the live served slice of your bound face via GET /api/v1/context?format=<t>. | --local: no |
| ctrlai context [--task "…"] [--json] | no task → static (the whole bound face); --task → dynamic (task-shaped, select-and-drop). Prints the systemBlock (or --json). | yes |
| ctrlai seed <path> [--dry] | scan the repo locally → POST /api/v1/seed to propose atoms to ratify. --dry previews, posts nothing. | --dry: no |
| ctrlai config [set key\|api <value>] | show config, or save to ~/.ctrl/config.json (env CTRL_KEY/CTRL_API win). The key is never logged. | — |
| ctrlai --help · ctrlai --version | | |
init, seed --dry, and emit --local run fully local — no account, nothing leaves your machine.
The wall (what crosses, and what never does)
- Local commands are local.
init/seed --dry/emit --localread only the §5 allowlist — rules/convention files,package.json(deps + scripts), the lockfile name, and tsconfig/eslint/prettier presence. They never read.env*, source code, or lockfile contents, and they make no network call. The files they write are a local draft (clearly labeled), not a released Face. - The key is the boundary.
emit(live) /contextonly ever return your key's bound face ∩ ceiling (pseudonymous unless the key is identified) — the server enforces it. A revoked/expired key gives a clean "invalid/expired/revoked" error. seedproposes; it never releases. The only thing that leaves your machine is the candidate list you're about to ratify — and a proposal is not an atom: nothing becomes part of you until you ratify it in the web.
Build (local / pre-publish)
pnpm install
pnpm --filter @ctrlai/cli build # tsc → dist/
node packages/cli/dist/ctrl.js --helpPublished as
@ctrlai/cli→npx @ctrlai/cli …. A thin OSS client (MIT); the paid intelligence stays server-side.
