CLI commands
DocStar CLI — Available Commands
Overview
DocStar CLI allows users to interact with APIs documented and published through DocStar. The CLI can discover API modules from a DocStar documentation collection, install them locally, execute API endpoints as commands, and expose those APIs through MCP.
1. Initialize a Documentation Collection
Basic
docstar-cli init <docs-domain>
Discovers the published modules from a DocStar documentation site and installs them locally.
With a Collection ID
docstar-cli init <domain> --collectionId <id>
Use this when the collection needs to be explicitly identified.
Example
docstar-cli init docs.msg91.com
2. List Installed Collections
docstar-cli list
Displays the DocStar collections currently installed on the system.
3. List Modules
docstar-cli list <cli-name>
Lists the modules available inside an installed collection.
Example
docstar-cli list msg91
4. List Endpoints in a Module
docstar-cli list <cli-name> <module>
Lists the available API endpoints/commands inside a specific module.
Example
docstar-cli list msg91 slack
This can show commands such as:
send-message-1
5. Execute an API Endpoint
The general command format is:
docstar-cli <cli-name> <module> <endpoint>
Example
docstar-cli msg91 slack send-message-1 --message "hello from the CLI"
The CLI translates the command into the API request defined by the endpoint’s DocStar configuration.
The endpoint definition can contain information such as:
HTTP method
API URL
Base URL
Headers
Request body
Required parameters
Optional parameters
6. Interactive Parameters
An endpoint can also be executed without providing all parameters directly:
docstar-cli msg91 slack send-message-1
The CLI can interactively ask the user for the required parameters.
This makes API usage possible without manually constructing HTTP requests.
7. Start the MCP Server
docstar-cli mcp
Starts the DocStar CLI as an MCP server.
Installed API endpoints can then be exposed as MCP tools for AI clients.
For example, an endpoint such as:
msg91
└── slack
└── send-message-1
can be exposed as an MCP tool similar to:
msg91__slack__send-message-1
An AI agent can then call the API through the MCP tool instead of manually constructing an HTTP request.
Command Structure
The CLI has two types of commands.
Built-in Commands
These are implemented directly by the CLI:
init
list
mcp
Dynamically Generated API Commands
These come from the API documentation published through DocStar:
<collection>
└── <module>
└── <endpoint>
For example:
docstar-cli msg91 slack send-message-1
Here:
Part | Meaning |
|---|---|
| DocStar collection / CLI name |
| API module |
| API endpoint |
| Endpoint parameter |
Typical Workflow
A user would typically follow this flow:
1. Initialize a DocStar collection
↓
2. CLI discovers published API modules
↓
3. Modules/endpoints are installed locally
↓
4. User lists available APIs
↓
5. User executes an API endpoint
↓
6. CLI builds and sends the API request
Example:
docstar-cli init docs.msg91.com
docstar-cli list msg91
docstar-cli list msg91 slack
docstar-cli msg91 slack send-message-1 --message "Hello"
For AI/agent usage:
docstar-cli mcp
This exposes the installed API capabilities through MCP.
Key Design Idea
The CLI does not need to hardcode every customer’s API.
Instead:
DocStar API Documentation
↓
Published API specification
↓
docstar-cli init
↓
Local API definitions
↓
Generated CLI commands
Therefore, if another company publishes its API through DocStar, the same CLI can potentially generate commands for that company’s APIs without creating a separate CLI implementation.