# CLI reference

> Every command of ry, the Rytiv CLI, generated from its source.

`ry` is the Rytiv command line. This reference is generated from the CLI's own command definitions, so it lists exactly what `ry --help` and the help of each subcommand show.

## Install

```bash
curl -fsSL https://get.rytiv.com/install.sh | sh
```

The CLI is a Node.js package and needs Node.js 22.6 or newer. The installer checks the published checksum before it installs anything.

## Sign in

```bash
ry login
```

`ry login` shows a code that you confirm in the console. Where nobody can open a browser (CI, a coding agent), use a token instead: `ry login --token <token>`, or set `RYTIV_TOKEN` in the environment. Create tokens with [`ry tokens create`](https://docs.rytiv.com/reference/cli/tokens.md).

## Global options

- `-v, --version`: Output the version number.
- `--json`: Output raw JSON (scripting).
- `-P, --profile <name>`: Which saved login to use for this call (does not change the default).

Every command accepts `--json` for machine-readable output, which is the form to use from scripts and agents.

## Environment

- `RYTIV_TOKEN`: the API token to use for this shell. It takes precedence over a saved login and is never written to disk.
- `RYTIV_ENDPOINT`: the API endpoint to talk to. Without it, the CLI uses `https://api.rytiv.app`.
- `RYTIV_PROFILE`: which saved login to use for this shell (see [`ry profile`](https://docs.rytiv.com/reference/cli/profile.md)).

## Commands

- [`ry apps`](https://docs.rytiv.com/reference/cli/apps.md): Manage apps.
- [`ry attach`](https://docs.rytiv.com/reference/cli/attach.md): Attach a resource to an app: injects the connection URL as a managed secret.
- [`ry billing`](https://docs.rytiv.com/reference/cli/billing.md): What the current usage costs.
- [`ry bucket`](https://docs.rytiv.com/reference/cli/bucket.md): Manage object storage buckets (files for your apps).
- [`ry computer`](https://docs.rytiv.com/reference/cli/computer.md): Links to watch or control a computer VM (images/computer), and who had control.
- [`ry config`](https://docs.rytiv.com/reference/cli/config.md): Manage the project file (rytiv.json).
- [`ry console`](https://docs.rytiv.com/reference/cli/console.md): Start a throwaway machine from this app's last image and get a shell in it.
- [`ry cron`](https://docs.rytiv.com/reference/cli/cron.md): Run something of an app on a schedule: call a path (the app is woken) or run a command on its own machine.
- [`ry deploy`](https://docs.rytiv.com/reference/cli/deploy.md): Deploy from a source directory (--source) or a prebuilt OCI image (--image); reads rytiv.json if present.
- [`ry deploys`](https://docs.rytiv.com/reference/cli/deploys.md): Deployment history of an app: which machines each deploy created and retired.
- [`ry detect`](https://docs.rytiv.com/reference/cli/detect.md): What this project is and what it needs - reads the directory, changes nothing.
- [`ry domains`](https://docs.rytiv.com/reference/cli/domains.md): Attach your own domains to an app.
- [`ry exec`](https://docs.rytiv.com/reference/cli/exec.md): Run a command in a running machine and exit with its exit code (the command goes after --).
- [`ry forward`](https://docs.rytiv.com/reference/cli/forward.md): Forward a local port to a port inside a machine, e.g. `ry forward shop 8080:3000` (no public port needed).
- [`ry git`](https://docs.rytiv.com/reference/cli/git.md): Deploy on push: connect an app to a GitHub repository and see what pushes did.
- [`ry job`](https://docs.rytiv.com/reference/cli/job.md): Run one command in an app's image on a throwaway machine, and get its result.
- [`ry link`](https://docs.rytiv.com/reference/cli/link.md): Let an app reach another app privately at `<target>.internal` (no public door needed).
- [`ry links`](https://docs.rytiv.com/reference/cli/links.md): Show the private app-to-app links in this workspace.
- [`ry login`](https://docs.rytiv.com/reference/cli/login.md): Sign in: shows a code to confirm in the console (--token stays for CI).
- [`ry logs`](https://docs.rytiv.com/reference/cli/logs.md): Stream the console output of an app's machines.
- [`ry machine`](https://docs.rytiv.com/reference/cli/machine.md): Act on a single machine.
- [`ry machines`](https://docs.rytiv.com/reference/cli/machines.md): List machines for an app.
- [`ry mail`](https://docs.rytiv.com/reference/cli/mail.md): Transactional email: sending domains, log, inbox, suppressions.
- [`ry maintenance`](https://docs.rytiv.com/reference/cli/maintenance.md): Switch an app's maintenance mode: the edge answers every request with 503, the machines keep running.
- [`ry new`](https://docs.rytiv.com/reference/cli/new.md): Start a new project from a template - scaffolder plus the part that makes it deploy here.
- [`ry postgres`](https://docs.rytiv.com/reference/cli/postgres.md): Managed Postgres: create, branch, fork, sleep policy (stored; not in force on every host).
- [`ry preview`](https://docs.rytiv.com/reference/cli/preview.md): One preview address per branch - opened by a push, closed by itself.
- [`ry profile`](https://docs.rytiv.com/reference/cli/profile.md): Saved logins for lab, prod, ...
- [`ry protect`](https://docs.rytiv.com/reference/cli/protect.md): Give an app a protected view (password or share link).
- [`ry proxy`](https://docs.rytiv.com/reference/cli/proxy.md): Forward a local port to a machine, e.g. `ry proxy my-db 15432:5432` then `psql -h 127.0.0.1 -p 15432`.
- [`ry releases`](https://docs.rytiv.com/reference/cli/releases.md): The releases of an app: what went out, which one runs, and which ones a rollback can bring back.
- [`ry resource`](https://docs.rytiv.com/reference/cli/resource.md): Manage attachable resources (redis, postgres).
- [`ry rollback`](https://docs.rytiv.com/reference/cli/rollback.md): Deploy an earlier release again, without a rebuild (default: the previous release that went live); secrets, settings, volumes and databases stay as they are.
- [`ry sandbox`](https://docs.rytiv.com/reference/cli/sandbox.md): Short-lived machines for one task each - created from a template, removed at their deadline.
- [`ry secrets`](https://docs.rytiv.com/reference/cli/secrets.md): Manage app secrets.
- [`ry ssh`](https://docs.rytiv.com/reference/cli/ssh.md): An interactive shell in a running machine (over the Rytiv API, no SSH needed); real SSH for IDEs: ry ssh config.
- [`ry ssh-keys`](https://docs.rytiv.com/reference/cli/ssh-keys.md): SSH public keys of this org (for ssh `<app>@ssh.<domain>`).
- [`ry status`](https://docs.rytiv.com/reference/cli/status.md): Overview of all apps and machine states.
- [`ry tokens`](https://docs.rytiv.com/reference/cli/tokens.md): API tokens for CI (org-scoped).
- [`ry unlink`](https://docs.rytiv.com/reference/cli/unlink.md): Remove a private link between two apps.
- [`ry usage`](https://docs.rytiv.com/reference/cli/usage.md): Show metered usage with prices and total.
- [`ry volume`](https://docs.rytiv.com/reference/cli/volume.md): Manage durable volumes (persistent block storage).
- [`ry webhooks`](https://docs.rytiv.com/reference/cli/webhooks.md): Endpoints we call when a message is sent, bounces, is complained about, fails or arrives.
- [`ry whoami`](https://docs.rytiv.com/reference/cli/whoami.md): Show the identity behind the configured token: an org (product token) or the system (operator token).
