Skip to main content

Headless mode

Overview

Headless mode runs Faheem Code without the interactive terminal UI, making it ideal for:

  • CI/CD pipelines
  • Automated scripting
  • Integration with other tools
  • Batch processing
faheemcode --headless -t "Your task here"

Requirements

  • Must specify a task with --task or --file

Basic usage

# Run a task in headless mode
faheemcode --headless -t "Write a Python script that prints hello world"

# Load task from a file
faheemcode --headless -f task.txt

JSON output mode

The --json flag enables structured JSONL (JSON Lines) output, streaming events as they occur:

faheemcode --headless --json -t "Create a simple Flask app"

Each line is a JSON object representing an agent event:

{"type": "action", "action": "write", "path": "app.py", ...}
{"type": "observation", "content": "File created successfully", ...}
{"type": "action", "action": "run", "command": "python app.py", ...}

Use cases for JSON output

  • CI/CD pipelines: Parse events to determine success/failure
  • Automated processing: Feed output to other tools
  • Logging: Capture structured logs for analysis
  • Integration: Connect Faheem Code with other systems

Example: capture output to file

faheemcode --headless --json -t "Add unit tests" > output.jsonl

See also