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

CommandWhat 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-globalSign 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 projectsThe 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

CommandWhat 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 --statuslineAlso 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

CommandWhat it does
knwlge sidecar startInstall or reconcile the background service, and start it.
knwlge sidecar start --foregroundRun it in this terminal instead, until Ctrl+C.
knwlge sidecar statusThe sidecar's and the session's state, as JSON.
knwlge sidecar service-uninstall --platform <darwin|linux|win32>Remove the service.
knwlge statuslineOne line about the last brief, for Claude Code's status line.
knwlgeThe control panel.

Memory

CommandWhat 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

CommandWhat 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 checkAsk your server for the signed CLI release it offers, and stage it when it is new.
knwlge update bootstrapInstall that release and switch the sidecar and Codex to the managed launcher, which follows later releases.
knwlge update statusWhat the managed launcher runs, and the last check.
knwlge --versionThe 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

SettingValueNotes
KNWLGE_SESSION_CAPTURE_ENABLEDtrueSession capture in a sidecar started with it; the organization's policy and your opt-out still decide.
KNWLGE_LEARNING_NUDGEonThe learning nudge: on or off.
KNWLGE_UPKEEPonThe background upkeep of the team's documents: off stops it.
KNWLGE_UPKEEP_MAX_PER_DAY20Upkeep 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_FILEfalseStore 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.