The CLI
Command reference
Every knwlge command. Most print JSON for scripts; on a terminal they open with a short banner — the version, who is signed in, and where the CLI keeps its files. --json leaves the banner out.
Sign-in and projects
| Command | What it does |
|---|
knwlge init --api-url <server> | Sign in through Knwlge Global in the browser and connect that server's project. --no-browser prints the address instead of opening it. |
knwlge login --api-url <server> --via-global | Sign in again — to choose another project on the server, or another way of signing in. |
knwlge login --api-url <server> --token-file <path> | Store the token the sign-in page showed when it could not reach this machine. Delete the file afterwards. |
knwlge logout [--project <name> | --all] | Revoke the session at Knwlge Global and forget the saved credentials. |
knwlge projects | The connected projects, their repositories, and this folder's project. |
knwlge projects which [--dir <path>] | Which project a folder uses, and why. |
knwlge projects pin --project <name> [--dir <path>] | Always use a project in a folder and the folders under it; unpin undoes it. |
knwlge projects refresh [--project <name>] | Read the repository lists from the servers now. |
knwlge context select --org <id> --team <id> | Choose the organization and team, when you belong to several. |
Wiring clients
| Command | What it does |
|---|
knwlge install --clients <list> --auto-invoke --repo-root "$PWD" | Install hooks, the MCP entry and, for instruct-channel clients, the rules block. Backs up what it touches. |
knwlge install --clients claude_code --statusline | Also show the last brief in Claude Code's status line, when none is set. |
knwlge reinstall [--clients <list>] [--dry-run] | Move the wiring and the service from another copy of the CLI to this one, keeping you signed in. |
knwlge uninstall --repo-root "$PWD" | Remove everything install added, restoring the backups. |
knwlge repo bind-remote --repo-id <id> | Bind a private remote or mirror to a repository the server knows, from a checkout (admins). |
The sidecar
| Command | What it does |
|---|
knwlge sidecar start | Install or reconcile the background service, and start it. |
knwlge sidecar start --foreground | Run it in this terminal instead, until Ctrl+C. |
knwlge sidecar status | The sidecar's and the session's state, as JSON. |
knwlge sidecar service-uninstall --platform <darwin|linux|win32> | Remove the service. |
knwlge statusline | One line about the last brief, for Claude Code's status line. |
knwlge | The control panel. |
Memory
| Command | What it does |
|---|
knwlge remember "<note>" [--scope <scope>] | Save a memory yourself. Without --scope it is private unless it names a repository; --scope makes it a team, repository, organization or branch memory. |
knwlge recall --query <text> | Search the memories you can read. |
knwlge memories list [--scope …] [--status …] | List your memories, with their status. |
knwlge memories edit <id> [--title …] [--body …] | Change one; every change is a new version. |
knwlge memories forget <id> | Archive one. |
knwlge memories request-promotion <id> --scope <scope> | Ask for a private memory to become a shared one; a reviewer decides. |
Diagnostics and updates
| Command | What it does |
|---|
knwlge status --repo-root "$PWD" | The session, wiring and effective capture policy, as JSON. |
knwlge doctor --repair --repo-root "$PWD" | Check the install end to end and fix what it safely can. |
knwlge update check | Ask your server for the signed CLI release it offers, and stage it when it is new. |
knwlge update bootstrap | Install that release and switch the sidecar and Codex to the managed launcher, which follows later releases. |
knwlge update status | What the managed launcher runs, and the last check. |
knwlge --version | The CLI's version. |
Most people update the way they installed: brew upgrade knwlge, or the install script again. Then run knwlge sidecar start, so the service runs the new version, and restart open agent sessions.
Environment variables
| Setting | Value | Notes |
|---|
KNWLGE_SESSION_CAPTURE_ENABLED | true | Session capture in a sidecar started with it; the organization's policy and your opt-out still decide. |
KNWLGE_LEARNING_NUDGE | on | The learning nudge: on or off. |
KNWLGE_UPKEEP | on | The background upkeep of the team's documents: off stops it. |
KNWLGE_UPKEEP_MAX_PER_DAY | 20 | Upkeep runs per project per day. |
KNWLGE_UPKEEP_WITH_MODEL | (small model) | session, or a model name, for the upkeep's model. |
KNWLGE_ALLOW_PLAINTEXT_TOKEN_FILE | false | Store sessions in a file instead of the keychain. For test machines only. |
The CLI keeps its state in ~/.team-context-gateway/: the project registry, backups of the files install changed, the activity and upkeep logs. Sessions themselves are in the operating system's keychain — the macOS Keychain, the Linux Secret Service or Windows DPAPI.