CLI Reference
Complete reference for all CodeAnvil CLI commands.
Global Options
These options apply to all commands:
| Option | Default | Description |
|---|---|---|
-H, --host |
codeanvil.io | CodeAnvil server host |
-p, --port |
2222 | SSH server port |
-h, --help |
- | Show help message |
-V, --version |
- | Show version |
đĄ SSH Authentication
Override SSH options with the ANVIL_SSH_COMMAND environment variable:
bash
ANVIL_SSH_COMMAND="ssh -i ~/.ssh/work_key" anvil repo list
User Commands
Manage your user account and SSH keys.
bash
anvil user register
Register a new user account. Uses SSH agent for key authentication.
bash
anvil user key-add
Add an SSH key to your account. Example:
anvil user key-add "Laptop"
bash
anvil user key-list
List all SSH keys associated with your account.
bash
anvil user key-remove
Remove an SSH key from your account. Get the key ID from
key-list.
Organization Commands
Manage organization membership.
bash
anvil org invite
Invite a user to your organization.
bash
anvil org accept
Accept an organization invitation.
bash
anvil org list
List all members in your organization.
Repository Commands
Manage repositories and access control.
bash
anvil repo setup [path]
Setup a repository from the current directory (or specified path). Creates the repo
on the server and sets the origin remote automatically.
bash
anvil repo list
List all repositories you have access to.
bash
anvil repo member-add
Add a member to a repository. Role can be:
admin, write, or read.
bash
anvil repo member-list
List all members of a repository.
bash
anvil repo member-remove
Remove a member from a repository.
bash
anvil repo set-visibility
Set repository visibility. Admin only.
bash
anvil repo get-visibility
Get repository visibility setting.
Pull Request Commands
Create and manage pull requests.
âšī¸ Context-Aware
PR commands automatically detect the repository from the current directory's git origin remote.
bash
anvil pr create [--target]
Create a pull request from the current branch. Default target is
main.
bash
anvil pr list [--status open|merged|all]
List pull requests. Default filter is
open.
bash
anvil pr status
Check the status of a pull request. Shows approval state, signatures, and mergeability.
bash
anvil pr fetch
Fetch PR information for local review. Downloads the PR commit to your local repository.
bash
anvil pr approve
Approve a pull request. Adds a GPG-signed git note to the commit.
bash
anvil pr reject" "
Reject a pull request with a reason. Adds a rejection note to the commit.
bash
anvil pr merge
Merge a pull request. Only works if the PR is approved and mergeable.
bash
anvil pr close
Close a pull request without merging.
Agent Commands
Manage build agents (admin only).
bash
anvil agent new ""
Create a new agent registration. Returns agent ID and registration code.
bash
anvil agent list
List all agents in your organization.
bash
anvil agent remove
Remove an agent from your organization.
Job Commands
View and manage build jobs.
bash
anvil job list
List jobs for a repository.
bash
anvil job status
Get job details and status.
bash
anvil job logs
View job logs.
bash
anvil job cancel
Cancel a running job.