The Dosu CLI is the dosu command, published on npm as @dosu/cli. It connects your local coding agents to Dosu so they pull relevant team knowledge into context automatically and can save what they learn back to the knowledge base. This page covers what the CLI does, how to install it, and how to use it.
What the CLI does#
The CLI sets up the Dosu MCP Server for the coding agents you already run, so an agent can query your Libraries on demand (the read_knowledge, write_knowledge, review_knowledge, and finalize_session_knowledge tools). See Dosu MCP Server for what the server exposes.
The MCP Server gives your agent tools to read and write Dosu knowledge when it decides the context calls for it, letting you and your agent pull relevant context from your Libraries on demand and save durable learnings back.
Prerequisites#
- A Dosu account and at least one Library with Sources connected. Create one at Libraries.
- A deployment API key for authentication. The CLI uses a long-lived deployment API key (the same key the MCP Server uses), which avoids session token expiry during long agent runs. Manage keys in Settings, Account, API keys.
Install and connect#
Run the guided setup:
curl -fsSL https://cli.dosu.dev/install | sh
Setup detects the coding agents installed on your machine (Claude Code, Cursor, VS Code, and others) and lets you choose which ones to connect to the Dosu MCP Server. It also installs the Dosu skill, a set of agent instructions that tell the agent how to use Dosu well, and keeps skills up-to-date when you upgrade. For supported agents, setup enables a session-end hook that studies finished agent sessions in the background. Background studying requires Claude Code to be installed; without it, the hook will report that studying is unavailable, though other MCP features continue to work.
If your Library has no GitHub repositories connected yet, setup will warn you that the MCP Server can't answer questions from your code and offer to connect a repository. You can connect one immediately through the setup flow or skip and connect later via the Libraries page, dosu sources connect github, or by re-running dosu setup.
To connect an agent that was not auto-detected, add it by name:
dosu mcp add <agent>
CLI commands#
dosu upgrade#
Update Dosu to the latest version through the package manager that installed it (npm, pnpm, Yarn, or Homebrew), then re-run the interactive dosu setup wizard on the upgraded version so configured agents pick up the current MCP entry format, hooks, rules, and skills:
dosu upgrade
For a non-interactive upgrade, pipe input to prevent prompts:
dosu upgrade < /dev/null
When run non-interactively, the command runs dosu mcp refresh instead of the full setup wizard, updating only the MCP configuration entries.
If you upgrade Dosu directly through npm, Homebrew, or npx @dosu/cli@latest instead of using dosu upgrade, the next command you run will silently refresh configured agents' MCP entries if the new version changed the entry format. You can also manually refresh after a direct upgrade with dosu mcp refresh.
dosu mcp refresh#
Manually refresh the Dosu MCP configuration entry in every already-configured AI tool:
dosu mcp refresh
This command rewrites the MCP entries with the current CLI version's format. Use it after upgrades done directly through npm or Homebrew (when the CLI version changes but the dosu upgrade command wasn't used), or when you want to ensure all configured tools have the latest MCP entry format without running the full setup wizard.
The refresh is automatically triggered by a post-upgrade safety net when the CLI detects it's running a version that changed the MCP entry format. You can run dosu mcp refresh manually at any time to force the refresh.
Using the Dosu MCP Server#
Once connected, your agent can use the Dosu MCP Server tools to query your Libraries. The agent decides when to call these tools based on your prompts and its needs:
read_knowledge— Read relevant team knowledge before starting non-trivial work.write_knowledge— Save durable learnings discovered during the session.review_knowledge— Inspect and manage pending knowledge items.finalize_session_knowledge— Mark knowledge read or written this turn as complete (called once at turn end).
Your agent can access these tools directly through the MCP Server once it's configured. You don't need to do anything special to enable them beyond the initial setup.
Availability and notes#
- The Dosu MCP Server works with coding agents that support the Model Context Protocol, including Claude Code, Cursor, VS Code with Cline, and others. Use
dosu setupordosu mcp addto configure your agent. - Background studying (the session-end hook that learns from your agent sessions) requires Claude Code. The MCP Server tools (
read_knowledge,write_knowledge, and others) work with any MCP-compatible agent. - The MCP Server reads from the Libraries your deployment can access. Connect Sources in a Library first so there is knowledge to query. See Sources.
- Usage tied to MCP queries counts toward your plan. For current plans and limits, see plans, billing, and access or Settings, Organization, Billing.