CLI Reference
API Dev Studio includes a command-line interface (apidev) for managing mock servers, running the MCP server, and performing common tasks without the GUI.
Installation
Section titled “Installation”The CLI is included with API Dev Studio. After installation, add it to your PATH:
Windows:
%LOCALAPPDATA%\api-dev-studio\macOS:
/Applications/API Dev Studio.app/Contents/MacOS/Linux:
/usr/local/bin/Or download the standalone CLI from the releases page.
Commands
Section titled “Commands”apidev serve
Section titled “apidev serve”Start the mock server for a project.
apidev serve [PROJECT_ID] [OPTIONS]Options:
| Option | Description |
|---|---|
-p, --port <PORT> | Port to run server on (default: from project settings) |
--host <HOST> | Host to bind to (default: 127.0.0.1) |
Examples:
apidev serve
apidev serve my-project --port 4000
apidev serve --host 0.0.0.0apidev mcp
Section titled “apidev mcp”Start the MCP server for AI assistant integration.
apidev mcp [OPTIONS]Options:
| Option | Description |
|---|---|
--http | Run in HTTP mode (default: stdio) |
-p, --port <PORT> | HTTP port (default: 3100) |
Examples:
apidev mcp
apidev mcp --http --port 3100apidev list
Section titled “apidev list”List projects or endpoints.
apidev list [RESOURCE]Resources:
projects(default) - List all projectsendpoints [PROJECT_ID]- List endpoints in a project
Examples:
apidev list
apidev list endpoints my-projectapidev import
Section titled “apidev import”Import an OpenAPI specification.
apidev import <FILE> [OPTIONS]Options:
| Option | Description |
|---|---|
-p, --project <ID> | Target project ID |
--overwrite | Overwrite existing endpoints |
Examples:
apidev import api-spec.yaml
apidev import api-spec.json --project my-api --overwriteapidev export
Section titled “apidev export”Export a project as OpenAPI specification.
apidev export <PROJECT_ID> [OPTIONS]Options:
| Option | Description |
|---|---|
-o, --output <FILE> | Output file path |
-f, --format <FORMAT> | Format: json or yaml (default: yaml) |
Examples:
apidev export my-project -o api-spec.yaml
apidev export my-project -o api-spec.json --format jsonapidev version
Section titled “apidev version”Show version information.
apidev versionEnvironment Variables
Section titled “Environment Variables”| Variable | Description |
|---|---|
APIDEV_DATA_DIR | Override default data directory |
APIDEV_LOG_LEVEL | Log level: error, warn, info, debug, trace |
Exit Codes
Section titled “Exit Codes”| Code | Description |
|---|---|
| 0 | Success |
| 1 | General error |
| 2 | Invalid arguments |
| 3 | Project not found |
| 4 | Port already in use |
Examples
Section titled “Examples”Start Development Server
Section titled “Start Development Server”apidev serve my-api --port 3001
curl http://localhost:3001/api/usersCI/CD Integration
Section titled “CI/CD Integration”apidev import ./openapi.yaml --project test-api --overwriteapidev serve test-api --port 3001 &npm testClaude Desktop Integration
Section titled “Claude Desktop Integration”Add to your Claude Desktop config (claude_desktop_config.json):
{ "mcpServers": { "apidevstudio": { "command": "apidev", "args": ["mcp"] } }}