APIGIT CLI

Your API checks,
in the terminal and in CI.

apigit lints and scores OpenAPI files, stops breaking changes in a pull request, and publishes API documents and mock servers. One npm package, for people, pipelines and coding agents.

Install
npm install -g @apigit/cli
  • Free to use
  • No account needed to lint
  • No telemetry
  • Node.js 20 or later
apigit lint openapi.yaml
openapi.yaml
  2:6   warn  info-contact           Info object must have "contact" object.
  9:9   warn  operation-description  Operation "description" must be present.
  9:9   warn  operation-tags         Operation must have non-empty "tags" array.
  22:9  warn  operation-operationId  Operation must have "operationId".

7 problems (0 errors, 7 warnings, 0 info, 0 hints)
apigit breaking main HEAD openapi.yaml
2 change(s), 2 breaking.

Breaking
  GET /pets/{petId}: parameter query verbose added (required)
  schema Pet: schema field "name" removed
error: 2 breaking change(s) from main to HEAD
NO ACCOUNT, NO NETWORK

Six Commands That Work Offline

Point them at any OpenAPI file, in any repository. Nothing leaves your machine.

Lint

The same rule sets as the APIGit editor: OpenAPI best practice, OWASP API Security Top 10, URL style, documentation quality, or your own Spectral file.

$ apigit lint openapi.yaml

Score

How ready the API description is for AI agents, from 0 to 100, with a line for every rule it was measured by.

$ apigit score openapi.yaml

Breaking changes

Only the changes that can break a client, between two commits, branches, tags or files. Exits 1 when there is one.

$ apigit breaking main HEAD openapi.yaml

Diff

Everything that changed in the API, read as operations, parameters and schemas rather than as lines of YAML.

$ apigit diff main HEAD openapi.yaml

Bundle

One file with every external $ref resolved, ready to hand to a tool that wants a single document.

$ apigit bundle openapi.yaml -o dist/openapi.yaml

Preview

A local page of the file on your machine, re-read on every reload while you edit.

$ apigit preview openapi.yaml
IN CI

Stop a Breaking Change Before It Merges

Run the same checks on every pull request. A failed check is an exit code your pipeline already understands, and on APIGit it can be a status a branch protection rule requires.

  • breaking fails the job when a change can break a client
  • lint --org adds your organization's governance rule sets and can post the commit status
  • Reports as GitHub Actions annotations, JUnit, SARIF or JSON
  • GitHub Actions can sign in with its own identity token: no stored secret
  • Any other CI system: npx @apigit/cli with the same arguments
CI setup in the reference
.github/workflows/api.yml
steps:
  - uses: actions/checkout@v4
    with:
      fetch-depth: 0
  - uses: actions/setup-node@v4
    with:
      node-version: 22

  - run: npx @apigit/cli@0.1.1 lint openapi.yaml --format github-actions
  - run: npx @apigit/cli@0.1.1 breaking origin/main HEAD openapi.yaml
Publish from a pushed commit
apigit auth login

apigit doc publish --version 1.2.0 --access public
apigit doc list

apigit mock publish --name petstore --type spec --mount openapi.yaml
apigit mock call petstore /pets
apigit mock logs petstore
PUBLISH

Documents and Mock Servers, From a Commit

Push with git, then publish that commit as an API document, a mock server, or both. In a release job, the tag becomes the version.

  • Pin a version to a commit, or follow a branch on plans that include it
  • --dry-run prints what would be sent and sends nothing
  • Call a mock and read its request log without leaving the terminal
  • Sign in from the browser, or with a token in CI
FOR CODING AGENTS

Built for the Agent in Your Editor Too

A coding agent can use the CLI the way you do, or connect to APIGit through MCP. Either way it works with your sign-in, and no token is written to a file.

  • An Agent Skill that teaches coding agents the commands
  • --json on every command, and apigit context lists every command and option as JSON
  • apigit agent setup connects Claude Code, Cursor or VS Code through MCP, read-only unless you add --write
  • With write tools, agents work on a branch and open a pull request; people merge
APIGit for AI agents
Teach and connect your agent
apigit skills install      # an Agent Skill in .agents/skills/

apigit agent setup         # Claude Code
apigit agent setup --client cursor
apigit agent setup --client vscode
apigit score openapi.yaml
openapi.yaml  53 / 100
  1 of 2  Operations have an operationId
  2 of 2  Operations have a summary
  0 of 2  Operations have a description
  0 of 2  Operations document an error response
  2 of 2  Success responses have a schema

Questions About the CLI

Is the APIGit CLI free?+

Yes. The CLI is free to use and sends no telemetry. Checking files needs no account; publishing uses your APIGit account and its plan.

Do I need an APIGit account to lint a file?+

No. lint, score, bundle, diff, breaking and preview run on your machine and work offline. You sign in only to publish documents and mock servers or to use your organization's rule sets.

Which rules does lint use?+

The rule sets of the APIGit editor are built in. A .spectral.yaml in the working directory or a file given with --ruleset replaces them, and --org adds the governance rule sets of your APIGit organization.

Which CI systems does it work with?+

Any system that can run Node.js 20 or later: run npx @apigit/cli with the same arguments. lint writes GitHub Actions annotations, JUnit, SARIF and JSON. On GitHub Actions a job can also sign in with the identity token GitHub issues, so no secret is stored.

How is the CLI different from the MCP server?+

The CLI is for a terminal, a script or a CI job. The MCP server gives an AI agent the same work as tools. apigit agent setup connects a coding agent to both, and apigit skills install adds an Agent Skill that teaches agents the commands.

Check your first file in a minute

Install the CLI and lint an OpenAPI file now. Create a free APIGit workspace when you want to publish it.