Skip to content

Headless Mode

The octrafic test subcommand runs tests non-interactively - no TUI, no prompts. Designed for CI/CD pipelines and scripting.

Usage

Run a test file

bash
octrafic test --url https://api.example.com --path tests.json

Supported file formats:

  • Postman Collection (.json)
  • Shell script with curl commands (.sh)
  • pytest file (.py)

Run from a prompt

bash
octrafic test \
  --url https://api.example.com \
  --spec openapi.json \
  --prompt "test all user endpoints"

The AI generates a test plan from the spec and executes it automatically.

Flags

FlagShortDescription
--url-uAPI base URL (required)
--spec-sPath to API spec file
--path-pPath to test file (Postman, shell, pytest)
--promptNatural language test instruction
--authAuth type: bearer, apikey, basic
--tokenBearer token
--keyAPI key header name
--valueAPI key value
--userBasic auth username
--passBasic auth password

Exit codes

CodeMeaning
0All tests passed
1One or more tests failed or an error occurred

GitHub Actions example

yaml
- name: Run API tests
  run: |
    octrafic test \
      --url ${{ secrets.API_URL }} \
      --path tests/api-tests.json \
      --auth bearer \
      --token ${{ secrets.API_TOKEN }}

Auto mode in interactive sessions

In the interactive TUI, use /auto to toggle automatic test execution - tests run without manual confirmation. The status bar shows an Auto indicator when active.