Amplifier Command Reference¶
Launch Microsoft Amplifier with the amplihack bundle for enhanced AI-assisted development.
Synopsis¶
Pass Amplifier CLI arguments after --. Amplifier's documented
non-interactive prompt shape is run [PROMPT]:
Description¶
The amplihack amplifier command launches Microsoft Amplifier with the
amplihack bundle automatically loaded. Amplifier is a multi-model AI development
assistant that supports Claude, GPT-4, and other models through a unified
interface.
Contents¶
- Prerequisites
- Options
- Prompt delivery
- Usage examples
- Bundle discovery
- Installation behavior
- Environment variables
- Exit codes
- Troubleshooting
- Comparison with other commands
- Related documentation
Key features:
- Automatically discovers and loads the amplihack bundle
- Auto-installs Amplifier via
uvif not present - Passes Amplifier provider, model, session, and output options through after
-- - Session resume capability
- Integration with amplihack's auto mode
Prerequisites¶
| Requirement | Details |
|---|---|
| uv | Required for auto-installation. Install from docs.astral.sh/uv |
| Amplifier | Auto-installed on first run via uv tool install |
| API Keys | Configure for your chosen provider (Anthropic, OpenAI, Azure) |
Options¶
amplihack wrapper options¶
| Option | Description |
|---|---|
--no-reflection |
Disable post-session reflection analysis. |
--subprocess-safe |
Skip shared launcher staging and environment updates for subprocess delegates. |
--docker |
Run through the amplihack Docker launcher. |
--append TEXT |
Append instructions to a running auto-mode session and exit. |
--auto |
Run in autonomous agentic mode with iterative loop execution. |
--max-turns N |
Maximum auto-mode turns. Default: 10. |
--ui |
Enable interactive UI mode for auto mode. |
Amplifier passthrough options¶
Use -- before Amplifier arguments so they are passed to the amplifier
binary unchanged.
Common Amplifier run options:
| Option | Description |
|---|---|
--provider PROVIDER |
LLM provider to use. |
--model MODEL |
Model to use. |
--mode chat\|single |
Execution mode. |
--resume SESSION_ID |
Resume a specific session with a new prompt. |
--output-format text\|json\|json-trace |
Response output format. |
--max-tokens N |
Maximum output tokens. |
Prompt delivery¶
Amplifier task prompts are delivered through the positional PROMPT argument
on amplifier run, which is the stable upstream contract:
amplihack does not use shell interpolation for Amplifier prompts. Prompt text
is passed as a std::process::Command argument, so apostrophes, quotes,
semicolons, dollar signs, and newlines are not interpreted by a shell.
Amplifier does not currently have a documented task-prompt file or stdin
contract. Every prompt is therefore delivered by file reference: the prompt is
written to a 0600 temporary file, and PROMPT is a short fixed sentence naming
that file. This keeps the prompt out of /proc/<pid>/cmdline and within
Linux's 131,072-byte limit on a single argument. See
Agent Prompt Channels Reference.
| Delivery mode | Amplifier support | Behavior |
|---|---|---|
argv |
Reported only | amplihack doctor lists it as a capability. It is never used to deliver a prompt. |
file-reference |
Supported | Used automatically for every prompt. PROMPT reads Read and follow the complete instructions in the file <path>. Its contents are the task prompt. The file is deleted when Amplifier exits. |
tempfile |
Unsupported | Explicit requests fail before spawning amplifier. No prompt tempfile is created. |
stdin |
Unsupported | Explicit requests fail before spawning amplifier. No prompt bytes are written to stdin. |
Prompt delivery configuration¶
AMPLIHACK_PROMPT_DELIVERY controls the requested delivery mode for migrated
subprocess launch paths. For Amplifier, the capability policy is intentionally
narrow:
| Setting | Amplifier result |
|---|---|
unset, empty, or auto |
File reference. |
argv or any other value |
Treated as auto, with a warning naming the value. File reference. |
tempfile |
Fail before launching Amplifier. |
stdin |
Fail before launching Amplifier. |
Examples:
# Default: the prompt goes to a 0600 file; PROMPT is the pointer sentence.
amplihack amplifier -- run "Summarize this repository"
# Invalid for Amplifier: fails before spawning the child process.
AMPLIHACK_PROMPT_DELIVERY=tempfile \
amplihack amplifier -- run "Summarize this repository"
AMPLIHACK_PROMPT_DELIVERY is a request, not a capability override:
This command fails before launching Amplifier. The same hard rejection applies
to AMPLIHACK_PROMPT_DELIVERY=stdin. File reference is not a substitute for a
prompt-file contract; tempfile and stdin stay unsupported until upstream
documents a stable run prompt-file or stdin task-prompt contract.
Use amplihack doctor to inspect the capability report.
The Amplifier launch path must build the upstream command as
amplifier run [OPTIONS] [PROMPT]. It must not add a synthetic --prompt flag
unless upstream Amplifier documents that flag as a stable task-prompt contract.
Usage Examples¶
Interactive Session¶
Start an interactive Amplifier session with the amplihack bundle:
Output:
Non-Interactive with Prompt¶
Execute a single task:
The prompt remains a single argv value even when it contains shell metacharacters after parent-shell expansion:
Single Response Mode¶
Get a single response without tool use:
Model Selection¶
Use a specific model:
# Use GPT-4o
amplihack amplifier -- run --provider openai --model gpt-4o "Summarize this repository"
# Use Claude Sonnet
amplihack amplifier -- run --provider anthropic --model claude-sonnet-4-20250514 "Summarize this repository"
Resume a Session¶
Continue a previous session:
Auto Mode¶
Run autonomously with a task:
amplihack amplifier --auto "Implement user authentication with JWT tokens"
# With extended turns for complex tasks
amplihack amplifier --auto --max-turns 25 "Refactor the entire API layer"
Long Prompts¶
Amplifier has no supported long-form file or stdin task-prompt channel, so each auto-mode turn prompt, at any size, is delivered by file reference.
To start auto mode from a long prompt without placing it in amplihack's own
argv, use --prompt-file, which goes before any -- and requires --auto:
Do not use "$(cat docs/feature-request.md)" for long prompts. That form
expands in the parent shell and places the whole prompt in one argument of
amplihack itself, which fails with Argument list too long above 128 KiB.
For Amplifier, AMPLIHACK_PROMPT_DELIVERY=tempfile and
AMPLIHACK_PROMPT_DELIVERY=stdin fail before launch.
See Large Payload Delivery Reference for the file-reference template and lifetime rules.
Bundle Discovery¶
The command automatically finds the amplihack bundle using this search order:
- Current directory:
./amplifier-bundle/bundle.md - Package location: Searches up to 5 parent directories from the installed package
If no bundle is found, Amplifier runs without it and displays a warning:
Warning: amplihack bundle not found. Running Amplifier without bundle.
Expected location: ./amplifier-bundle/bundle.md
Installation Behavior¶
On first run, if Amplifier is not installed:
Installing Amplifier from git+https://github.com/microsoft/amplifier...
This will install Amplifier as a uv tool.
Continue? [y/N] y
✓ Amplifier CLI installed
Non-interactive mode (CI/scripts): Installation proceeds automatically without prompting.
Environment Variables¶
| Variable | Description |
|---|---|
AMPLIHACK_PROMPT_DELIVERY |
Requested prompt delivery mode: auto, tempfile, or stdin; other values are treated as auto. Amplifier uses a file reference; explicit tempfile and stdin requests fail before launch. |
AMPLIHACK_DEBUG |
Set to true for debug output. Do not rely on debug output for prompt privacy. |
ANTHROPIC_API_KEY |
API key for Anthropic models. |
OPENAI_API_KEY |
API key for OpenAI models. |
AZURE_OPENAI_* |
Azure OpenAI configuration. |
Exit Codes¶
| Code | Meaning |
|---|---|
0 |
Success |
1 |
Error (installation failed, command not found, unsupported prompt delivery request, etc.) |
Troubleshooting¶
Amplifier not found after installation¶
Problem: Installation succeeds but amplifier command not found.
Solution: Ensure ~/.local/bin (or uv's tool bin directory) is in your PATH:
Bundle not found¶
Problem: Warning about missing bundle appears.
Solution:
- Run from the amplihack repository root
- Or ensure
amplifier-bundle/bundle.mdexists in your project
uv not found¶
Problem: Error message about missing uv.
Solution: Install uv:
# macOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
# Windows
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
API key errors¶
Problem: Authentication errors when running.
Solution: Set the appropriate API key for your provider:
# For Anthropic (Claude models)
export ANTHROPIC_API_KEY="your-key"
# For OpenAI (GPT models)
export OPENAI_API_KEY="your-key"
Requested tempfile or stdin delivery fails¶
Problem: AMPLIHACK_PROMPT_DELIVERY=tempfile or
AMPLIHACK_PROMPT_DELIVERY=stdin fails before Amplifier starts.
Solution: This is expected. Amplifier documents positional prompt delivery
with amplifier run [PROMPT] and does not document a prompt-file or stdin
task-prompt contract. Leave the variable unset or set it to auto for Amplifier, or run
doctor to inspect the capability policy:
Use a different agent binary with a verified long-form prompt contract if the prompt must stay out of child argv.
Comparison with Other Commands¶
| Command | Use Case |
|---|---|
amplihack amplifier |
Multi-model support, Amplifier features |
amplihack claude |
Claude Code with amplihack hooks and power steering |
amplihack copilot |
GitHub Copilot CLI integration |
amplihack codex |
OpenAI Codex CLI integration |
Choose amplifier when you need:
- Multi-model flexibility (switch between Claude, GPT-4, etc.)
- Amplifier-specific features
- The amplihack bundle context without full Claude Code hooks
Related Documentation¶
- Command Selection Guide - Choose the right command
- amplihack-rs Parity Reference - Prompt delivery capability matrix, configuration, doctor diagnostics, and Rust API
- Auto Mode Guide - Autonomous execution details
- Launcher Model Configuration - Model selection for Claude launcher