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

# CLI

> Run Fluent agents interactively or from automation.

Install the CLI from npm. Node.js 20 or newer is required.

```bash theme={null}
npm install --global @fluenterp/cli
```

## Commands

```text theme={null}
fluent auth login
fluent auth logout
fluent auth status [--json]
fluent agents list [--json]
fluent runs create --agent <id-or-name> [options]
fluent runs get <run-id> [--json]
fluent runs list [options]
fluent runs watch <run-id> [--json]
```

`runs create` supports:

| Option                         | Description                                       |
| ------------------------------ | ------------------------------------------------- |
| `--file <path>`                | Foreground file; repeat for multiple files        |
| `--background-file <path>`     | Tool-accessible background file; repeat as needed |
| `--message <text>`             | Instruction for the agent                         |
| `--together`                   | Process foreground files in one conversation      |
| `--notification-email <email>` | Email when processing finishes                    |
| `--wait`                       | Poll until the run reaches a terminal status      |
| `--json`                       | Emit machine-readable output                      |

`runs list` accepts `--agent`, `--status`, `--limit`, and `--offset`.

## Authentication and environments

Use `fluent auth login` for interactive OAuth. For unattended use, set `FLUENT_API_KEY` or pass `--api-key`.

The CLI defaults to `https://www.fluenterp.com`. Set `FLUENT_BASE_URL` or pass `--base-url` only when intentionally targeting a different Fluent environment.

## CI example

```yaml theme={null}
- name: Install CLI
  run: npm install --global @fluenterp/cli

- name: Run Fluent agent
  env:
    FLUENT_API_KEY: ${{ secrets.FLUENT_API_KEY }}
  run: fluent runs create --agent "$AGENT_ID" --file invoice.pdf --wait --json
```

Create a separate API key for each automation so it can be audited and revoked independently.
