# Flow

> porticol-cli flow: run a flow the app exports.

Canonical: https://porticol.app/docs/cli/flow

[View as Markdown](https://porticol.app/docs/cli/flow.md)

## Usage

```
porticol-cli flow <flow-file> [options]
```

## Flow options

| Option | What it does |
| --- | --- |
| `--bail` | stop the flow at the first failing request |
| `--max-time <time>` | stop the flow after this, as 30s or 10m |

## Sources

| Option | What it does |
| --- | --- |
| `--server <url>` | a Porticol Cloud or Team Server, or PORTICOL_SERVER |
| `--token <token>` | an API token for it, or PORTICOL_TOKEN, or the file named by PORTICOL_TOKEN_FILE, or the one login kept |
| `--collection <id\|name>` | the server's collection to run |
| `--folder <name\|id>` | run this folder's requests alone |
| `-e, --environment <file\|name>` | an environment file, or the name or id of one of the server's environments; file: and env: say which |
| `--remote` | run on the server rather than here (run only) |

## Secrets

| Option | What it does |
| --- | --- |
| `--secret <name=value>` | a secret variable, repeatable; above the environment file and the server's values, masked in every report |
| `--secret <name>` | the same, with the value read from the variable name |
| `--env-var <name>` | the same: the value is the process variable of that name |
| `--env-file <file>` | names to read from a .env file, one NAME=VALUE a line |

## Project

porticol.toml beside the collection names environment, data, timeout and reports; a flag always wins over it

## Reports

| Option | What it does |
| --- | --- |
| `-r, --reporter <name[:path]>` | cli, junit, json or html, to standard output or to the file at path; repeat for several. perf reports as cli, json or html |
| `--junit <path>` | the same as -r junit:<path> |
| `--json <path>` | the same as -r json:<path> |
| `--html <path>` | the same as -r html:<path> |

## Output

| Option | What it does |
| --- | --- |
| `--color <auto\|always\|never>` | colour in the report; auto is a terminal, or CLICOLOR_FORCE in the environment |
| `--no-color` | the same as --color never |
| `-q, --quiet` | the totals alone: no header, no result lines, and no notices |
| `--silent` | nothing on standard output; file reports still written |
| `--no-progress` | the results at the end rather than as they finish |
| `--verbose` | every assertion and every console line |

## Exit codes

| Code | Meaning |
| --- | --- |
| 0 | every request, assertion and threshold passed |
| 1 | an assertion, a schema check or a threshold failed, a flow stopped, or the run was stopped with Ctrl-C |
| 2 | a request could not be made |
| 3 | the command line, a file, the configuration, the token or a variable is wrong |
| 4 | the licence refused the run |
| 5 | the head document breaks the base document, at the level --fail-on names |
| 6 | the document has a lint finding of severity error |

## See also

- [this text, with examples](https://porticol.app/docs/cli.html)
- [a pipeline to copy](https://porticol.app/docs/automation.html)
