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

# CLI exit codes

The Nebius AI Cloud CLI can make multiple network requests when running a command to improve the user experience. The CLI divides the requests into target and extra calls:

* A *target call* is the main network request for a command and corresponds to the command path. For example, for `nebius compute instance create`, the target gRPC call is `nebius.compute.v1.InstanceService/Create`.

* *Extra calls* improve the user experience and return a clearer picture of resource state. They include waiting for an operation that a target request started to complete, and fetching a resource after the CLI has created or updated it. The exit code for an extra-call error equals the exit code for the target call plus 40.

## Exit code reference

The CLI groups exit codes as follows:

* General CLI errors: 1–10
* Target call gRPC errors: 11–20
* Target call service errors: 21–50
* Extra call gRPC errors: 51–60
* Extra call service errors: 61–90

| Exit code  | Description                                                                                                                                                  |
| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `1`        | Unknown error. Server returned `UNKNOWN` gRPC code.                                                                                                          |
| `2`        | Incorrect input from the user. Unknown flag or command, unparsable JSON or YAML input, unparsable flag value, incorrect number of arguments for the command. |
| `3`        | Validation error. Wrong command argument or flag value, or server returned `INVALID_ARGUMENT` gRPC code for a target or extra call.                          |
| `4`        | CLI configuration error.                                                                                                                                     |
| `5`        | CLI internal error. Server returned `UNIMPLEMENTED`, `INTERNAL` or `DATA_LOSS` gRPC code.                                                                    |
| `6`        | The user canceled command execution.                                                                                                                         |
| `7`        | Any authentication error. For example, SDK couldn't set the Bearer token, or server returned `UNAUTHENTICATED` gRPC code for a request.                      |
| `11`, `51` | Service returned gRPC code `CANCELLED` for a target or extra call.                                                                                           |
| `12`, `52` | gRPC code `DEADLINE_EXCEEDED`.                                                                                                                               |
| `13`, `53` | gRPC code `NOT_FOUND`.                                                                                                                                       |
| `14`, `54` | gRPC code `ALREADY_EXISTS`.                                                                                                                                  |
| `15`, `55` | gRPC code `PERMISSION_DENIED`.                                                                                                                               |
| `16`, `56` | gRPC code `RESOURCE_EXHAUSTED`.                                                                                                                              |
| `17`, `57` | gRPC code `FAILED_PRECONDITION`.                                                                                                                             |
| `18`, `58` | gRPC code `ABORTED`.                                                                                                                                         |
| `19`, `59` | gRPC code `OUT_OF_RANGE`.                                                                                                                                    |
| `20`, `60` | gRPC code `UNAVAILABLE`.                                                                                                                                     |
| `21`, `61` | Service error `BadResourceState`.                                                                                                                            |
| `22`, `62` | Service error `ResourceConflict`.                                                                                                                            |
| `23`, `63` | Service error `TooManyRequests`.                                                                                                                             |
| `24`, `64` | Service error `QuotaFailure`.                                                                                                                                |
| `25`, `65` | Service error `NotEnoughResources`.                                                                                                                          |

## How the CLI determines exit codes

The CLI determines the exit code for a gRPC request error as follows:

* If the server returns a gRPC code other than `OK`, the CLI checks the first element in `google.rpc.Status.details`.
* If that element is a `ServiceError` with a designated exit code, the CLI returns that code.
* If the service error has no designated exit code, or the details do not contain a service error, the CLI returns the exit code that corresponds to the gRPC code.
