# frbit CLI usage

Source: https://docs.fortrabbit.com/platform/automation/cli/usage
Published: 2026-11-17
Updated: 2026-11-17
Reviewed: 2026-11-17

> Every frbit command group with its main options and examples: apps, environments, deployments, database and files sync, SSH, domains, jobs and backups.


## Help



```shell
frbit help                # all command groups
frbit apps list --help    # every option of one command
```

The [complete command reference](https://github.com/fortrabbit/frbit-cli/blob/main/docs/cli.md) is maintained next to the source code.

## Common options

| Option | Effect |
| -- | -- |
| `--json` | Prints the API response unchanged, for scripts and `jq` |
| `--page`, `--limit`, `--all` | Pages through lists: `--limit 50` fetches until 50, `--all` everything |
| `--id` | Repeatable, lists only the given public IDs |
| `--confirm <id>` | Confirms a delete or an overwrite without a terminal |
| `--yes` | Confirms a billed change without a terminal, after the price was shown |
| `--profile <name>` | Uses another stored sign-in, goes before the command group |

API responses can contain account data, environment variable values and application log output. Treat terminal captures and CI logs as sensitive, especially around `--json` and `deployments logs`.

## Choose the environment

Commands take the environment as an ID (`en-a1b2c3`), as a label from `.fortrabbit/environments.yml`, or by name as `app/environment`. An app with a single environment needs only the app name. In scripts and agents, use the ID: names can change.



```shell
frbit ssh en-a1b2c3
frbit ssh my-app/main
frbit ssh my-app            # the app has one environment
frbit ssh "Acme Shop/main"  # quotes for a name with spaces
```

Commands that only read, plus `db`, `files` and `ssh`, can leave it out. They then use the environment of the project folder: the one [linked](/platform/automation/cli/setup#link-the-project) with `frbit link`, or the one that deploys the current git branch. On a terminal without either, frbit asks. Commands that change the environment over the API, such as `deploy`, `restart` and `update`, always need it named.

### Tab completion

With [shell completion](/platform/automation/cli/setup#shell-completion) set up, Tab lists the environments of the account by name, plus the labels of the project folder:



```shell
frbit ssh <Tab>
my-app/main   my-app/staging   my-blog/main
```

## SSH



```shell
frbit ssh                                   # a shell on the linked environment
frbit ssh en-a1b2c3
frbit ssh -- php artisan migrate --force    # one command, exits with its exit code
frbit ssh --print                           # print the plain ssh command
```

frbit connects with your own [SSH key](/platform/objects/ssh-key) and checks the host key of the fortrabbit SSH endpoints, so the first connection from CI needs no `known_hosts` entry. Without a terminal, ssh never prompts.

## Database



```shell
frbit db pull                               # the linked environment, to <environment>.sql.gz
frbit db pull en-a1b2c3 --output ./dumps/
frbit db push dump.sql.gz en-a1b2c3
```

`db pull` runs `mysqldump` on the environment over SSH, so no database password reaches the local machine. It writes a gzipped dump and never touches a local database: import it yourself, or with DDEV. An existing file stays unless `--force` is set.

`db push` replaces the database with a local dump, plain or gzipped. It asks for the environment ID first, or takes `--confirm <id>`, and dumps the current database to `/data/home/` on the environment before the import. When the import fails, the output names the backup and the command to restore it. See [database up](/platform/mysql/export-import/database-up-terminal) and [database down](/platform/mysql/export-import/database-down-terminal).

`frbit mysql get` prints host, port, user and database, never the password. `frbit mysql rotate-password <environment>` sets a new one; the app needs a restart or a deployment to read it.

## Files



```shell
frbit files pull web/uploads -e en-a1b2c3 --dry-run
frbit files pull web/uploads -e production
frbit files push web/uploads -e shop/production --confirm en-a1b2c3
```

`files pull` and `files push` sync one path between `/data/www/` on the environment and the current folder, with rsync over SSH. Without a path, the whole folder syncs. The environment goes in `-e`, because the argument is the path.

| Option | Effect |
| -- | -- |
| `--dry-run` | Lists what would change, copies nothing |
| `--delete` | Also removes files that the sending side does not have |
| `--exclude <pattern>` | Repeatable, skips matching files |
| `--confirm <id>` | Confirms a push, a whole-folder pull or a pull with `--delete` without a terminal |

No sync touches `.git/`, `.fortrabbit/`, `.ddev/`, `.env` files, or the dumps and backups frbit saved. See [rsync](/dev/how-to/rsync) for plain rsync with other options.

## Apps



```shell
frbit apps list
frbit apps get ap-a1b2c3
frbit apps create --name acme-shop --region eu-w1a --software laravel
frbit apps update ap-a1b2c3 --name renamed-shop
```

`apps create` creates the app with its first environment. Without `--preset`, it books the smallest component preset of the software template; `--component php=lg` changes single components on top. `--repository acme/shop --branch main --deploy` connects GitHub and starts the first deployment.

A billed create prints the monthly price and asks first. `--dry-run` only prints the price, `--yes` skips the question in scripts. Trial apps without a payment method are created without a question.

## Environments



```shell
frbit environments list
frbit environments get en-a1b2c3
frbit environments create --app ap-a1b2c3 --name staging --source-environment en-a1b2c3
frbit environments update en-a1b2c3 --branch develop --root-path public
frbit environments deploy en-a1b2c3
frbit environments restart en-a1b2c3
```

`--source-environment` copies the component plans of another environment, `--preset` picks a preset instead. `update` changes the name, the branch, the build commands, the deployment strategy, exclude patterns and the PHP version.

### Variables



```shell
frbit environments variables get en-a1b2c3               # values masked
frbit environments variables get en-a1b2c3 --reveal
frbit environments variables update en-a1b2c3 --set APP_ENV=production --delete OLD_FLAG
```

Values on the command line can stay in the shell history. For secrets, pass the request as JSON with `--file -` on standard input.

### Logs and metrics



```shell
frbit environments logs                                   # the linked environment, PHP errors
frbit environments logs en-a1b2c3 --source access --status 5xx --since 1h
frbit environments logs --follow
frbit environments metrics en-a1b2c3
frbit environments metrics en-a1b2c3 --metric php-requests --range 7d
```

`--source` is `php`, `apache`, `access` or `jobs`. `--status` and `--method` filter the access log. `metrics` without `--metric` prints usage and limits per component and the last 24 hours.

### Settings and components



```shell
frbit environments php-settings update en-a1b2c3 --set max_execution_time=120 --extension apcu=on
frbit environments basic-auth update en-a1b2c3 --enabled --username preview --password-stdin
frbit environments firewall-rules create en-a1b2c3 --description "Metrics exporter" --port 8080-8090
frbit environments components update en-a1b2c3 --component php=md
```

Each group also has `get` or `list`. A component change shows the old and new monthly price and asks first.

## Deployments



```shell
frbit deployments list
frbit deployments list -e production
frbit deployments get dp-a1b2c3
frbit deployments logs dp-a1b2c3 --follow
```

`list` shows the newest 30 first, `-e` narrows it to one environment. `logs --follow` prints new lines until the deployment ends.

## Domains



```shell
frbit domains list
frbit domains create en-a1b2c3 www.example.com --main
frbit domains create production acme-shop --cloud
frbit domains dns do-a1b2c3 --refresh
```

`create` prints the DNS record to set at the DNS provider. A bare domain like `example.com` also creates `www.example.com`. With `--cloud`, the name is a label for a fortrabbit cloud domain, which needs no DNS record.

## Jobs



```shell
frbit jobs list en-a1b2c3
frbit jobs create en-a1b2c3 --name queue --type worker --command "php artisan queue:work"
frbit jobs create en-a1b2c3 --name nightly --type cron --command "php artisan schedule:run" --interval day --max-runtime 3600
frbit jobs update jo-a1b2c3 --inactive
```

A worker runs all the time, a cron job on a schedule. A cron job needs `--interval` and `--max-runtime`; `--interval custom` takes a cron `--expression`. The command starts with `php ` or `bash `.

## Backups



```shell
frbit backups list en-a1b2c3
frbit backups create en-a1b2c3
frbit backups download ba-a1b2c3 --type database --output ./backups/
frbit backups restore ba-a1b2c3 --confirm en-a1b2c3
```

`download` saves the files or the database of a backup. `restore` overwrites the live database and files of the environment and cannot be undone.

## Delete resources



```shell
frbit apps delete ap-a1b2c3 --confirm ap-a1b2c3
```

Apps, environments, domains, jobs, teams and payment methods can be deleted. Deletes need a sign-in approved with `Allow deletes`, see [authenticate](/platform/automation/cli/setup#sign-in); a personal API token needs the `Read, write and delete` permission. The CLI shows what will be lost and asks for the exact public ID, or takes it with `--confirm`. Deleting an app or environment erases its files and database for good. Deleting a team or payment method can also delete the apps connected to it.

A declined confirmation prints `Aborted.` and exits with 1, so a script can test the exit code.

## Account and catalog



```shell
frbit people list
frbit teams list
frbit payment-methods list
frbit regions list
frbit plans list --component php --region eu-w1a
frbit component-presets list --group web-app
frbit templates list
frbit php-versions list
frbit git repositories
frbit git branches acme/site
```

The catalog lists show the values `apps create` and `environments create` accept, so scripts and agents do not have to guess them.

## Agent integration



```shell
frbit setup agent --remove
frbit mcp install --agent codex
frbit skills install --project
frbit skills update
```

`setup agent` is on the [setup](/platform/automation/cli/setup#connect-a-coding-agent) page. `mcp` and `skills` manage either side on its own. `skills install --project` writes the skills into the current project, for Claude Code, Codex and GitHub Copilot. See [agent skills](/platform/automation/agent-skills) and [MCP server](/platform/automation/mcp).
