DocsGPT-cli

module
v1.9.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 14, 2026 License: MIT

README

docsgpt-cli

Chat with your DocsGPT agents from the terminal, pipe questions through them, and manage agents and sources as code.

Install

curl -fsSL https://docs.ac/install-cli | bash

The script downloads the release for your platform, checks it against the published checksums and puts it on your PATH. Other ways:

  • Windows (PowerShell): irm https://docs.ac/install-cli.ps1 | iex
  • Homebrew (macOS): brew tap arc53/docsgpt-cli && brew install --cask docsgpt-cli
  • Go: go install github.com/arc53/DocsGPT-cli/cmd/docsgpt-cli@latest
  • Binary: an archive from Releases, then ./docsgpt-cli install
  • Source: git clone https://github.com/arc53/DocsGPT-cli && cd DocsGPT-cli && make build

It keeps itself up to date. See Install and update.

Quickstart

Copy an agent's API key from DocsGPT (Agent settings → API key), then:

docsgpt-cli login                            # paste the key; it is checked and saved
docsgpt-cli                                  # chat
docsgpt-cli "how do I rotate the API key?"   # ask once and exit
git diff | docsgpt-cli "review this"         # send piped input along
docsgpt-cli -c                               # continue the latest chat here

The first chat asks for a key if you skip login. When stdout is not a terminal, only the answer is written, as plain text:

tail -n 50 app.log | docsgpt-cli "why does this fail?" > diagnosis.md

More in the quickstart.

What you get

  • A full-screen chat. It scrolls with the wheel and the keys while answers stream in, copies the text you select with the mouse, and leaves the conversation in your scrollback when you quit. Multi-line input, prompt history, $EDITOR, / commands and !cmd to share a command's output. Chat
  • Images and files. Paste a screenshot with Ctrl+V, drop files on the window, or name them: docsgpt-cli "why?" @shot.png @spec.pdf. Attachments
  • Sessions. Every chat is saved per directory; -c continues the latest, -r picks one. Sessions
  • Local tools. The agent can run commands and read and write files, after you approve each one. Tools and approval
  • Sources shown. Answers end with the documents they drew on.
  • Agents as code. Export agents as YAML, review a plan, apply it from CI. Agents as code
  • Sources from CI. Upload docs, wait for ingestion, replace the old copy. Sources
  • Bench. Assert on your agents' answers, compare agents and models. Bench
  • Host mode. Pair a machine with your DocsGPT account and let agents run tools on it, including background commands of up to an hour that you can cancel, with results that survive network drops and restarts. Host mode
  • Auto-update. New releases are downloaded, verified and installed in the background. Updating
  • A Go SDK. The chat client the CLI is built on. sdk

Documentation

  • Docs index
  • Configuration: config file, credentials, environment variables, settings
  • CI: GitHub Actions for sources, agents, bench and webhooks

Run docsgpt-cli <command> --help for every flag.

Contributing

Read AGENTS.md for the development rules and RELEASING.md for how releases are cut. Please follow the Code of Conduct.

License

MIT

Directories

Path Synopsis
cmd
docsgpt-cli command
internal
attach
Package attach holds the files a message carries: images and documents attached with @path, a pasted or dropped path, or Ctrl+V. They go to the server inline, as content parts of the message (see docsgpt.Message), and the server stores them as the conversation's attachments.
Package attach holds the files a message carries: images and documents attached with @path, a pasted or dropped path, or Ctrl+V. They go to the server inline, as content parts of the message (see docsgpt.Message), and the server stores them as the conversation's attachments.
bench/assert
Package assert evaluates a case's expect sections against a target result.
Package assert evaluates a case's expect sections against a target result.
bench/judge
Package judge grades an answer with a second agent (LLM-as-judge) through the OpenAI-compatible /v1/chat/completions endpoint.
Package judge grades an answer with a second agent (LLM-as-judge) through the OpenAI-compatible /v1/chat/completions endpoint.
bench/pricing
Package pricing turns token usage into an estimated USD cost.
Package pricing turns token usage into an estimated USD cost.
bench/report
Package report renders a runner.SuiteResult in several forms — a colored terminal summary, machine-readable JSON, JUnit XML for CI, an A/B comparison table, and a diff against a saved baseline — plus the run-history store under ~/.docsgpt/bench.
Package report renders a runner.SuiteResult in several forms — a colored terminal summary, machine-readable JSON, JUnit XML for CI, an A/B comparison table, and a diff against a saved baseline — plus the run-history store under ~/.docsgpt/bench.
bench/runner
Package runner executes a filtered set of benchmark cases against DocsGPT agents and collects a structured, JSON-serializable result tree.
Package runner executes a filtered set of benchmark cases against DocsGPT agents and collects a structured, JSON-serializable result tree.
bench/spec
Package spec defines the benchmark suite format: a root directory with an optional bench.yaml (suite defaults) and any number of case directories, each holding a case.yaml plus optional attachment files.
Package spec defines the benchmark suite format: a root directory with an optional bench.yaml (suite defaults) and any number of case directories, each holding a case.yaml plus optional attachment files.
bench/target
Package target sends one benchmark question to a DocsGPT agent through one of four protocols: the OpenAI-compatible /v1/chat/completions endpoint (single JSON response or SSE), the native /stream SSE endpoint, the native /api/answer JSON endpoint, or an agent incoming webhook (async, with /api/task_status polling).
Package target sends one benchmark question to a DocsGPT agent through one of four protocols: the OpenAI-compatible /v1/chat/completions endpoint (single JSON response or SSE), the native /stream SSE endpoint, the native /api/answer JSON endpoint, or an agent incoming webhook (async, with /api/task_status polling).
context
Package context describes the user's environment to the agent, as a <context> block put before the first message of a conversation (the server ignores system messages unless the agent allows prompt overrides).
Package context describes the user's environment to the agent, as a <context> block put before the first message of a conversation (the server ignores system messages unless the agent allows prompt overrides).
earlytheme
Package earlytheme fixes lipgloss's background before bubbletea's init asks the terminal for it (an OSC 11 query that stalls every start for 5s in a terminal that never answers).
Package earlytheme fixes lipgloss's background before bubbletea's init asks the terminal for it (an OSC 11 query that stalls every start for 5s in a terminal that never answers).
host
Package host implements the docsgpt-cli host daemon and pairing flow.
Package host implements the docsgpt-cli host daemon and pairing flow.
install
Package install places the running binary on the user's PATH, for `docsgpt-cli install` (which the install.sh / install.ps1 scripts call).
Package install places the running binary on the user's PATH, for `docsgpt-cli install` (which the install.sh / install.ps1 scripts call).
manage
Package manage is a small client for the DocsGPT account-level ("management") API: identity, agents (list/export/plan/apply/delete), sources (list/upload/task status/delete), prompts and tools.
Package manage is a small client for the DocsGPT account-level ("management") API: identity, agents (list/export/plan/apply/delete), sources (list/upload/task status/delete), prompts and tools.
session
Package session saves chats, so they can be resumed: one JSONL file per chat under ~/.docsgpt/sessions/<cwd slug>-<cwd hash>/, a header line and then the messages as they complete (pi's format, without its tree: a fork is a new file starting with a copy of the messages it keeps).
Package session saves chats, so they can be resumed: one JSONL file per chat under ~/.docsgpt/sessions/<cwd slug>-<cwd hash>/, a header line and then the messages as they complete (pi's format, without its tree: a fork is a new file starting with a copy of the messages it keeps).
ui
Package ui holds the interactive components: the small inline prompts (select lists, confirmations, text inputs, a spinner) used wherever the CLI asks the user something, which render inline and collapse to a one-line summary once answered, and the chat's full-screen Screen, which shows the same prompts in a panel.
Package ui holds the interactive components: the small inline prompts (select lists, confirmations, text inputs, a spinner) used wherever the CLI asks the user something, which render inline and collapse to a one-line summary once answered, and the chat's full-screen Screen, which shows the same prompts in a panel.
sdk module

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL