@nnlr/cai
v0.2.0
Published
cli-ai command line interface
Downloads
42
Readme
CLI-AI (cai)
cai turns a plain-English request into a shell command you can run in your terminal.
Install
Requires Node.js 18 or newer.
npm install -g @nnlr/caiGit-based installs such as npm install -g nnlr/cai are not supported.
Install from the npm registry instead.
First run
Run:
cai --bootstrap
# or
cai -bOr simply run:
caiWith no arguments, cai prints a short usage message.
If ~/.cai/config.json does not exist, cai will bootstrap itself:
- it reads
OPENAI_API_KEYif available, or prompts for an API key - it lists supported OpenAI models for agent-style tasks
- it asks you to choose a model
- it creates
~/.cai/config.json - it runs a quick smoke test and prints a reply such as
Ready to go!
~/.cai/config.json stores the saved API key, default model, and optional base URL.
Usage
cai find all jpg files modified in the last 7 daysUseful commands:
cai --bootstraporcai -bcai --raw "write a haiku about bash"orcai -r "write a haiku about bash"cai --list-modelsorcai -lcai --pick-modelorcai -pcai --model <model> "<request>"orcai -m <model> "<request>"cai --memory-editorcai -ecai --history 10orcai -n 10cai --history-clearorcai -Ncai --bash-bindorcai -Bcai --helpfor the full help message
Behavior notes:
- In normal command mode,
caimay inspect the current working directory with read-only tools before producing a final command. - For multi-step tasks,
caican write a temporary script and return one runner command for it. - When stderr is a TTY,
caishows a lightweight status animation while waiting on API responses. - Use
--no-memoryto skip~/.cai/memory.mdfor one request and--no-historyto avoid recording an invocation.
More Docs
- Advanced setup and configuration: docs/REFERENCE.md
- Development notes: DEVELOPMENT.md
