# Command reference

> The built-in commands, plus how every MCP tool becomes one.

Source: https://advibly.com/docs/cli/commands



## Built-in commands [#built-in-commands]

| Command                            | What it does                                                  |
| ---------------------------------- | ------------------------------------------------------------- |
| `advibly login`                    | Browser OAuth. Tokens go to `~/.config/advibly`.              |
| `advibly logout`                   | Sign out of this server. `--all` for every profile.           |
| `advibly whoami`                   | Who you are signed in as.                                     |
| `advibly tools`                    | Every tool the server currently exposes, grouped.             |
| `advibly tools <name>`             | One tool's full schema. `--refresh` re-reads from the server. |
| `advibly call <tool> '<json>'`     | Call a tool directly with a raw argument object.              |
| `advibly upload <file>`            | Local file into the brand's asset library.                    |
| `advibly download <generation-id>` | Result files to disk. `-o <dir>`.                             |
| `advibly config set\|unset\|list`  | Default arguments. See [Configuration](/cli/configuration).   |
| `advibly version`                  | Version.                                                      |

## Generated commands [#generated-commands]

Everything else is generated from the server's tool list:

```bash
advibly generate-image --prompt "..." --brand-id <id>
advibly list-generations --status completed
advibly social-create-post --caption "..." --profile-ids <id>
```

The mapping is mechanical:

* `advibly_generate_image` → `advibly generate-image`
* `brand_id` → `--brand-id`
* enums become choices, numbers are validated
* arrays are repeatable, or passed once as a JSON array
* objects are passed as JSON

`advibly --help` lists whatever the server exposes today.

Use `advibly tools <name>` when writing or repairing a script. The returned
schema—not this page—is the completion check for argument names, required
fields, enums, and current defaults.

## Passing raw arguments [#passing-raw-arguments]

When a flag is awkward, pass the whole object:

```bash
advibly generate-image --args '{"brand_id":"...","prompt":"..."}'
advibly generate-image --args-file ./brief.json
cat brief.json | advibly generate-image --args-file -
```

Explicit flags override anything in `--args`.

Anything without a generated command can still be called:

```bash
advibly call advibly_check_credits '{}' --json
```

The CLI supplies the required MCP `context` argument automatically. Pass the
task arguments only; scripts do not need to manufacture analytics context.

## Waiting for generations [#waiting-for-generations]

Generation commands poll until the job is terminal rather than returning a
pending id.

| Flag                  | Effect                                     |
| --------------------- | ------------------------------------------ |
| `--no-follow`         | Return immediately with the generation id. |
| `--timeout <seconds>` | Cap the wait. Default 1800.                |
| `--json`              | Machine-readable output.                   |

## Exit codes [#exit-codes]

| Code | Meaning                                        |
| ---- | ---------------------------------------------- |
| `0`  | Success.                                       |
| `1`  | Tool error, or a failed / rejected generation. |
| `2`  | Usage error.                                   |
| `3`  | Login required.                                |

These make the CLI usable in CI without parsing output.

For automation, require both exit code `0` and the expected output field. A
successful command with the wrong brand or project is still the wrong result.
