Skip to content

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 ​

CommandDescription
runRun operations with status, contract and script checks; outputs pretty, JSON, JUnit or TAP
send requestSend one operation (<path> <method> or --op <operationId>)
smoke testsAlias of run
list opsList operations
describeParameters, bodies, responses and schemas of one operation
validate specValidate a spec and its test scripts
typesPrint the test script API (Test Scripts)
mcpServe these tools to AI agents over MCP
mockFake API from the spec's examples, with request validation
fakeList the {{$dynamic}} variables (faker), or generate one
login / logoutLog in to an OAuth2 / OpenID Connect scheme (browser or device code); sessions are refreshed automatically
importAdd operations from curl, Postman collections or HAR captures
create fileCreate a new OpenAPI spec template
add request / add serverAdd an operation or server
remove requestRemove an operation

Exit status ​

The same codes apply to every command:

CodeMeaning
0Everything passed
1A check failed: invalid request, undeclared status, contract violation, test failure, script error, or an invalid spec (validate)
2Usage error (unknown flag, missing argument)
3Something could not run: spec unreadable, network error, missing server, invalid env file

When a run has both failures and errors, the code is 3.

Released under the GPLv3 License.

/ search•[ ] prev/next•j/k scroll•h home•t theme•cli/