Docstar CLI

#

docstar-cli — Usage Guide

docstar-cli calls published DocStar API endpoints directly from your terminal, or exposes them as MCP tools for AI clients (Claude Desktop, Claude Code, etc.). Point it at a DocStar docs site, pick which modules you want (e.g. “Slack”), and it turns each published endpoint into a real command you can run.

You can install from multiple docs sites/collections at once — each is kept separate under its own CLI name.

#

Install

npm install
npm run build
npm link

npm link puts docstar-cli on your PATH. Alternatively, run it without linking via node ./bin/run.js <command> from the repo root.

#

How it’s organized

Everything you install is grouped under three levels:

docstar-cli <cli-name> <module> <command>
  • cli-name — identifies the docs site/collection you installed from (e.g. msg91). Set under the collection’s Domain settings in the docs editor; auto-generated from the collection name if not set.

  • module — a group of endpoints (e.g. slack).

  • command — a single endpoint (e.g. send-message-1).

Installed data lives under ~/.docstar/:

  • ~/.docstar/config.json — installed collections/modules, grouped by collection.

  • ~/.docstar/modules/<cli-name>/<module>.json — each module’s full endpoint contract.

#

Available commands

#

docstar-cli init <domain>

Discover published modules for a DocStar docs site, pick which ones to install, and register their CLI commands.

Args

  • domain (required) — DocStar docs domain, e.g. docs.msg91.com or localhost:3000.

Flags

  • --collectionId <id> — Collection id. Required when the domain is not a custom domain (e.g. localhost).

Examples

docstar-cli init docs.msg91.com
docstar-cli init localhost:3000 --collectionId paM4R4A26Hvb

This fetches the published modules for the collection, shows an interactive checklist (all modules pre-checked — press space to toggle, enter to confirm), and for each selected module:

  • saves its full endpoint contract to ~/.docstar/modules/<cli-name>/<module>.json

  • registers a real CLI command for every endpoint: docstar-cli <cli-name> <module> <command>

Running init again against a different domain/collection adds it alongside any others already installed — nothing gets overwritten.

#

docstar-cli list [collection] [module]

List installed collections, the modules within one, or every endpoint of one module.

Args (both optional)

  • collection — CLI name to show installed modules for, e.g. msg91.

  • module — module to show all installed endpoints for, e.g. slack.

Flags

  • --all — list every installed collection (default behavior when no arguments are given).

Examples

docstar-cli list                    # every installed collection
docstar-cli list --all              # same as above
docstar-cli list msg91              # modules installed for the "msg91" collection
docstar-cli list msg91 slack        # Slack's installed endpoints in "msg91"

Sample endpoint listing output:

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

docstar-cli <cli-name> <module> <command> [flags]

Calls the actual API endpoint. These commands only exist after you’ve run init and selected the module they belong to — there is no static list; run docstar-cli list to see what’s installed.

Required/optional parameters become flags. Omit a required flag and you’ll be prompted for it interactively.

Examples

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

# Or omit required parameters and answer the prompt instead:
docstar-cli msg91 slack send-message-1
? Enter value for message

The command prints the response status and body from the actual API call.

#

docstar-cli mcp

Starts an MCP (Model Context Protocol) server exposing every installed endpoint, across all installed collections, as a callable tool for AI clients.

  • Each endpoint becomes one tool named <cli-name>__<module>__<command>, e.g. msg91__slack__send-message-1, with required/optional parameters exposed in its schema.

  • Run docstar-cli init <domain> first so there’s at least one installed module for mcp to expose.

  • This command does not exit on its own — it stays running and communicates over stdio for as long as the connecting AI client keeps the connection open.

Example: register with an MCP client (.mcp.json / claude_desktop_config.json)

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

Once registered, a prompt like “call the slack api and send a message saying hi” resolves directly to the matching tool call — the AI client asks you for any required value it can’t infer, just like any other MCP tool.

#

Built-in oclif commands

These come from the CLI framework (@oclif/plugin-help, @oclif/plugin-plugins) rather than DocStar itself:

  • docstar-cli help [command] — show help for the CLI or a specific command.

  • docstar-cli plugins — manage oclif plugins.

  • docstar-cli --version / docstar-cli -v — print the installed version.

#

Typical workflow

# 1. Install modules from a docs site
docstar-cli init docs.msg91.com

# 2. Check what got installed
docstar-cli list
docstar-cli list msg91
docstar-cli list msg91 slack

# 3. Call an endpoint directly
docstar-cli msg91 slack send-message-1 --message "hello from the CLI"

# 4. Or expose everything installed as MCP tools for an AI client
docstar-cli mcp
#

How it works under the hood

  • init talks to GET /p/module.json?collectionId=... (collection name, CLI name, and list of modules) and GET /p/<module>/module.json?collectionId=... (a module’s endpoint contract) on the docs site.

  • Each endpoint’s contract (method, url, base url, headers, body, and CLI parameter names) is saved locally and used to build the real HTTP request when you run its command — no network round-trip to the docs site is needed once a module is installed.

  • Commands are generated as real files on disk under this repo’s dist/commands/<cli-name>/<module>/. Running npm run build wipes dist/, so you’ll need to re-run docstar-cli init for each installed collection afterwards to reinstall your modules.

#

Development

npm run build   # compile TypeScript to dist/
npm run lint    # eslint
npm test        # mocha