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

# Scripts and CI

> Run the streampixel command in scripts and CI jobs: JSON output, exit codes, error codes, API keys and environment variables.

> [!NOTE]
>
> **Beta.** The Streampixel command line (version 0.1.0-beta.1) and the Streampixel MCP server are in beta. Commands, tools and their output can still change before the stable release.

## JSON output

Add `--json` to any command. It then prints exactly one JSON document on standard output, and the exit code says how it went. Progress goes to standard error.

```json theme={"dark"}
{ "ok": true,  "command": "deploy", "data": { "buildId": "…", "live": true, "next": "streampixel test" } }
{ "ok": false, "command": "upload", "error": { "code": "BUILD_REJECTED", "message": "…", "hint": "…" } }
```

* `error.hint` says what to do.
* `data.next` names the next command.
* On a failure, `data` holds what was done before it failed, for example the `buildId` of a build that was uploaded and then rejected.
* Branch on `error.code`, never on the wording of `message`.

## Exit codes

| Exit code | Meaning |
| - | - |
| 0 | Done |
| 1 | The step ran and failed (build rejected, packaging failed, no picture) |
| 2 | Wrong arguments |
| 3 | Not signed in, or the API key lacks a scope |
| 4 | Project or build not found |
| 5 | `doctor` found problems |
| 6 | Streampixel could not be reached |
| 7 | Waited as long as allowed; nothing is lost, run it again later |
| 8 | This computer cannot do it (not Windows, no Unreal Engine, no browser) |

## Common error codes

| Code | What it means |
| - | - |
| `PIXEL_STREAMING_NOT_READY` | The Pixel Streaming plugin check failed. Run `streampixel doctor`. |
| `PACKAGE_FAILED` | Packaging failed. `error.details.problems[]` lists each problem with a code (`COMPILE_ERROR`, `LINK_ERROR`, `COOK_ERROR`, `MISSING_PLUGIN`, `LIVE_CODING_ACTIVE`, `TOOLCHAIN_MISSING`, `MISSING_RECEIPT`, `FILE_LOCKED`, `DISK_FULL`), the file and line or asset, and a hint. |
| `BUILD_HAS_UPROJECT` | The folder is the source project, not a packaged build. Upload the output of `package`. |
| `BUILD_NO_EXE` | No Windows `.exe` in the build. Only Windows builds are supported. |
| `BUILD_NO_PIXEL_STREAMING` | The build was packaged without the Pixel Streaming plugin. |
| `UPLOAD_INTERRUPTED` | The upload stopped. Run the same command again to resume. |
| `BUILD_REJECTED` | Streampixel did not accept the build. `error.message` says why. |
| `TOO_LARGE` | The build is over the project's upload limit. |
| `WAIT_TIMEOUT` | The build was still processing when the wait ended. |
| `PROJECT_OFF` | The project is switched off. `deploy` switches it on, or enable it in the dashboard. |
| `NO_PICTURE` | `test` got no picture. |
| `BUILD_NOT_ON_SERVER` | The live build is not on the streaming server yet. Wait until `deploy` reports it live. |
| `APP_NEVER_CONNECTED` | The application started but never connected for streaming. Check the Pixel Streaming plugin with `doctor`. |
| `APP_CRASHED` | The application closed during the test session. Read the session's Unreal log. |

## Sign in without a browser

Where nobody can open a browser, set `STREAMPIXEL_API_KEY` to a key from [API keys](https://docs.streampixel.io/resources/dashboard/api-keys.md).

* A key with the `read` scope can run `whoami` and follow builds.
* `deploy` needs the `control` scope.
* Uploading a build file needs `streampixel login`.

> [!WARNING]
>
> Never print, log or commit an API key. Keep it in your CI system's secrets.

## Environment variables

| Environment variable | Purpose |
| - | - |
| `STREAMPIXEL_PROJECT` | Project id when `--project` is not given |
| `STREAMPIXEL_API_KEY` | Credential for CI instead of `login` |
| `STREAMPIXEL_ENGINE_DIR` | Unreal Engine folder, when it is not found automatically |
| `STREAMPIXEL_BROWSER` | Chrome or Edge for `test`, when it is not found automatically |
| `STREAMPIXEL_CONFIG_DIR` | Where saved state is kept: resumable uploads, the last upload per project. Default `%APPDATA%\streampixel` on Windows, `~/.config/streampixel` elsewhere. |
| `STREAMPIXEL_CREDENTIAL_STORE` | Set to `file` to skip the system credential store. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.