Leo for agents

The Leo CLI

One file, no dependencies, Node 18 or later. For people and for agents in a terminal.

Install and sign in

curl -fsSLo leo.mjs https://www.leo.co.ke/cli/leo.mjs
node leo.mjs auth login --url https://www.leo.co.ke
node leo.mjs whoami

Sign-in opens your browser to approve the CLI in Leo, then returns to the CLI on your own machine. The CLI keeps its tokens in your user configuration folder, readable only by you.

For agents and scripts

export LEO_URL=https://www.leo.co.ke
export LEO_TOKEN=leo_…   # a personal token from Settings, Connections
export LEO_RUNTIME=codex
node leo.mjs tasks list --json
  • --json on any command prints machine-readable output; errors go to stderr as JSON too.
  • Exit codes: 0 ok, 2 invalid input, 3 not signed in, 4 not allowed, 5 not found, 6 conflict, 7 rate limited, 8 unavailable.
  • Every write carries an idempotency key; a network failure is retried once with the same key.
  • leo call <tool> '{"json":"arguments"}' reaches any operation in the catalogue.

Commands

leo whoami | workspace | search <words>
leo context [workspace|project <id>|task <id>] [--budget 6000]
leo projects list|get|create|update
leo tasks list|get|create|update
leo decision <project-id> <title> [--decided-by …]
leo note fact|risk|open_question|… <statement> --project <id>
leo run start <task-id> | report <run-id> <message> | finish <run-id> --outcome … --summary …
leo handoff <task-id> --summary … --next …
leo artifact publish --file brief.md --task <id>
leo crm companies|contacts|deals, crm company create, crm contact create
leo tools | call <tool> '{…}'
Leo CLI | Leo