> ## Documentation Index
> Fetch the complete documentation index at: https://getfloo.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# CLI commands

> Find the floo command for a task, and the recipes you use after the first deploy.

The `--app` flag is optional inside a directory with `floo.app.toml`. Use it when
running commands from elsewhere.

## Ship changes

Commit and push to GitHub. The deploy triggers automatically.

```bash theme={null}
git add . && git commit -m "feat: my change"
git push origin main
floo deploys watch --app my-app
```

## Find the command

<Note>
  **Before you connect:** a human must [install the floo GitHub App](https://github.com/apps/getfloo/installations/new) in a browser once per GitHub account that owns repos to deploy. An organization installation does not cover personal-account repos, or vice versa. When the App is missing, `connect` opens a setup link, or prints it with `--no-browser` (implied by `--json`); authorize floo with GitHub there to link the installation to your floo org. If you installed without opening a setup link, run [`floo apps github setup`](/docs/cli/github#setup) to link it.
</Note>

| I want to...                                                       | Run this                                                              |
| ------------------------------------------------------------------ | --------------------------------------------------------------------- |
| Create an account or log in                                        | `floo auth login`                                                     |
| Deploy for the first time                                          | `floo apps github connect owner/repo`                                 |
| Ship a code change                                                 | `git push origin main`                                                |
| Validate my config before pushing                                  | `floo preflight` (local only, no auth needed)                         |
| Apply env var changes by redeploying the current image, no rebuild | `floo redeploy --app my-app`                                          |
| Rebuild the current commit without a code change                   | `floo redeploy --rebuild --app my-app`                                |
| Watch a deploy in progress                                         | `floo deploys watch --app my-app`                                     |
| See deploy history                                                 | `floo deploys list --app my-app`                                      |
| Roll back to a previous version                                    | `floo deploys rollback my-app <id>`                                   |
| Set a public env var                                               | `floo env set PUBLIC_API_ORIGIN=https://api.example.com --app my-app` |
| Read custom-domain DNS records                                     | `floo domains show app.example.com --app my-app`                      |
| View logs                                                          | `floo logs query --app my-app`                                        |
| Run locally with dev managed-service credentials                   | `floo dev --app my-app` (requires `dev_command` in config)            |

## Task recipes

### Add env vars and redeploy

```bash theme={null}
floo env set API_KEY --stdin --secret --app my-app
floo redeploy --app my-app
```

### Add a database

Declare the database in `floo.app.toml`:

```toml theme={null}
[managed.default]
type = "postgres"
```

Preflight, commit, and push the declaration:

```bash theme={null}
floo preflight
git add floo.app.toml && git commit -m "feat: add postgres"
git push origin main
```

The next deploy provisions it and injects `DATABASE_URL` plus standard `PG*` variables. Postgres is fully isolated between dev and prod. Declare Redis with `type = "redis"` and Storage with `type = "storage"`; see [Managed Services: Dev and prod isolation](/docs/guides/managed-services#dev-and-prod-isolation) for the full model.

### Add a custom domain

Declare the domain in `floo.app.toml`, naming your target service:

```toml theme={null}
[domains."app.example.com"]
service = "web"
```

Commit and push the config, then wait for that commit's dev deploy to go live.
Release it to prod and read the DNS records:

```bash theme={null}
floo releases promote --app my-app
floo domains show app.example.com --app my-app
```

Publish the traffic and certificate CNAME records printed by `show` at your DNS
provider, then watch activation:

```bash theme={null}
floo domains watch app.example.com --app my-app
```

See [Custom domains](/docs/guides/custom-domains) for DNS setup and troubleshooting.

### Roll back a bad deploy

```bash theme={null}
floo deploys list --app my-app
floo deploys rollback my-app <deploy-id>
```

### Debug a failing deploy

```bash theme={null}
floo deploys logs <deploy-id> --app my-app
floo logs query --app my-app --since 1h --error
```

<CardGroup cols={2}>
  <Card title="How floo works" href="/docs/how-floo-works">
    The mental model. Config in the repo, GitHub-backed deploys, CLI-first.
  </Card>

  <Card title="Configuration" href="/docs/guides/configuration">
    Understand floo.app.toml and how services are declared.
  </Card>
</CardGroup>
