# CLI agents

Use an agent you already run from the terminal inside your writing workspace.

Bring your installed agent into Oleafly. The **CLI Agent** mode uses that agent's runtime and sign-in, so you can work beside the manuscript with the tools you already use.

![Settings → AI Assistant → CLI agents. Check installed agents at the top, then expand an agent to finish its setup.](https://cdn.oleafly.com/images/screenshots/desktop/docs/settings-cli-agents-dark-window-v2.png#view=519,89,883,902)

## Connect an agent

1. Open **Settings → AI Assistant → CLI agents**.
2. Choose an agent from the catalog. Follow its install or discovery controls.
3. Sign in through the agent's own flow when required.
4. Open the assistant, switch to **CLI Agent**, and select the agent.
5. Start with a small task, such as explaining the project structure or revising one paragraph.

Authentication, model access, and billing belong to the selected agent. An account or subscription that supports the CLI can be used according to that provider's terms; Oleafly does not add a separate AI subscription.

## Agent catalog

| Agent | CLI command |
| --- | --- |
| Claude Code | `claude` |
| Codex CLI | `codex` |
| Gemini CLI | `gemini` |
| Pi | `pi` |
| OpenCode | `opencode` |
| OpenClaw | `openclaw` |
| Cline | `cline` |
| Hermes Agent | `hermes` |
| CodeBuddy | `codebuddy` |
| Kimi Code | `kimi` |
| Grok Build | `grok` |
| Cursor | `agent` |
| DeepSeek Harness | `dsh` |
| Qoder | `qodercli` |

The catalog identifies supported launch paths. Available models, attachments, session resume, and usage reporting depend on what the agent exposes. Setup reports missing requirements before a session starts.

## Work beside the manuscript

Give the agent a concrete request and follow its replies, tool activity, and permission prompts in the assistant panel. Open the resulting source and compile it in Oleafly.

> Read the introduction and methods. List any terms that are introduced inconsistently, with file locations.

For a separate copy and final review, choose an available agent in [Research tasks](/docs/research-tasks/). That page lists the platform requirements for isolated work.

## Custom agents

Add a custom definition when you have another compatible agent. Review its executable or package, arguments, and connection requirements in Settings before running it. Registering a definition does not itself run the command.

## Use an external client instead

If you prefer to stay in your agent's own interface, enable [Oleafly's MCP server](/docs/mcp/). It exposes project tools to an external client while Oleafly remains open.
