10 AutoGPT Command Line Arguments (Continuous Mode, Speak)
Complete reference for AutoGPT's 10 most powerful CLI arguments. Master continuous mode, headless operation, and CI/CD integration for automated agent workflows.
Get more content like this on Telegram!
Daily AI tips, notes & resources — free
AutoGPT's real power isn't the web UI — it's the command line. Once you're past initial setup, CLI arguments let you automate agent runs, integrate AutoGPT into CI/CD pipelines, run agents headlessly on servers, and fine-tune behavior without touching config files.
This guide covers the 10 most important AutoGPT CLI arguments with practical examples, automation scripts, and CI/CD integration patterns. The focus is headless operation — running AutoGPT in automated environments without user interaction.
For context on what AutoGPT is and how it compares to alternatives, see AutoGPT vs BabyAGI and the AutoGPT vs SuperAGI vs OpenAGI comparison.
The Core CLI Reference
Before diving into each argument, here's the full reference table:
| Argument | Short Flag | Default | Purpose |
|---|---|---|---|
--continuous | -C | false | Skip user confirmation between steps |
--max-iterations | -l | unlimited | Cap the number of agent iterations |
--ai-name | none | AutoGPT | Set agent name programmatically |
--ai-role | none | none | Define agent role via CLI |
--ai-goal | -g | none | Set agent goals (repeatable) |
--speak | none | false | Enable text-to-speech output |
--debug | none | false | Verbose debug logging |
--log-level | none | INFO | Set log verbosity |
--workspace-directory | -w | auto_gpt_workspace | Set working directory |
--skip-reprompt | -y | false | Skip the initial goal confirmation |
Argument 1: --continuous (Headless Operation)
Continuous mode is the single most important argument for automation. By default, AutoGPT pauses after every step and waits for user confirmation ("Press Enter to continue"). In automated environments, this pause breaks everything.
# Without --continuous: pauses at every step
python -m autogpt
# With --continuous: runs without interruption
python -m autogpt --continuous
# Recommended: always pair with --max-iterations in production
python -m autogpt --continuous --max-iterations 20
Warning: Continuous mode without --max-iterations can run indefinitely. A poorly specified goal combined with continuous mode has caused developers to burn through $50-200 in API costs before the agent terminates. Always set a limit.
Argument 2: --max-iterations (-l)
Sets a hard cap on how many reasoning/action cycles the agent can execute. One iteration = one "think, plan, act" cycle.
# Run up to 15 iterations then stop
python -m autogpt --continuous -l 15
# Short research task — 5 iterations usually sufficient
python -m autogpt --continuous -l 5 \
--ai-goal "Find the current price of Bitcoin and save it to btc_price.txt"
# Complex multi-step task — allow more iterations
python -m autogpt --continuous -l 50 \
--ai-goal "Research the top 10 AI tools released in Q1 2026 and create a comparison report"
Iteration budgeting by task type:
| Task Type | Recommended --max-iterations |
|---|---|
| Simple data lookup | 3-5 |
| Web research + summary | 8-12 |
| Code generation + testing | 10-20 |
| Multi-step research report | 25-50 |
| Complex project with subtasks | 50-100 |
Argument 3: --ai-name and --ai-role
These arguments let you define the agent's identity programmatically — useful when running different agent configurations from the same automation script.
# Research agent
python -m autogpt --continuous -l 20 \
--ai-name "ResearchBot" \
--ai-role "AI research assistant specialized in summarizing technical papers"
# Content agent
python -m autogpt --continuous -l 15 \
--ai-name "ContentWriter" \
--ai-role "Technical content writer for an AI developer blog"
# Data processing agent
python -m autogpt --continuous -l 30 \
--ai-name "DataProcessor" \
--ai-role "Data analysis specialist who processes CSV files and generates reports"
Argument 4: --ai-goal (-g)
The most critical argument. Goals defined via CLI override any AI settings in config files, making them ideal for scripted automation. The -g flag is repeatable — use it multiple times to define multiple goals.
# Single goal
python -m autogpt --continuous -l 10 \
-g "Summarize the top 5 stories on Hacker News today and save to hn_summary.md"
# Multiple goals
python -m autogpt --continuous -l 25 \
-g "Search for Python 3.13 release notes" \
-g "Extract the 5 most significant changes" \
-g "Write a developer-focused summary in python_3_13.md" \
-g "List any breaking changes that affect Django or FastAPI"
# Goal with constraints (prevents runaway behavior)
python -m autogpt --continuous -l 8 \
-g "Find the current EUR/USD exchange rate from a reliable financial source" \
-g "Save the result as JSON: {rate: float, source: string, timestamp: ISO8601}" \
-g "Stop immediately after saving the file"
The "Stop immediately after saving the file" instruction at the end of a goal list is a practical trick. Without an explicit stop condition, the agent sometimes continues looking for more things to do after completing its primary objective.
Argument 5: --skip-reprompt (-y)
When running AutoGPT non-interactively, the initial goal confirmation prompt breaks automation. --skip-reprompt skips it.
# Without --skip-reprompt: shows goal summary and waits for 'y'
python -m autogpt --continuous -l 10
# With --skip-reprompt: starts immediately
python -m autogpt --continuous -l 10 --skip-reprompt
# Full headless run — all confirmation prompts bypassed
python -m autogpt \
--continuous \
--skip-reprompt \
-l 20 \
--ai-name "AutoBot" \
-g "Complete the task and exit"
Argument 6: --workspace-directory (-w)
Controls where AutoGPT saves files, logs, and intermediate outputs. Critical when running multiple agent instances or when you need outputs in a specific location.
# Default: saves to ./auto_gpt_workspace
python -m autogpt --continuous
# Custom workspace
python -m autogpt --continuous -l 10 \
--workspace-directory /data/agents/research_run_001
# Timestamped workspace for clean per-run outputs
TIMESTAMP=$(date +%Y%m%d_%H%M%S)
python -m autogpt --continuous -l 10 \
--workspace-directory "/outputs/run_${TIMESTAMP}"
Argument 7: --speak
Enables text-to-speech for agent output — useful for demos, accessibility, or monitoring a running agent in the background while doing other work.
# Requires text-to-speech package: pip install gtts
python -m autogpt --speak
Not useful in CI/CD or server environments, but worth knowing for local development.
Argument 8: --debug and --log-level
Debug mode produces extremely verbose output — every API call, every thought, every decision. Useful for diagnosing why an agent is stuck or making poor decisions.
# Full debug output
python -m autogpt --debug
# Set specific log level
python -m autogpt --log-level WARNING # Suppresses INFO and DEBUG messages
python -m autogpt --log-level ERROR # Only errors
# Redirect debug output to a file for later analysis
python -m autogpt --debug 2>&1 | tee debug_log_$(date +%Y%m%d).txt
Automation Scripts
Here's a practical shell script for running AutoGPT in automated environments:
#!/bin/bash
# run_agent.sh — Production-ready AutoGPT automation script
set -euo pipefail # Exit on error, undefined vars, pipe failures
# Configuration
AGENT_NAME="${1:-AutoAgent}"
GOAL="${2:-Research and summarize today's top AI news}"
MAX_ITERATIONS="${3:-20}"
WORKSPACE_BASE="/data/autogpt/runs"
LOG_DIR="/var/log/autogpt"
TIMESTAMP=$(date +%Y%m%d_%H%M%S)
RUN_ID="${AGENT_NAME}_${TIMESTAMP}"
# Setup
mkdir -p "${WORKSPACE_BASE}/${RUN_ID}"
mkdir -p "${LOG_DIR}"
echo "Starting AutoGPT agent: ${AGENT_NAME}"
echo "Goal: ${GOAL}"
echo "Max iterations: ${MAX_ITERATIONS}"
echo "Workspace: ${WORKSPACE_BASE}/${RUN_ID}"
# Run agent
python -m autogpt \
--continuous \
--skip-reprompt \
--max-iterations "${MAX_ITERATIONS}" \
--ai-name "${AGENT_NAME}" \
--workspace-directory "${WORKSPACE_BASE}/${RUN_ID}" \
--log-level INFO \
-g "${GOAL}" \
2>&1 | tee "${LOG_DIR}/${RUN_ID}.log"
EXIT_CODE=$?
if [ $EXIT_CODE -eq 0 ]; then
echo "Agent run completed successfully: ${RUN_ID}"
else
echo "Agent run failed with code ${EXIT_CODE}: ${RUN_ID}" >&2
exit $EXIT_CODE
fi
Usage:
chmod +x run_agent.sh
# Basic usage
./run_agent.sh "ResearchBot" "Summarize the latest news on LLM benchmarks" 15
# With custom iterations
./run_agent.sh "DataBot" "Process all CSV files in /data/input and generate a report" 40
CI/CD Integration
AutoGPT CLI arguments make it straightforward to integrate agent runs into GitHub Actions or other CI/CD pipelines:
# .github/workflows/weekly_research.yml
name: Weekly AI Research Agent
on:
schedule:
- cron: '0 9 * * 1' # Every Monday at 9am UTC
workflow_dispatch: # Allow manual trigger
jobs:
run-research-agent:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install AutoGPT
run: |
pip install autogpt
pip install -r requirements.txt
- name: Run research agent
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: |
python -m autogpt \
--continuous \
--skip-reprompt \
--max-iterations 25 \
--ai-name "WeeklyResearcher" \
--workspace-directory ./research_output \
--log-level INFO \
-g "Find the 5 most significant AI developments from the past week" \
-g "Write a 500-word summary with specific examples and links" \
-g "Save the summary to weekly_report.md in the workspace"
- name: Commit research output
run: |
git config user.name "AutoGPT Research Bot"
git config user.email "bot@aitechworlds.com"
git add research_output/
git diff --staged --quiet || git commit -m "Weekly AI research report $(date +%Y-%m-%d)"
git push
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: research-report-${{ github.run_number }}
path: research_output/
retention-days: 30
Docker-Based Headless Operation
For server deployments, Docker is the cleanest way to run AutoGPT CLI:
# Dockerfile
FROM python:3.11-slim
WORKDIR /app
RUN pip install autogpt
# Default environment
ENV OPENAI_API_KEY=""
ENV WORKSPACE_DIR="/workspace"
ENV MAX_ITERATIONS="20"
VOLUME ["/workspace"]
# Entrypoint script
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
#!/bin/bash
# entrypoint.sh
python -m autogpt \
--continuous \
--skip-reprompt \
--max-iterations "${MAX_ITERATIONS}" \
--ai-name "${AI_NAME:-AutoAgent}" \
--workspace-directory "${WORKSPACE_DIR}" \
-g "${AI_GOAL:-Summarize today's AI news and save to report.md}"
# Run the Docker container
docker run -d \
--name autogpt-research \
-e OPENAI_API_KEY=sk-... \
-e AI_NAME="ResearchBot" \
-e AI_GOAL="Research the latest LangChain updates and summarize in 500 words" \
-e MAX_ITERATIONS=20 \
-v $(pwd)/outputs:/workspace \
autogpt-headless:latest
Putting It All Together
The most production-ready AutoGPT CLI invocation combines multiple arguments:
python -m autogpt \
--continuous \ # No user confirmation
--skip-reprompt \ # Skip goal confirmation
--max-iterations 30 \ # Hard cap on iterations
--ai-name "ProductionAgent" \ # Identifiable agent name
--ai-role "Senior research analyst" \ # Context for the LLM
--workspace-directory /data/run_001 \ # Isolated workspace
--log-level INFO \ # Useful but not overwhelming logs
-g "Primary objective goes here" \ # Main goal
-g "Secondary objective here" \ # Additional goals
-g "Stop and exit when objectives complete" # Explicit termination
For advanced agent architectures that go beyond AutoGPT's built-in capabilities, see Build AI agent with LangChain and AI agent memory and planning. For deploying agent infrastructure, see Deploy AI model to production.
FAQs
Is continuous mode safe to leave running unattended?
Only with strict constraints. Set --max-iterations to cap the run length, use --ai-goal objectives that are clearly completable, and monitor the output logs. Continuous mode with an open-ended goal and no iteration limit has been known to rack up significant API costs before completing — or loop indefinitely.
Can AutoGPT CLI arguments be combined arbitrarily?
Most can be combined freely. The exceptions are --speak (requires text-to-speech packages installed) and --debug (very verbose — don't use in CI logs). The --continuous and --max-iterations combination is the most commonly used pair in production automation.
How do I run multiple AutoGPT instances simultaneously?
Specify a different --workspace-directory for each instance so they don't share state. You'll also want different log files, which you can redirect via shell output redirection. Each instance is fully independent and will use your API key concurrently — watch your rate limits.
Frequently Asked Questions
AiTechWorlds Team
✓ Verified WriterThe AiTechWorlds team is passionate about AI, technology, and education. We create high-quality, research-backed content to help you learn, grow, and succeed in the modern digital world.
Related Articles
10 AutoGPT Configuration Tweaks for Better Performance
10 proven AutoGPT configuration tweaks to improve speed, cut costs, and boost task success. Model selection, temperature, token limits, and workspace settings.
Build a Content Research Agent with AutoGPT (Trends, Outlines)
Build an AutoGPT content research agent that finds trending topics, analyzes SERPs, and generates SEO-ready outlines automatically — full workflow inside.
Build a Data Analysis Agent with AutoGPT (CSV, SQL, Plots)
Build a data analysis agent using AutoGPT that reads CSVs, queries SQL databases, and generates plots automatically. Full code with pandas and matplotlib.
10 AutoGPT Environment Variables You Need to Configure
Master AutoGPT configuration with these 10 essential environment variables. Set API keys, select models, control costs, and tune performance.