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

# Global flags, exit codes and CI

> Use the Square Cloud CLI's global flags, JSON output, exit codes and debug tracing, check platform health, and run the CLI safely in scripts and CI.

## `squarecloud help`

```bash Usage theme={"system"}
squarecloud help [command]
squarecloud [command] --help
```

Lists every command, or explains one. Help follows your [system language](/en/cli-reference/installation#language).

```bash Output theme={"system"}
A command line application to manage your Square Cloud applications

Usage:
  squarecloud COMMAND [flags]
  squarecloud [command]

Available Commands:
  app         Manage your applications with these commands
  auth        Manage your Square Cloud login with these commands
  commit      Make a commit for your application
  db          Manage the databases of your account
  help        Help about any command
  status      Check the Square Cloud platform health
  upload      Upload a new application
  workspace   Manage your team workspaces
  zip         Zip the current folder

Flags:
  -h, --help      Show help for this command
      --json      Output raw JSON
  -v, --version   Print the CLI version

Use "squarecloud [command] --help" for more information about a command.
```

## Global flags

| Flag | Description |
| - | - |
| `--json` | Prints raw, machine-readable JSON on commands that print data (`list`, `info`, `status`, `logs`, `auth whoami`, `upload`, ...). Commands without JSON output (`app start`, `app delete`, `commit`, `zip`, ...) reject the flag with an error. |
| `-h`, `--help` | Shows help for any command. |
| `-v`, `--version` | Prints the CLI version. Only on `squarecloud` itself. |

Destructive commands also accept `-y`/`--yes` to skip their `y/N` confirmation. The pages of each command list it.

## `squarecloud status`

```bash Usage theme={"system"}
squarecloud status [--json]
```

Checks whether the Square Cloud platform is operating normally. It works without logging in. For one application or database, use [`squarecloud app status`](/en/cli-reference/status-and-metrics#squarecloud-app-status) or [`squarecloud db status`](/en/cli-reference/databases#squarecloud-db-status).

```bash Output theme={"system"}
✓ <status message>
```

When the platform reports a problem, the line starts with `X` instead. See also the [status page](https://status.squarecloud.app/).

## Debugging

* Set **`SQUARECLOUD_DEBUG=1`** to trace every API request to stderr: method, path, status and duration. Headers, query strings and bodies are never logged, so the output is safe to share.
* Read requests are retried automatically after a network error or when the platform is briefly busy.
* **Ctrl+C** cancels the request in flight; a second Ctrl+C exits a command that is waiting for input.

```bash theme={"system"}
SQUARECLOUD_DEBUG=1 squarecloud app list
```

## Scripts and CI

The CLI behaves predictably when it runs without a person at the keyboard:

* **Authentication:** set `SQUARECLOUD_API_KEY` instead of running `auth login`. See [Authentication](/en/cli-reference/authentication#ci-and-scripts).
* **Pass IDs explicitly.** The application and database pickers need a terminal. See [how the CLI finds your app](/en/cli-reference/quickstart#how-the-cli-finds-your-app).
* **Exit codes:** every failure exits with code `1`, including when the CLI was installed through npm. Check exit codes, not message text.
* **Confirmations fail closed.** Answering no, or running a command that asks for confirmation without a terminal and without `-y`, exits with code `1` and changes nothing. The commands that ask are `app delete`, `app env replace`, `app env remove --all`, `app file delete`, `app file read -o` over an existing file, `app network purge-cache`, `app snapshot restore`, `db delete`, `db snapshot restore`, `db credentials reset`, `workspace delete`, `workspace leave`, `workspace member remove`, and `auth login` when it would replace another account's key.
* **stdout carries only results.** Errors, the "not logged in" message, confirmation prompts, failure lines and the update notice go to stderr. With `upload --json`, progress messages go to stderr too.
* **Parse `--json`, not tables.** On non-English systems, table headers and `info` labels are translated. To force English, run with `LC_ALL=en_US.UTF-8`.
* **Already in that state is success.** Starting a running app or database, or stopping a stopped one, says so and exits with code `0`.

To deploy from GitHub Actions, see the help center's [automated deploy workflow](https://help.squarecloud.app/en-us/article/workflow-github-actions-automated-deploy-ff34mk/).

## Related

| Command | API | JavaScript SDK |
| - | - | - |
| `status` | [`GET /v2/service/status`](/en/api-reference/endpoint/service/status) | [`api.service.status()`](/en/sdks/js/client) |
