Skip to content

Add isAgent flag #172

@pi0

Description

@pi0

Describe the feature

(from discussion with @danielroe)

We can export a flag to indicate if CLI is running within an AI agent for increasing verbosity or span more info.

We might also have something like agentProvider additionally.

Some references for env detection (chatgpt assisted might need double check)

  • Generic: AI_AGENT (*)
  • Cursor: CURSOR_AGENT / CURSOR_TRACE_ID (*) (cli)
  • Gemeni: GEMINI_CLI (*)
  • Codex: CODEX_SANDBOX (*)
  • ClaudeCode: CLAUDECODE / CLAUDE_CODE (*)
  • Replit: REPL_ID (*)
  • Mastra CLI: MASTRA_TELEMETRY_DISABLED
  • Open Code: OPENCODE_CONFIG_DIR / OPENCODE_DISABLE_LSP_DOWNLOAD /...
  • Goose CLI: GOOSE_PROVIDER/GOOSE_MODEL/...
  • Offline‑AI CLI: AI_NPM_LOG_LEVEL/AI_NPM_REGISTRY
  • Devin: /opt/.devin file (*)

Copilot agent in VSCode seems needing parent crawling: (vscode-copilot-terminal-detection)

* : learned from @vercel/detect-agent ❤️

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions