Apidog Docs
🇺🇸 English
  • 🇺🇸 English
  • 🇯🇵 日本語
  • 🇪🇸 Español
  • 🇰🇷 한국인
  • 🇨🇳 简体中文
  • 🇵🇹 Português (Portugal)
  • 🇮🇩 Bahasa Indonesia
  • 🇧🇷 Português (Brasil)
  • 🇻🇳 Tiếng Việt
  • 🇨🇳 繁體中文
🇺🇸 English
  • 🇺🇸 English
  • 🇯🇵 日本語
  • 🇪🇸 Español
  • 🇰🇷 한국인
  • 🇨🇳 简体中文
  • 🇵🇹 Português (Portugal)
  • 🇮🇩 Bahasa Indonesia
  • 🇧🇷 Português (Brasil)
  • 🇻🇳 Tiếng Việt
  • 🇨🇳 繁體中文
🇺🇸 English
  • 🇺🇸 English
  • 🇯🇵 日本語
  • 🇪🇸 Español
  • 🇰🇷 한국인
  • 🇨🇳 简体中文
  • 🇵🇹 Português (Portugal)
  • 🇮🇩 Bahasa Indonesia
  • 🇧🇷 Português (Brasil)
  • 🇻🇳 Tiếng Việt
  • 🇨🇳 繁體中文
HomeLearning Center
Support CenterAPI ReferencesDownloadChangelog
HomeLearning Center
Support CenterAPI ReferencesDownloadChangelog
  1. Apidog CLI
  • Apidog Learning Center
  • Getting Started
    • Introduction to Apidog
    • Basic Concepts in Apidog
    • Navigating Apidog
    • Quick Start
      • Overview
      • Creating an Endpoint
      • Making a Request
      • Adding an Assertion
      • Creating Test Scenarios
      • Sharing API Documentation
      • Explore More
    • Migration to Apidog
      • Overview
      • Manual Import
      • Scheduled Import (Bind Data Sources)
      • Import Options
      • Export Data
      • Import From
        • Import from Postman
        • Import from Stoplight
        • Import OpenAPI Spec
        • Import cURL
        • Import Markdowns
        • Import from Insomnia
        • Import from apiDoc
        • Import .har File
        • Import WSDL
  • Design APIs
    • Overview
    • Create a New API Project
    • Endpoint Basics
    • APl Design Guidelines
    • Module
    • Configure Multiple Request Body Examples
    • Components
    • Common Fields
    • Global Parameters
    • Endpoint Change History
    • Comments
    • Batch Endpoint Management
    • Custom Protocol API
    • Spec-first Mode (Beta)
    • Schemas
      • Overview
      • Create a New Schema
      • Build a Schema
      • Generate Schemas from JSON Etc
      • oneOf, allOf, anyOf
      • Using Discriminator
    • Security Schemes
      • Overview
      • Create a Security Scheme
      • Use the Security Scheme
      • Security Scheme in Online Documentation
    • Advanced Features
      • Custom Endpoint Fields
      • Associated Test Scenarios
      • Endpoint Status
      • Appearance of Parameter Lists
      • Endpoint Unique Identification
  • Develop and Debug APIs
    • Overview
    • Generating Requests
    • Sending Requests
    • Debugging Cases
    • Test Cases
    • Dynamic Values
    • Validating Responses
    • Design-First vs Request-First
    • Generating Code
    • AI Debugging
      • AI Agent Debugger
      • A2A Debugger
    • Environments & Variables
      • Overview
      • Using Variables
      • Environment Management
    • Vault Secrets
      • Overview
      • HashiCorp Vault
      • Azure Key Vault
      • AWS Secrets Manager
    • Pre and Post Processors
      • Overview
      • Assertion
      • Extract Variable
      • Wait
      • Security
      • Database Operations
        • Overview
        • MySQL
        • MongoDB
        • Redis
        • Oracle Client
      • Using Scripts
        • Overview
        • Pre Processor Scripts
        • Post Processor Scripts
        • Public Scripts
        • Postman Scripts Reference
        • Calling Other Programming Languages
        • Using JS Libraries
        • Visualizing Responses
        • Script Examples
          • Assertion Scripts
          • Using Variables
          • Modifying Requests
          • Other Examples
    • Dynamic Values Modules
  • Mock API Data
    • Overview
    • Smart Mock
    • Custom Mock
    • Mock Priority Sequence
    • Mock Scripts
    • Cloud Mock
    • Self-Hosted Runner Mock
    • Mock Language (Locales)
  • API Testing
    • Overview
    • Test Reports
      • Test Reports
    • Test Scenarios
      • Create a Test Scenario
      • Pass Data Between Requests
      • Flow Control Conditions
      • Sync Data from Endpoints and Endpoint Cases
      • Import Endpoints and Endpoint Cases from Other Projects
      • Export Test Scenarios
    • Run Test Scenarios
      • Run a Test Scenario
      • Run Test Scenarios in Batch
      • Data-Driven Testing
      • Shared Test Data
      • Scheduled Tasks
      • Manage Runtime Environment of APIs from Other Projects
    • Test APIs
      • Integration Testing
      • Performance Testing
      • End-to-End Testing
      • Regression Testing
      • Contract Testing
    • Test Suite
      • Overview
      • Create A Test Suite
      • Orchestrate Test Suite
      • Run Test Suites Locally
      • Scheduled Tasks
  • Apidog CLI
    • Overview
    • Installing and Running Apidog CLI
    • Run Test Suites Via CLI
    • Apidog CLI Commands & Options
    • Use Apidog CLI with an AI Agent
    • CI CD
      • Overview
      • Trigger Test by Git Commit
      • Integrate with Github Actions
      • Integrate with Gitlab
      • Integrate with Jenkins
  • Publish API Docs
    • Overview
    • API Technologies Supported
    • Quick Share
    • Viewing API Documentation
    • Markdown Documentation
    • Publishing Documentation Sites
    • Custom Login Page
    • Custom Layouts
    • Custom CSS, JavaScript, HTML
    • Custom Domain
    • AI Features
    • SEO Settings
    • Advanced Settings
      • Documentation Search
      • CORS Proxy
      • Integrating Google Analytics
      • Folder Tree Settings
      • Visibility Settings
      • Embedding Values in Document URLs
    • API Versions
      • Overview
      • Creating API Versions
      • Publishing API Versions
      • Sharing Endpoints with API Versions
  • Send Requests
    • Overview
    • SSE Debugging
    • MCP Client
    • Socket.IO
    • WebSocket
    • Webhook
    • SOAP or WebService
    • GraphQL
    • gRPC
    • Use Request Proxy Agents for Debugging
    • Create Requests
      • Request History
      • Request Basics
      • Parameters and Body
      • Request Headers
      • Request Settings
      • Debug Requests
      • Saving Requests as Endpoints
      • HTTP/2
    • Response and Cookies
      • Viewing API Responses
      • Managing Cookies
      • Overview
    • Authentication and Authorization
      • Overview
      • CA and Client Certificates
      • Authorization Types
      • Digest Auth
      • OAuth 1.0
      • OAuth 2.0
      • Hawk Authentication
      • Kerberos
      • NTLM
      • Akamai EdgeGrid
  • Branches
    • Overview
    • Creating a Sprint Branch
    • Testing APIs in a Branch
    • Designing APIs in a Branch
    • Merging Sprint Branches
    • Managing Sprint Branches
    • AI Branch (Beta)
  • AI Features
    • Overview
    • Enabling AI Features
    • Generating Test Cases
    • Modifying Schemas with AI
    • Endpoint Compliance Check
    • API Documentation Completeness Check
    • AI-Powered Field Naming
    • FAQs
  • Apidog MCP Server
    • Overview
    • Connect Apidog Project to AI
    • Connect Published Documentation to AI
    • Connect OpenAPI Files to AI
  • Best Practices
    • Handling API Signatures
    • Accessing OAuth 2.0 Protected APIs
    • Collaboration Workflow
    • Managing Authentication State
  • Offline Space
    • Overview
  • Administration
    • Onboarding Checklist
      • Basic Concepts
      • Onboarding Guide
    • Managing Projects
      • Managing Projects
      • Notification Settings
      • Managing Project Members
      • Project Resources
        • Database Connection
        • Git Connection
    • Managing Teams
      • Managing Teams
      • Managing Team Members
      • Team Activities
      • Team Roles & Permissions
      • Team Resources
        • General Runner
        • Team Variables
        • Request Proxy Agent
      • Real-time Collaborations
        • Team Collaboration
    • Managing Organization
      • Managing Organization
      • Organization Role & Permissions
      • Audit Logs
      • Single Sign-On (SSO)
        • SSO Overview
        • Configuring Microsoft Entra ID
        • Configuring Okta
        • Configuring SSO for an Organization
        • Managing User Accounts
        • Mapping Groups to Teams
      • SCIM Provisioning
        • Introduction to SCIM Provisioning
        • Microsoft Entra ID
        • Okta
      • Plans Management
        • Billing Managers in Organizations
      • Organization Resources
        • Self-Hosted Runner
  • Billing
    • Overview
    • Credits
    • Upgrading Your Plan
    • Alternative Payment Methods
    • Managing Subscriptions
    • Moving Paid Teams to Organizations
  • Data & Security
    • Data Storage and Security
    • User Data Privacy and Security
    • Request Routing and Data Security
  • Add-ons
    • API Hub
    • Apidog Intellij IDEA Plugin
    • Browser Extension
      • Chrome
      • Microsoft Edge
    • Request Proxy
      • Request Proxy in Web
      • Request Proxy in Shared Docs
      • Request Proxy in Client
  • Account & Preferences
    • Account Settings
    • Generating OpenAPI Access Token
    • Notification
    • Language Settings
    • Hot Keys
    • Network Proxy Configuration
    • Backing Up Data
    • Updating Apidog
    • Deleting Account
    • Experimental Features
  • References
    • API Design-First Approach
    • Apidog OpenAPI Specificaiton Extensions
    • JSONPath
    • XPath
    • Regular Expressions
    • JSON Schema
    • CSV File Format
    • Installing Java Environment
    • Runner Deployment Environment
    • Apidog Markdown Syntax
    • Apidog Swagger Extensions
      • Overview
      • x-apidog-folder
      • x-apidog-status
      • x-apidog-name
      • x-apidog-maintainer
    • Apidog JSON Schema Extensions
      • Overview
      • x-apidog-mock
      • x-apidog-orders
      • x-apidog-enum
  • Apidog Europe
    • Apidog Europe
  • Support Center
  1. Apidog CLI

Use Apidog CLI with an AI Agent

Apidog CLI is designed to bring Apidog's API lifecycle capabilities into AI Agent workflows. With Apidog CLI and Apidog AI Agent Skills, an AI Agent can use command-line workflows to query project resources, run automated API tests, validate data before writing, and manage API or testing assets.
Apidog CLI is suitable for AI Agents because it provides stable, verifiable engineering actions instead of requiring the Agent to call many small tools one by one.

What an AI Agent can do with Apidog CLI#

After Apidog CLI is installed and authenticated, an AI Agent can use it to help with tasks such as:
View and manage API resources, including endpoints, schemas, folders, parameters, and response definitions.
Create and update API test cases based on API definitions.
Manage automated test scenarios and test suites.
Run automated test scenarios and test suites from the command line.
Generate test reports in formats such as CLI, HTML, and JSON.
Manage environments, variables, and runtime settings.
Import and export API data in formats such as OpenAPI, Postman, HAR, JMeter, WSDL, Markdown, and Apidog native format.
Manage API documentation sites and shared docs.
Work with branches, including AI branches for safer Agent-generated changes.
📌
Why use Apidog CLI instead of only MCP tools?
MCP tools expose many atomic API operations. Apidog CLI provides higher-level commands that align with common development workflows.
Compared with MCP-only approaches, Apidog CLI helps AI Agents by providing:
Higher-granularity actions, such as read → validate → write → verify.
Runtime schema validation with cli-schema validate.
Structured command output with agentHints to guide next steps.
Pre-write validation to catch errors before creating or updating resources.
Fewer repeated tool calls and lower token consumption.

Prerequisites#

Before using Apidog CLI with an AI Agent, make sure:
Node.js and npm/npx are installed.
You have an Apidog account.
The account has access to the Apidog project you want the Agent to operate on.
Apidog CLI is installed.
The CLI is authenticated with an Apidog API access token.
Apidog AI Agent Skills are installed for your Agent.
For installation details, see Installing and Running Apidog CLI.

Install Apidog CLI#

Install or upgrade Apidog CLI:
Verify the installation:
You can also ask your AI Agent to follow the installation guide:
Read https://apidog.com/apidog-cli-installation-guide.md and follow instructions.

Get an API access token#

Get an access token from the Apidog app or web console:
1.
Click the user avatar.
2.
Open Account Settings.
3.
Go to API Access Token.
4.
Create and copy a token.
Do not print the token in logs, chat messages, or repository files.

Log in to Apidog CLI#

Use the token to log in:
Check the current login identity:
List accessible projects:
If you already know the project ID, verify access with a resource query command:

Record a long-term working project#

For Agent workflows, it is recommended to save the commonly used project ID in .apidog/settings.json.
Get the project ID from:
Project → Project Settings → Basic Settings → Project ID
Then create .apidog/settings.json:
{
  "projectId": 123456
}
When the user request does not explicitly specify a project, the AI Agent can use the projectId saved in this file.
Also make sure .apidog/.gitignore contains:
*.private.*

Install Apidog AI Agent Skills#

Install Apidog AI Agent Skills so the Agent knows how to use Apidog CLI correctly:
This command starts an interactive flow where you can choose the Skills, target AI Agent, and installation scope.
You can also install from the GitHub repository:
If the current environment cannot access the official installation source, manually install Apidog AI Agent Skills according to your AI Agent's rules. Use WebFetch to fetch:
https://apidog.com/.well-known/agent-skills/index.json
Then download and install the required SKILL.md files from the url fields.
Installing all 8 skills is recommended. At minimum, install apidog-cli.

How Apidog AI Agent Skills help#

Apidog CLI + SKILL.md is designed for AI Agent integration. The Skills system helps Agents use the CLI correctly by providing:
Task-aware invocation: Agents can match Skills to relevant tasks without repeatedly specifying CLI usage.
Judgment rules: Guidance on when to validate, when to read back, and when not to guess IDs.
Workflow guidance: Recommended next steps through agentHints in command output.
AI Branch safety: Changes can be made in isolated AI branches to avoid directly contaminating the main branch.

Use AI branches for safer Agent-generated changes#

When an AI Agent needs to modify API or testing assets, use an AI branch when possible.
An AI branch helps keep Agent-generated changes isolated by:
Keeping Agent modifications separate from the main branch.
Reminding users that changes have not yet been merged.
Requiring user confirmation before merge.
By default, project write permissions may be restricted for safety. To edit the main branch directly, enable external AI edit permissions in project AI Feature Settings.

Validate data before writing#

When an Agent creates or updates structured resources, use cli-schema validate before writing.
For example:
This validation helps catch issues such as:
Missing required fields.
Type mismatches.
Structural errors.
Invalid enum values.
Invalid field names.
For more command details, see Apidog CLI Commands & Options.

Example Agent workflow#

A typical AI Agent workflow with Apidog CLI looks like this:
1.
The user asks the Agent to inspect, test, or update an Apidog project.
2.
The Agent checks .apidog/settings.json or asks for the target project ID.
3.
The Agent verifies CLI login status with apidog whoami.
4.
The Agent reads project resources with CLI commands.
5.
If writing data, the Agent prepares local JSON files.
6.
The Agent validates the files with cli-schema validate.
7.
The Agent applies changes through Apidog CLI.
8.
The Agent reads back the updated resource or test result to verify the change.
9.
If changes are made in an AI branch, the user reviews and confirms before merge.

Run tests through an AI Agent#

An Agent can use Apidog CLI to run automated API tests.
Run a test scenario:
Run a test suite:
For detailed test-suite instructions, see Run Test Suites Via CLI.

Best practices#

When using Apidog CLI with AI Agents:
Store access tokens securely. Do not place tokens in prompts, logs, repository files, or screenshots.
Save the common project ID in .apidog/settings.json when the Agent frequently works with one project.
Use apidog whoami to verify the current login identity.
Use apidog <command> --help when command parameters are unclear.
Use cli-schema validate before creating or updating structured resources.
Prefer AI branches for Agent-generated changes.
Read back resources or test results after changes to verify the outcome.
Use CI/CD commands for repeatable automated testing workflows.

Troubleshooting#

IssueSolution
apidog: command not foundReinstall Apidog CLI globally and make sure the npm global bin directory is in PATH.
Not logged inRun apidog login --with-token <TOKEN> again.
Project not found or permission deniedCheck the project ID and make sure the token account has access to the project.
Unsure command parametersRun apidog <command> --help for the latest usage.
Invalid characters in header contentCheck environment variable initial values, authorization header values, and hidden characters such as line breaks or extra spaces.
Modified at 2026-07-21 04:41:33
Previous
Apidog CLI Commands & Options
Next
Overview
Built with