Klaus Cli

Klaus, in your terminal

Read code, edit it, run commands and review changes from any terminal, without opening the Klaus window. Configuration, sessions and memory are shared with the desktop app.

Supports macOS Apple Silicon and Windows x64

One command to install

One command each for macOS and Windows. The script verifies the sha256 before writing to disk, and no admin rights are needed.

Install command

Shares everything with the desktop app

Configuration, skills, hooks and MCP servers are all read from ~/.klaus, and a session opened in the terminal shows up in the desktop app.

How it relates to the desktop app

Fits into scripts and CI

klaus exec runs and exits with the result in the exit code; --json prints one structured event per line.

Usage guide
macOS
curl -fsSL https://klaus-ai.cn/install.sh | sh

Installs to ~/.klaus/bin without sudo. The script verifies the sha256 before writing to disk.

Windows
curl -fsSLo install.bat https://klaus-ai.cn/install.bat && install.bat

Installs to %LOCALAPPDATA%\Klaus\bin and adds it to your user PATH. No admin rights needed.

One command, installed

One command per platform, and the script verifies the sha256 before writing anything to disk. Re-running the same command is the upgrade — it replaces the old version in place.

Installation guidev0.1.5 · released · macOS 38.7 MB · Windows 37.7 MB

The commands you'll type most after installing

These are CLI-only entry points, built for scripts, hooks and pipelines.

Interactive session

klaus

One line per turn. Keep typing while a turn runs and it is queued; slash commands switch model and permission mode mid-session.

One-shot run

klaus exec "split this function up"

Runs and exits, with the result in the exit code, so it drops straight into scripts and CI.

Code review

klaus review

Reviews uncommitted changes in the workspace, or a branch, a commit or specific files, and produces structured findings.

Direct MCP call

klaus mcp call

Calls a named MCP server's tool directly, bypassing the model — for checking that a configuration works and the parameters are right.

If it won't run after installing, it's usually one of these

Which platforms are supported?

macOS Apple Silicon released, Windows x64 released. Only these two platforms are supported today; on any other platform the install script stops immediately rather than failing halfway.

Getting command not found after installing?

The install directory isn't on your PATH. Add the line the install script printed last to your shell configuration, or just use the full path ~/.klaus/bin/klaus. On Windows, open a new terminal: the PATH written by setx doesn't apply to windows that are already open.

How does it relate to the desktop app?

Two ways to use the same Klaus. User-level configuration, skills, hooks and MCP servers live in ~/.klaus; project-level ones live in .klaus inside the project directory. Both read the same files, and session records go to ~/.klaus/sessions by default, so a session opened in the terminal shows up in Klaus.

Can it go into scripts and CI?

klaus exec runs and exits with the result in the exit code. --json prints one structured event per line, diagnostics go to stderr, and stdout is clean enough to pipe as data.

How do I upgrade?

Run the install command again — that is the upgrade, and it replaces the old version in place. The script compares the sha256 after downloading and aborts without writing any file if it doesn't match.