# Global options

The flags, output format, exit codes and environment variables that work the same way on every minicut command.

Every `minicut` command follows the rules on this page. A script or a coding agent can read the exit code and the JSON output of any command in the same way.

## Options

| Flag | Type | Description |
|---|---|---|
| `--json` | switch | Print one JSON object on stdout instead of text. Works on every command that lists it in its usage line |
| `--help`, `-h` | switch | Print every command with a one-line description, then exit with code 0. `minicut help` does the same |

A command name MiniCut does not know prints the command list and exits with code 2. On a computer that is not signed in, the sign-in check comes first, so it exits with code 10.

## Output

Results go to stdout. Notes for a person go to stderr, so stdout stays one clean result. Two notes can appear on stderr:

- The offline note, when the computer has not reached minicut.ai for a while. See [Account](/docs/cli/account).
- One line after an automatic update, on the next command.

With `--json`, an error has the same shape on every command:

```bash Terminal
minicut me --json
```

```json Output
{"error":{"code":"signed_out","message":"You are not signed in. Ask your agent to run minicut login.","url":null,"request_id":null}}
```

| Field | Description |
|---|---|
| `code` | A fixed error code. Read this to decide what to do |
| `message` | The same sentence the text output prints |
| `url` | A page on minicut.ai that fixes it, or `null` |
| `request_id` | The id of the request, to quote when you contact us, or `null` |

Without `--json`, the command prints the message, then the URL and `Request id:` when they exist.

If a command stops on an error it did not expect, it prints `minicut:` and the error, and exits with code 1.

## Exit codes

| Code | Meaning | What to do |
|---|---|---|
| 0 | Done | Nothing |
| 1 | A check found a problem, or the command stopped on an error it printed | Read the printed lines. Each check failure names its fix |
| 2 | The command could not run: a wrong flag, a missing file or a wrong id | Fix the command and run it again |
| 3 | The command needs your yes before it runs. It printed the line to run after you agree. Nothing was sent | Run the printed line if you agree. `minicut setup` also uses 3 when there is less than 5 GB free |
| 4 | `minicut setup` finished, but Python 3.12 or ffmpeg is missing | Install it from the site setup printed, then run setup again |
| 5 | An input is outside what the command or model takes | Change the input the message names |
| 6 | Not ready yet: a job is still running | Run the same command again later |
| 7 | MiniCut could not reach minicut.ai | Connect to the internet, then run the same command again |
| 8 | Something went wrong on our side, or there are too many requests right now | Run the same command again. If it fails again, wait a few minutes |
| 9 | Your account does not cover this. The message links to minicut.ai | Open the link in the message |
| 10 | This computer is not signed in, or the sign-in was cancelled or expired | Run `minicut login` |
| 12 | This version of MiniCut is too old | Run `minicut update`, then the same command again |
| 75 | Another `minicut update` is running | Wait for it to finish, then run `minicut update` again |

## Environment variables

| Variable | Default | Description |
|---|---|---|
| `MINICUT_HOME` | `~/.minicut`, or `%LOCALAPPDATA%\minicut` on Windows | The MiniCut home folder: settings, key file, tools, projects and library |
| `MINICUT_PORT` | `7311` | The port the MiniCut app uses on your computer. Set it when another program uses that port |
| `MINICUT_NO_AUTOUPDATE` | not set | Set to `1` to turn off the automatic update. `"auto_update": false` in `settings.json` does the same |
| `MINICUT_NO_ERROR_REPORTS` | not set | Set to `1` to turn off crash reports. `"error_reports": false` in `settings.json` does the same |
| `CI` | not set | When set, MiniCut makes no automatic update and sends no crash reports |
| `HTTPS_PROXY` | not set | Read when you install MiniCut. The install saves it as the proxy for every command. Change it later with [minicut network](/docs/cli/setup#minicut-network) |

When a command crashes, MiniCut sends one crash report to minicut.ai. It carries no key, no file path and no error message.

## See also

[Account](/docs/cli/account) [Setup](/docs/cli/setup) [Quickstart](/docs/cli/quickstart)
