---
title: "CLI"
description: "Every Regent command. regent COMMAND --help has the details."
---

> Documentation Index
> Fetch the complete documentation index at: https://regent.c4n.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# CLI

Run `regent` on its own for help. Global flags: `-q` (one live line instead of every step),
`-v` (print every command Regent runs). Results go to stdout, progress to stderr.

## Environments

| Command | What it does |
| --- | --- |
| `regent create NAME` | Create an environment. [Flags](https://regent.c4n.dev/docs/guides/linux/#options) |
| `regent ls [--json]` | List environments |
| `regent ssh NAME [-- CMD]` | A shell, or run a command |
| `regent start NAME` | Start a stopped environment |
| `regent stop NAME` | Stop it; the disk is kept |
| `regent reset NAME` | A fresh system from the image; on Linux the home is kept (`--wipe`: not). macOS keeps the home inside the machine, so it needs `--wipe`. `--refresh` builds the image again without the cache: the latest packages and agents |
| `regent rm NAME` | Delete it (`--yes`, `--keep-home`, `--keep-image`, `--delete-image`) |
| `regent fork SOURCE NEW` | A copy of another environment (`--from SNAPSHOT`) |
| `regent snapshot create\|ls\|restore\|rm` | [Snapshots](https://regent.c4n.dev/docs/guides/snapshots/) |
| `regent idle NAME [30m\|off]` | [Idle stop](https://regent.c4n.dev/docs/guides/idle-stop/) |
| `regent dashboard` | Every environment, live (`dash`) |

## Using them

| Command | What it does |
| --- | --- |
| `regent forward NAME PORT[:LOCAL]` | A port on this Mac's localhost, until Ctrl-C (`--open`) |
| `regent desktop NAME` | Its desktop in your browser (`--url-only`) |
| `regent screen NAME COMMAND` | screenshot, click, type, key, run, status: [Screens](https://regent.c4n.dev/docs/guides/desktop/) |

## Setup and defaults

| Command | What it does |
| --- | --- |
| `regent setup [--yes]` | Install Apple container and start its services |
| `regent setup macos [--xcode] [--yes]` | Install Tart and download the macOS image |
| `regent doctor [--json]` | What's installed and what's missing, and whether a newer Regent is out |
| `regent update` | Update Regent (Homebrew); its files on your Mac follow on the next run |
| `regent config` | Show defaults; `config set\|unset KEY` |
| `regent agents ls` | Agents Regent can install; `agents default` |
| `regent share ls` | Shared logins; `share forget ITEM` |
| `regent skill setup\|show\|status\|remove` | [Agent setup](https://regent.c4n.dev/docs/getting-started/agent-setup/) |
| `regent tailnet setup\|prune` | Connect to your tailnet; delete leftover devices |
| `regent rex install\|uninstall` | Regent's actions in Rex's command palette |
| `regent prune` | Delete images nothing uses |
| `regent completion install` | Tab completion for zsh, fish and carapace (nushell and others); `completion bash\|zsh\|fish\|powershell` prints a script |
| `regent trace [--json]` | Where the time went in the last run with `REGENT_TRACE=1` |
| `regent version [--json]` | Version and build |

## Guarded environments

| Command | What it does |
| --- | --- |
| `regent egress ls\|allow\|deny\|log` | [What guarded environments may reach](https://regent.c4n.dev/docs/guides/egress/) |
| `regent secret set\|ls\|rm` | [Secrets the proxy injects](https://regent.c4n.dev/docs/guides/egress/#secrets) |

## For scripts and agents

- `regent ls --json` and `regent doctor --json` have stable schemas.
- Without a terminal Regent never asks: a missing choice fails with the flag to add, and
  `rm` needs `--yes`.
- Output follows `NO_COLOR`, `TERM=dumb` and `REGENT_ASCII=1`.

Source: https://regent.c4n.dev/docs/reference/cli/index.mdx
