Docs Command¶
The docs command launches an interactive terminal-based documentation browser.
Usage¶
Description¶
Launches a TUI for browsing embedded project documentation. It features a split-pane layout, asynchronous background search, and an AI-powered Q&A assistant.
Flags¶
| Flag | Description | Default |
|---|---|---|
--provider |
AI provider to use (openai, claude, gemini) |
Auto-detected |
TUI Keybindings¶
| Key | Action |
|---|---|
q |
Quit the browser |
Tab |
Toggle sidebar visibility |
s |
Open search input |
? |
Open AI Q&A input |
Esc |
Focus sidebar / Close search |
Enter |
Select item / Focus content |
Docs Serve Subcommand¶
The docs serve subcommand starts a local HTTP server to preview the documentation as a static site.
Usage:
Description: Start a local HTTP server and serve the documentation as a Material-styled static site. By default, it automatically opens the local URL in your default browser.
Flags:
| Name | Description | Default |
| :--- | :--- | :--- |
| -p, --port | Port to listen on (0 for random) | 8080 |
| --open | Automatically open the browser | true |
[!NOTE] The
servecommand is only available if the static site assets have been pre-built and embedded into the binary.
Docs Ask Subcommand¶
The docs ask subcommand allows you to query the documentation directly from the command line without launching the TUI.
Usage:
Aliases: ?
Description: Ask a question about the documentation and receive an AI-generated answer rendered in the terminal. This is useful for quick lookups or when running in non-interactive environments.
Flags:
| Flag | Description | Default |
|---|---|---|
-n, --no-style |
Disable markdown styling in the output | false |
--provider |
AI provider to use (openai, claude, gemini) |
Inherited from parent |
Examples:
# Ask a question with styled output
mytool docs ask "What is the Props container?"
# Ask without markdown formatting (useful for piping)
mytool docs ask --no-style "List all available commands" | grep init
# Use a specific AI provider
mytool docs ask --provider claude "Explain the configuration system"
Implementation¶
The docs command is implemented in cmd/docs/docs.go and utilizes the pkg/docs library for TUI rendering and search.