New to FORGE? Start a free 30-day trial

Workflow Commands

Updated on Oct 5, 2026

Workflow commands use an AI coding agent to do software delivery tasks, such as drafting issues, writing code, and reviewing pull requests. This page explains how they run, the options they share, and the context they need. For every option of every command, see the Command Reference.

Prerequisites

  • A configured AI coding agent: claude_code, github_copilot, or opencode. Check it with frg status.
  • For most targets, a job context such as an Issue ID. See Context requirements.

How workflow commands work

Each workflow operation is defined in TOML: the built-in command definitions, plus any customizations in .forge/config/commands.toml. When you run a command such as frg issue draft --edit, Forge:

  1. Resolves the target (issue) and operation (draft) in the command registry.
  2. Checks the required context, such as FORGE_ISSUE_ID.
  3. Validates the required input files for the operation.
  4. Composes the prompt from the operation's role prompt, its task prompt (or the modifier's task override, such as issue_draft_edit), project context, any context files, and your modifier instructions.
  5. Runs the agent and writes a trace to the job's traces/ directory.
  6. Checks the expected outputs, then prints a summary and next-step hints.

To see the composed prompt without running the agent, add --print-prompt.

For what Forge displays during steps 3 to 6, see Progress Tracking.

Commands

TargetPurposeOperations
issueWork item planning and managementdraft, publish, review, plan, triage, split, ask
backlogStrategic planning and backlog managementcreate, review, rank, ask
codeCode and build operationscreate, review, refactor, document, build, test, ask
prPull request operationsdraft, publish, review, merge, ask
docsProject documentation and guidescreate, build, ask
ticketCustomer support ticket investigation and responsetriage, respond, ask, correlate
secSecurity scanning and vulnerability remediationaudit, patch, ask
askContext-free Q&A about the codebase(none)
runExecute arbitrary tasks in the codebase(none)

To run the same operations across several repositories, use frg app <target> <operation>. See App commands.

Shared options

All workflow operations accept these options:

OptionDescription
-a, --agent <NAME>AI coding agent for this run: claude_code, github_copilot, or opencode
-r, --role <ROLE>Override the default AI role: product_manager, software_engineer, software_architect, technical_writer, security_analyst, sre. Can't be used with --custom-agent.
--custom-agent <NAME>Custom agent configuration within your AI coding agent, for example python-expert. Can't be used with --role.
-m, --model <MODEL>Override the model configured in agents.toml. Run frg status to see available models.
-c, --context-file <FILE>Include a file path as context. Repeatable. Relative and absolute paths are supported.
--context-dir <DIR>Include a directory as a context source. Repeatable. Max 100 files per directory and 1 MB per file; binary files and hidden directories are skipped.
--clearClear the existing agent session and start fresh
--retry [<INSTRUCTIONS>]Continue the previous session with a prompt to complete missing outputs
--auto-retryRetry once automatically if output validation fails
--print-promptDisplay the compiled prompt without executing the agent
--bypass-safety-checksBypass prompt injection safety validation. Use only for input you've verified.
-q, --quietSuppress all output except errors

Command-specific options

OptionAvailable on
--edit [<INSTRUCTIONS>]issue draft, issue review, issue plan, backlog create, backlog review, backlog rank, code review, code document, pr draft, pr review, docs create, ticket triage, ticket respond, sec patch
--liteissue draft, issue review, issue plan, code review, pr draft, pr review
--lite-edit [<INSTRUCTIONS>]issue draft, issue review, issue plan, code review, pr draft, pr review
--fix [<INSTRUCTIONS>]code create, code refactor, pr merge
--auto-fix <LEVEL>code review. Levels: issues, critical, major, minor, suggestions, all
--devdocs build: focus on developer/API audience
--tailask, run: follow agent execution output in real time
--task-file <FILE>run: read task instructions from a file

frg ask takes an optional [QUESTION] argument, and frg run takes an optional [TASK] argument.

For modifier behavior, see Modifiers and Lite Mode Commands.

Examples

bash
# Select the AI coding agent
frg issue draft --agent github_copilot

# Override the AI role
frg code review -r software_engineer

# Include several context files
frg code create -c docs/design.md -c docs/api.md

# Include a directory as context
frg issue plan --context-dir docs/patterns

# Combine options
frg issue plan -a claude_code -r software_architect -c docs/requirements.md

# Ask or run without issue context
frg ask "How does the authentication system work?"
frg run --task-file improvements.md

Context requirements

Most targets act on a specific work item. Set the context with an environment variable or with frg config:

TargetRequired contextSet with
issue, code, docsIssue IDexport FORGE_ISSUE_ID=<number> or frg config set-issue <number>
prIssue ID; PR ID for operations on an existing pull requestexport FORGE_PR_ID=<number> or frg config set-pr <number>
ticketTicket IDexport FORGE_TICKET_ID=<id> or frg config set-ticket <id>
backlogNone
secIssue IDexport FORGE_ISSUE_ID=<number> or frg config set-issue <number>
ask, runNone

To see the current context and where it comes from, run frg config show-context.

frg ask stores question.md and answer.md in .forge/work/job_<id>/ask/ when an Issue ID is set, in .forge/work/ticket_<id>/ask/ when a Ticket ID is set, and in .forge/work/ask/ otherwise. frg run always uses .forge/work/run/.

Modifiers

Modifiers change how an operation runs without changing what it does. For example, --edit switches frg issue draft to the issue_draft_edit task prompt and adds your instructions. You can use only one modifier per run. For details, see Modifiers.

App commands

frg app <target> <operation> runs an operation across the repositories in application.toml:

  • Direct execution (most operations): One agent run with application context. These accept the shared options above. --lite isn't supported.
  • Workflow execution (app issue plan, app code create, app pr draft, app pr publish, app pr review, app pr merge): Runs a workflow in each child repository. These accept --start-from, --bypass-approvals, --dry-run, and, where listed, --edit, --lite-edit, or --fix, but not --clear.

See App Command Validation and Multi-Repository Application Commands.

Troubleshooting

error: unrecognized subcommand 'issues'

Cause: The target or operation name is misspelled. Forge shows a tip: with the closest match.

Solution:

  1. Use the singular target name, for example frg issue draft, not frg issues draft.
  2. List the targets with frg --help, and the operations for a target with frg issue --help.

Issue ID required for 'issue' operations

Cause: The command needs a job context that isn't set. The same message appears for code, docs, and pr, and Ticket ID required for 'ticket' operations for ticket.

Solution:

  1. Set the context:
bash
export FORGE_ISSUE_ID=123
# or
frg config set-issue 123
  1. Run the command again.

Verify: frg config show-context shows the Issue ID.

Workflow commands are blocked after a configuration change

Cause: The repository has a configuration lockfile, .forge/.config_lock, and a configuration file changed after locking.

Solution:

  1. Validate your configuration:
bash
frg config validate
  1. Fix any reported errors.
  2. Relock the configuration:
bash
frg config lock

The agent finishes but some outputs are missing

Cause: AI agents are non-deterministic and don't always create every expected file.

Solution:

  1. Run the same command with --retry to continue the session and ask for the missing files.
  2. For unattended runs, add --auto-retry.

See Progress Tracking and Common Issues.

See Also