CLI Reference
Complete command-line interface documentation for Angreal.
Synopsis
Section titled “Synopsis”angreal [OPTIONS] <SUBCOMMAND>Global Options
Section titled “Global Options”-h, --help- Print help information-v, --verbose- Verbose level (may be used multiple times for more verbosity)-V, --version- Print version information
Verbose Levels
Section titled “Verbose Levels”The verbose flag can be repeated to raise the log level. Each count maps to a specific level (logs are written to stderr):
| Flag | Log level |
|---|---|
| (none) | warn (default) |
-v |
info |
-vv |
debug |
-vvv (or more) |
trace |
angreal -v init template/ # info-level outputangreal -vv init template/ # debug-level outputangreal -vvv init template/ # trace-level output (maximum verbosity)Setting the ANGREAL_DEBUG=true environment variable forces debug-level logging
and takes precedence over the -v flags: when ANGREAL_DEBUG is set, the -v
count is ignored. See the
ANGREAL_DEBUG entry in the
configuration reference.
Core Commands
Section titled “Core Commands”Initialize a new project from an Angreal template.
angreal init <TEMPLATE> [OPTIONS]Arguments:
TEMPLATE- Template source (local path, Git URL, GitHub shorthand, or OCI referenceoci://...)
Options:
-f, --force- Force the rendering of a template, even if paths/files already exist-d, --defaults- Use default values provided in the angreal.toml-i, --in-place- Render the template’s contents into the current directory, stripping the template’s top-level directory--values <FILE>- Provide values to template, bypassing template toml--insecure- Allow pulling anoci://template from a plain-HTTP registry (self-hosted registry without TLS)
Template Sources & Examples:
# Local templateangreal init ./my-template
# Git repositoryangreal init https://github.com/user/template.git
# GitHub catalog templateangreal init template
# With optionsangreal init template/ --force --defaultsangreal init template/ --values values.toml
# Render into the current directory instead of creating a project rootangreal init template/ --in-placeTemplate Resolution:
The template argument is first classified by scheme. A full Git URL (https,
ssh, git, git+ssh) or an existing local directory is used directly and
bypasses the bare-name expansion below:
- Git URL: cloned into the cache directory on first use, or fast-forward pulled there if it already exists.
- Existing local directory: used in place as the template (it must contain
an
angreal.toml).
For a bare name such as python (anything that is not a recognized URL and
is not an existing directory), Angreal resolves it in the following order:
~/.angrealrc/<name>— if this directory exists: when it is a Git checkout (contains.git), fast-forward pull it and use it; otherwise use the plain folder as a local template../<name>— a literal local path. If this directory exists and contains anangreal.toml, use it; if the directory exists without anangreal.toml, fail with an error.~/.angrealrc/angreal/<name>— if this directory exists and is a Git checkout, fast-forward pull it and use it; if it exists but is not a Git checkout, fail with an error.- Otherwise, clone
https://github.com/angreal/<name>.gitinto the cache directory; if that repository does not exist, fail with “template not found”.
Get a structured view of all available commands and tasks in an Angreal project.
angreal tree [OPTIONS]Options:
-l, --long- Include full tool descriptions for AI agent guidance
Examples:
# Short format: commands with arguments and descriptionsangreal tree
# Long format: includes full ToolDescription proseangreal tree --longOutput Formats:
The short format (default) shows commands with their argument signatures and short descriptions:
test: all - Run complete test suite rust [--unit-only] [--integration-only] - Run Rust testsThe long format (--long) adds the full ToolDescription prose for each command, including:
- When to use / when NOT to use guidance
- Example invocations
- Risk level annotations (safe, read_only, destructive)
This enables AI agents to understand available commands and make informed decisions about when and how to use them.
Start a Model Context Protocol (MCP) server that exposes the project’s task tree as system instructions to MCP-aware AI clients. Project-only command (available only inside an Angreal project containing .angreal/).
angreal mcpThe server speaks JSON-RPC 2.0 over stdio, reading requests from standard input and writing responses to standard output. It takes no flags or arguments.
To connect an AI assistant to this server, see the how-to guide Connect an AI Assistant.
Create and manage command aliases for white-labeling Angreal.
angreal alias <SUBCOMMAND>Subcommands:
create <name>- Create a new command aliasremove <name>- Remove an existing aliaslist- List all registered aliases
Examples:
# Create a custom command nameangreal alias create mycompany-tool
# Now you can use 'mycompany-tool' instead of 'angreal'mycompany-tool init template/
# List all aliasesangreal alias list
# Remove an aliasangreal alias remove mycompany-toolcompletion
Section titled “completion”Install and manage shell completion for Angreal.
angreal completion <SUBCOMMAND>Subcommands:
install [shell]- Install shell completion (bash, zsh)uninstall [shell]- Uninstall shell completionstatus- Show completion installation status
Examples:
# Install completion for current shellangreal completion install
# Install for specific shellangreal completion install bash
# Check completion statusangreal completion status
# Uninstall completionangreal completion uninstallPrint help information for Angreal or a specific subcommand.
angreal help [SUBCOMMAND]Examples:
# General helpangreal help
# Help for a specific commandangreal help init
# Alternative syntaxangreal init --helpProject-Specific Commands
Section titled “Project-Specific Commands”When you’re inside an Angreal project (a directory containing .angreal/), the CLI behavior changes significantly.
Task Discovery
Section titled “Task Discovery”Angreal automatically discovers tasks by:
- Looking for
.angreal/directory in current or parent directories - Loading Python files matching the pattern
task_*.py - Registering functions decorated with
@angreal.command - Replacing the default commands with project-specific ones
Command Context Loading
Section titled “Command Context Loading”Angreal’s available commands are determined by the nearest .angreal/ directory found when walking up the directory tree from your current location.
Outside any Angreal project:
angreal --help
# SUBCOMMANDS:# help Print this message or the help of the given subcommand(s)# init Initialize an Angreal template from source.Inside an Angreal project:
cd my-angreal-project/angreal --help
# SUBCOMMANDS:# help Print this message or the help of the given subcommand(s)# build Build the project# test Run tests# deploy Deploy to production## Note: 'init' is no longer available!Running Project Tasks
Section titled “Running Project Tasks”# Run a project taskangreal build
# Get help for a project taskangreal build --help
# Run with argumentsangreal deploy --environment staging --dry-runCommon Errors
Section titled “Common Errors”Template Not Found
Section titled “Template Not Found”# Error: Template not foundangreal init nonexistent/template
# Solutions:# 1. Check the template URL/path# 2. Ensure you have internet access for remote templates# 3. Check if the repository is public# 4. Try with full Git URLTask Not Found
Section titled “Task Not Found”# Error: Task 'build' not foundangreal build
# Solutions:# 1. Check if you're in an Angreal project:ls .angreal/
# 2. List available tasks:angreal --help
# 3. Check task file naming:ls .angreal/task_*.pyCommand Not Found
Section titled “Command Not Found”# Error: angreal command not found
# Linux/macOS:which angrealecho 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrcsource ~/.bashrc
# Windows:where angreal# Add to PATH: %APPDATA%\Python\ScriptsExit Codes
Section titled “Exit Codes”Angreal returns the following process exit codes:
| Code | Meaning |
|---|---|
0 |
Success. The task returned a truthy value or None, or called sys.exit(0). |
1 |
General failure. The task returned False or another falsy value, a command was missing, or Angreal itself encountered an error. |
56 |
An unhandled Python exception was raised while running a task. |
N |
Custom code. A task that calls sys.exit(N) or returns integer N propagates that value as the exit code. |
See Also
Section titled “See Also”- Quick Start - Getting started with Angreal
- Python API Reference - Task definition API
- Configuration Reference - Configuration file formats
- How-to Guides - Common task examples