DocStar CLI

DocStar CLI turns the API endpoints in a published DocStar docs site into commands you can run in your terminal. It can also serve those endpoints as MCP tools, so AI assistants like Claude can call your API.

#

Install

You need Node.js 18 or later.

npm install -g docstar-cli

Check it worked:

docstar-cli --version
#

How commands are organised

Every API command has three levels:

docstar-cli <collection> <module> <endpoint> [--parameters]
Level What it is Example
Collection A DocStar docs site, named by its collection slug msg91
Module A top-level section of that docs site slack
Endpoint One published API in that module send-message-1

The collection slug is chosen when the collection is created in DocStar and never changes. Because the collection is always part of the command, two docs sites can both have a slack module without clashing.

#

1. Install a docs site

docstar-cli init docs.msg91.com

The CLI lists the site's published modules. Press space to select modules (or pick Select all modules at the bottom), then enter. Each endpoint in the selected modules becomes a command.

If the docs site isn't on a custom domain, add the collection ID:

docstar-cli init <docs-domain> --collectionId <collectionId>

Run init again with another domain to add more docs sites. Existing ones are kept.

#

2. See what's installed

docstar-cli list                 # all installed collections
docstar-cli list msg91           # modules in "msg91"
docstar-cli list msg91 slack     # endpoints in the "slack" module

Each endpoint shows its name, description, HTTP method and required parameters:

send-message-1
  send message
  POST
  required: message
#

3. Call an endpoint

Pass parameters as flags:

docstar-cli msg91 slack send-message-1 --message "hello from the CLI"

Leave out a required parameter and the CLI asks for it:

docstar-cli msg91 slack send-message-1
? Enter value for message

The CLI prints the response status and body.

#

Save credentials

Save an API key once so it's sent with every request to that collection:

docstar-cli config set msg91 authkey YOUR_AUTH_KEY
docstar-cli config get msg91            # show saved credentials

The key name must match the header or parameter name in the docs. A flag on a command, such as --authkey, overrides the saved value.

#

Use with AI assistants (MCP)

docstar-cli mcp starts an MCP server that exposes every installed endpoint as a tool. Add it to your AI client's MCP config, for example .mcp.json for Claude Code or claude_desktop_config.json for Claude Desktop:

{
  "mcpServers": {
    "docstar": {
      "command": "docstar-cli",
      "args": ["mcp"]
    }
  }
}

Each tool is named <collection>__<module>__<endpoint>, for example msg91__slack__send-message-1. Now you can ask "Send a Slack message saying hi using MSG91" and the assistant calls the right tool, asking you for any value it needs. Install at least one module with init first.

To connect an AI assistant to DocStar itself, or to a collection's hosted MCP server without installing anything, see MCP.

#

Tab completion

For bash, or zsh with bashcompinit:

echo 'eval "$(docstar-cli completion-script)"' >> ~/.bashrc   # or ~/.zshrc

After you type a collection, Tab completes module and endpoint names.

#

Remove modules

docstar-cli clean msg91                # choose modules to remove
docstar-cli clean msg91 --all          # remove the whole collection
#

Tips

  • Installed modules are saved in ~/.docstar/. Commands run without contacting the docs site.
  • When the API docs change, run init again to pick up new or changed endpoints.
  • After updating or reinstalling the CLI, run init again for each docs site to restore its commands.
  • Run docstar-cli help or docstar-cli <command> --help for details on any command.