Skip to content

Quickstart

Terminal window
npm install -g @koda-rising/cli # Node.js 20 or later
koda --version # confirm the version that installed
koda login # opens your browser — approve, and you are signed in

On a machine with no browser (SSH, a container, a remote editor), use koda login --device and type the code it prints into a browser anywhere. Prefer the editor? Install Koda Rising from the VS Code Marketplace and run Koda: Sign In — see the CLI guide for both.

Usage is prepaid in your currency; top up on a local rail (card, USSD, OPay, PalmPay, M-Pesa, MoMo, …):

Terminal window
koda topup 5000 # ₦5,000 — returns a checkout link or USSD code; credited when the provider confirms
koda verify <reference> # optional: check it landed (the provider usually credits it before you ask)
koda wallet # balance

The interactive agent works in the folder you run it from:

Terminal window
cd my-project
koda # then: "add a null check to parseUser() in src/user.ts"

It reads and searches on its own, asks before every edit and command, and shows what each turn cost. Or as one command that prints a preview and exits:

Terminal window
koda run "add a null check to parseUser()" --file src/user.ts # preview the edit
koda run "add a null check to parseUser()" --file src/user.ts --apply # write it

Add a KODA.md at your repository root with your conventions (“use tabs”, “tests live beside the code”) and every surface follows it.

4 — From code: an API key, the SDK, or raw HTTP

Section titled “4 — From code: an API key, the SDK, or raw HTTP”

For CI and programs, create a scoped key (shown once):

Terminal window
koda keys create ci --scopes agent:run,wallet:read

Keys authenticate as Authorization: Bearer <key> and carry scopes (agent:run, wallet:read, keys:manage, metrics:read). Browser sessions use a sealed cookie instead.

// SDK (streaming)
import { KodaClient } from '@koda-rising/sdk';
const koda = new KodaClient(BASE_URL, TOKEN);
for await (const ev of koda.agentRun('add a null check to parseUser()', [{ path: 'src/user.ts', content }])) {
if (ev.error) throw new Error(ev.error); // a failed run says so — check it
if (ev.edits) applyEdits(ev.edits);
if (ev.costMinor != null) console.log(ev.summary, `cost=${ev.costMinor}`);
}
Terminal window
# Raw HTTP (SSE)
curl -N "$KODA_GATEWAY/agent/run" -H "authorization: Bearer $KODA_TOKEN" \
-H 'content-type: application/json' -d '{"prompt":"add a null check"}'

5 — (optional) Index your repo, then chat

Section titled “5 — (optional) Index your repo, then chat”
Terminal window
koda repo index src/**/*.ts # the agent retrieves from it automatically (vector mode)
koda chat "how does billing work in this codebase?"

Chat threads stream token by token — see POST /chat/threads/:id/messages in the API reference.

Next: Concepts.