Overview
Klaus Cli is another entry point to the same engine: core capabilities, how it works, the ways you can run it, and when to use each.
Klaus Cli is another entry point to the same engine, and its executable is called klaus. It reads the same configuration, skills, plugins, and MCP servers as the Klaus desktop app, so anything you set up in Klaus is immediately available in the terminal, and vice versa.
It is built for people who prefer to stay in the terminal. You use it conversationally: you say what you want in natural language, and Klaus decides which files to read, which tools to call, and which commands to run, checking with you before key operations according to your permission settings.
Core capabilities
Read and edit code
- Understands project structure and dependencies across files, and edits directly in your real working directory.
- Describe a bug and it locates and fixes it, or ask it to extract and refactor a piece of logic.
- Review changes with
klaus review: by default it reviews uncommitted changes in the workspace, but you can also point it at a baseline branch, a specific commit, or specific files.
Connect external capabilities
- Plug into external services and custom tools through MCP.
klaus mcpcan also call a specific tool directly without going through the model, which is useful for verifying that a configuration works. - Skills, plugins, sub-agents, and hooks share the same files as the desktop app: install once, and both surfaces have them.
Wire it into automation
klaus execruns and exits, with an exit code that reflects the result, so you can drop it straight into scripts and CI.--jsonoutputs the engine's raw protocol, one value per line, with diagnostics on stderr, so stdout can be treated as pure data.
How it works
At the core is an agent loop: it takes your request, plans steps, calls tools, and decides what to do next based on the results. Four elements work together:
- Engine: understands intent, plans, and decides the next action. One session corresponds to one thread in the engine.
- Tools: how it interacts with your project and environment — reading and writing files, running commands, searching code, and fetching web pages.
- Permissions: actions with side effects are allowed, prompted, or denied by rules — the same rules the desktop app uses.
- Context: conversation history, project instruction files, matched memories, and tool results form its background information, and the context is automatically compressed as it approaches the window limit.
For a deeper look at how this works, see How a turn runs and How permissions are resolved.
Ways to run it
There are different ways to do the same job:
- Interactive session: run
klausdirectly, one line per turn — the most common way. A line you type while a turn is in progress is fed into the current turn instead of being queued. - One-shot execution:
klaus exec "…"runs and exits, which suits scripts and CI. - Ask without a trace:
klaus askdoes not write to session history — good for looking things up. - Review code:
klaus reviewproduces structured findings with locations. - Drive an existing engine: use
--remote ws://host:porttogether withklaus serve, so no second engine is started inside this process.
When to use it
- You don't want to leave the terminal: your editor, shell, and git all live in one window, and your tasks start there too.
- SSH-only machines: a remote server has no graphical interface, so the command line is the only way in.
- Pipeline integration: run it non-interactively in CI and consume results through exit codes and
--json. - Verifying MCP configuration: call tools directly without going through the model to confirm that servers and parameters are correct.
- Repetitive batch work: write a script that loops over
klaus exec— cheaper than clicking through the UI again and again.
Next steps
- Not installed yet: Install and upgrade — one command per platform.
- Already installed: Everyday usage covers interactive sessions and all subcommands, and Global options covers which parameters you can fix when a session is created.
- Wondering how it divides work with the desktop app: Relationship with Klaus.
- Command not found after install, no release for your platform, or a checksum mismatch: FAQ.