CLI Reference (Detailed)

Detailed command reference for the Khaos CLI. This section provides in-depth coverage of command groups that have their own subcommands and workflows.

Main CLI reference
For a complete overview of all commands with usage examples, see the CLI Reference page.

Command Groups

  • Cloud Commands — authentication, credential management, and cloud sync operations
  • Scenario Commands — scenario listing, validation, and direct execution

Quick Reference

All available CLI commands at a glance:

CommandDescriptionDetails
khaos discoverRegister @khaosagent handlersCLI Reference
khaos runRun agent with full evaluationCLI Reference
khaos testRun @khaostest agent testsCLI Reference
khaos ciCI/CD pipeline mode with thresholdsCLI Reference
khaos compareCompare two runs for regressionsCLI Reference
khaos gateCheck if run meets quality thresholdsCLI Reference
khaos syncSync results to cloud dashboardCloud Commands
khaos loginAuthenticate with Khaos CloudCloud Commands
khaos logoutClear stored credentialsCloud Commands
khaos tokensManage API tokensCloud Commands
khaos exportExport run artifacts as JSON bundleCLI Reference
khaos attacksInspect attack categories and detailsCLI Reference
khaos evals listList available evaluationsCLI Reference
khaos playgroundInteractive agent testing environmentCLI Reference
khaos doctorDiagnose installation and configurationCLI Reference

Global Flags

These flags are available on all commands:

FlagDescription
--helpShow help for any command
--versionPrint the Khaos CLI version
--install-completionInstall shell completion for the current shell
--show-completionPrint completion script for manual setup

See Also