Skip to content

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.

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.

Start the mock server for a project.

Terminal window
apidev serve [PROJECT_ID] [OPTIONS]

Options:

OptionDescription
-p, --port <PORT>Port to run server on (default: from project settings)
--host <HOST>Host to bind to (default: 127.0.0.1)

Examples:

Terminal window
apidev serve
apidev serve my-project --port 4000
apidev serve --host 0.0.0.0

Start the MCP server for AI assistant integration.

Terminal window
apidev mcp [OPTIONS]

Options:

OptionDescription
--httpRun in HTTP mode (default: stdio)
-p, --port <PORT>HTTP port (default: 3100)

Examples:

Terminal window
apidev mcp
apidev mcp --http --port 3100

List projects or endpoints.

Terminal window
apidev list [RESOURCE]

Resources:

  • projects (default) - List all projects
  • endpoints [PROJECT_ID] - List endpoints in a project

Examples:

Terminal window
apidev list
apidev list endpoints my-project

Import an OpenAPI specification.

Terminal window
apidev import <FILE> [OPTIONS]

Options:

OptionDescription
-p, --project <ID>Target project ID
--overwriteOverwrite existing endpoints

Examples:

Terminal window
apidev import api-spec.yaml
apidev import api-spec.json --project my-api --overwrite

Export a project as OpenAPI specification.

Terminal window
apidev export <PROJECT_ID> [OPTIONS]

Options:

OptionDescription
-o, --output <FILE>Output file path
-f, --format <FORMAT>Format: json or yaml (default: yaml)

Examples:

Terminal window
apidev export my-project -o api-spec.yaml
apidev export my-project -o api-spec.json --format json

Show whether the mock server is currently running.

Terminal window
apidev status

Stop the running mock server.

Terminal window
apidev stop

View and manage logged HTTP requests.

Terminal window
apidev requests <SUBCOMMAND>
SubcommandDescription
list <PROJECT>List recent requests (-l, --limit, -m, --method, -s, --status, --starred, --json)
show <ID>Show full request details (--json)
delete <ID...>Delete specific requests by ID
clear <PROJECT>Clear all requests for a project (-f, --force)
star <ID>Star a request (--unstar to remove star)

Examples:

Terminal window
apidev requests list my-project --limit 20
apidev requests list my-project --method POST --status 5xx
apidev requests show abc123
apidev requests star abc123

Show version information.

Terminal window
apidev version

Initialize a new project in a directory.

Terminal window
apidev init [PATH] [OPTIONS]

Options:

OptionDescription
-n, --name <NAME>Project name
-p, --port <PORT>Port number (default: 3001, range: 1024-65535)
--with-examplesAdd example endpoints (GET /api/users, GET /api/users/:id, POST /api/users, GET /health)
--forceOverwrite existing files

Examples:

Terminal window
apidev init
apidev init ./my-api --name "My API" --port 4000 --with-examples

Creates project.json and endpoints.json in the target directory.

Import an endpoint from a cURL command.

Terminal window
apidev curl <CURL_STRING> [OPTIONS]

Options:

OptionDescription
-p, --project <PROJECT>Target project (required)
-n, --name <NAME>Endpoint name (default: auto-generated)
--previewPreview only, don’t import

Examples:

Terminal window
apidev curl "curl -X POST https://api.example.com/users -H 'Content-Type: application/json' -d '{\"name\":\"test\"}'" -p my-project
apidev curl "curl https://api.example.com/health" -p my-project --preview

Manage projects.

Terminal window
apidev project <SUBCOMMAND>
SubcommandDescription
listList all projects (--json for JSON output)
create <NAME>Create a project (-p, --port, -d, --description)
show <NAME>Show project details (--json)
update <NAME>Update settings (--new-name, -p, --port, -d, --description)
delete <NAME>Delete a project (-f, --force to skip confirmation)

Manage endpoints within a project.

Terminal window
apidev endpoint <SUBCOMMAND>
SubcommandDescription
list <PROJECT>List endpoints (--json, --enabled-only)
add <PROJECT>Add endpoint (-n, --name, -p, --path, -m, --method, -s, --status, -b, --body, --delay, --content-type)
show <PROJECT> <ENDPOINT>Show details (--json)
remove <PROJECT> <ENDPOINT>Remove endpoint (-f, --force)
enable <PROJECT> <ENDPOINT>Enable an endpoint
disable <PROJECT> <ENDPOINT>Disable an endpoint

Example:

Terminal window
apidev endpoint add my-project -n "Get Users" -p /api/users -m GET -s 200 -b '{"users":[]}'

Manage environments and variables. Requires Pro license.

Terminal window
apidev environment <SUBCOMMAND>
SubcommandDescription
list <PROJECT>List environments (--json)
createCreate environment (-n, --name, -p, --project optional for global, --var KEY=VALUE,..., --secret KEY,...)
show <ID>Show details (--json, --reveal to unmask secrets)
update <ID>Update (-n, --name, --var, --secret)
delete <ID>Delete (-f, --force)
activate <PROJECT> [ENV]Set active environment (omit ENV to deactivate)
duplicate <ID>Clone environment (-n, --name)

See Environments for details.

Manage proxy recordings.

Terminal window
apidev recording <SUBCOMMAND>
SubcommandDescription
list <ENDPOINT>List recordings for an endpoint (--json)
delete <ID>Delete a specific recording
clear <ENDPOINT>Clear all recordings (-f, --force)
count <PROJECT>Show recording count for a project

Manage your license.

Terminal window
apidev license <SUBCOMMAND>
SubcommandDescription
statusShow current license status
activate <KEY>Activate with a license key
activate-email <EMAIL>Request email-based activation
check <EMAIL>Check activation status after email activation

View and update application settings.

Terminal window
apidev settings <SUBCOMMAND>
SubcommandDescription
showShow current settings (--json)
updateUpdate a setting (--theme, --default-port, --mcp-port, --mcp-auto-start, --mcp-logging-mode, --confirm-before-delete, --developer-mode, --error-reporting)

Manage public URL tunnels. Requires Pro license.

Terminal window
apidev tunnel <SUBCOMMAND>
SubcommandDescription
start <PROJECT>Start a tunnel (-p, --provider cloudflared|ngrok, -P, --port)
stop <PROJECT>Stop a running tunnel
status <PROJECT>Show tunnel status
installCheck if tunnel binaries are installed

Manage HTTPS/TLS certificates.

Terminal window
apidev tls <SUBCOMMAND>
SubcommandDescription
statusShow certificate status
generateGenerate a self-signed certificate (Pro)
trustShow OS-specific trust instructions

Contract testing against OpenAPI specs. Requires Pro license.

Terminal window
apidev contract <SUBCOMMAND>
SubcommandDescription
validate <PROJECT>Validate logged requests against a spec (-s, --spec <FILE>, -l, --limit, --json)
status <PROJECT>Show validation status (-s, --spec <FILE>)
import <PROJECT> <URL>Fetch an OpenAPI spec from a URL (-o, --output <FILE>)
VariableDescription
APIDEV_DATA_DIROverride default data directory
APIDEV_LOG_LEVELLog level: error, warn, info, debug, trace
CodeDescription
0Success
1General error
2Invalid arguments
3Project not found
4Port already in use
Terminal window
apidev serve my-api --port 3001
curl http://localhost:3001/api/users
Terminal window
apidev import ./openapi.yaml --project test-api --overwrite
apidev serve test-api --port 3001 &
npm test

Add to your Claude Desktop config (claude_desktop_config.json):

{
"mcpServers": {
"apidevstudio": {
"command": "apidev",
"args": ["mcp"]
}
}
}