CLI: Command-Line Interface
LazyAPI's subcommands run headless, for scripting, CI/CD and AI agents.
bash
lazyapi <command> [arguments...] [flags]Flags may appear before or after positional arguments.
Commands
| Command | Description |
|---|---|
run | Run operations with status, contract and script checks; outputs pretty, JSON, JUnit or TAP |
send request | Send one operation (<path> <method> or --op <operationId>) |
smoke tests | Alias of run |
list ops | List operations |
describe | Parameters, bodies, responses and schemas of one operation |
validate spec | Validate a spec and its test scripts |
types | Print the test script API (Test Scripts) |
mcp | Serve these tools to AI agents over MCP |
mock | Fake API from the spec's examples, with request validation |
fake | List the {{$dynamic}} variables (faker), or generate one |
login / logout | Log in to an OAuth2 / OpenID Connect scheme (browser or device code); sessions are refreshed automatically |
import | Add operations from curl, Postman collections or HAR captures |
create file | Create a new OpenAPI spec template |
add request / add server | Add an operation or server |
remove request | Remove an operation |
Exit status
The same codes apply to every command:
| Code | Meaning |
|---|---|
| 0 | Everything passed |
| 1 | A check failed: invalid request, undeclared status, contract violation, test failure, script error, or an invalid spec (validate) |
| 2 | Usage error (unknown flag, missing argument) |
| 3 | Something could not run: spec unreadable, network error, missing server, invalid env file |
When a run has both failures and errors, the code is 3.