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

# Exit codes and errors

expl returns an exit code when it ends. Scripts and CI can use the number to judge the result.

## The exit codes

| Code | Meaning |
| - | - |
| 0 | Success |
| 1 | The operation failed. With Desktop, this also covers a declined confirmation, a timeout, and an approval request that was not answered within 2 minutes (PAIRING\_PENDING). With Server, it also covers an error the server returns for the operation, such as NOT\_FOUND or DATA\_EGRESS\_LIMIT. |
| 2 | Wrong usage: an unknown flag, unreadable JSON, a missing `--yes` outside a terminal, and so on. |
| 3 | Desktop or Server cannot be reached. For Server: the network, an HTML error page and so on. |
| 4 | Authentication, approval or permission. For Desktop: not signed in, the connection not approved, the CLI turned off, or the operation not allowed. For Server: not signed in, or the token or API key was rejected (wrong, expired, revoked, or blocked by an administrator). |
| 130 | Interrupted with Ctrl+C |

A reader closing the pipe (expl ... | head -1) is not an error and exits with 0.

## When you see 3 or 4

| Code | What to do |
| - | - |
| 3 | With Desktop, start Exploratory Desktop and run it again. With Server, check the network and run it again. |
| 4 | With Desktop, the code in parentheses at the end of the message tells which case it is (see the table below). With Server, run expl server login. With an API key, create a new key in Account Settings > API Keys if it is wrong, expired or revoked, or ask your administrator when the message says API keys are disabled or the IP address is not allowed. To switch to a saved login while EXPL\_SERVER\_TOKEN is set, run unset EXPL\_SERVER\_TOKEN first, because it is used before a saved login. |

The code at the end of an exit code 4 message tells what to do.

| Code in the message | What to do |
| - | - |
| NOT\_LOGGED\_IN | Server only. Run expl server login. |
| NOT\_SIGNED\_IN | Sign in to Exploratory Desktop. |
| UNAUTHORIZED | Desktop: run the command again. Exploratory Desktop asks you to approve the connection; see [Get started](https://docs.exploratory.io/en/cli/desktop/get-started#steps) for Desktop. Server: the API key was refused (wrong, expired or revoked). Create a new key in Account Settings > API Keys, then set EXPL\_SERVER\_TOKEN or run `expl server login --with-token`. |
| PAIRING\_REQUIRED | This connection was declined on the approval screen of Exploratory Desktop (this code is also used when too many approval requests are made in a short time). For 5 minutes after you decline, running the command again does not show the screen and is declined at once. Run it again after 5 minutes and allow it on the screen. |
| CHANNEL\_DISABLED | Desktop: in System Settings > MCP / CLI, turn on the switch on the CLI card and choose Save. Server: the publisher turned off MCP access for this content. Ask the publisher to check the MCP access setting of the content. |
| PERMISSION\_DENIED | Desktop: this connection is not allowed to perform that operation. For an operation that creates, changes or deletes content, check that Allow create, edit and delete is turned on in System Settings > MCP / CLI. Server: an administrator turned API keys off or limits them to certain IP addresses. Ask your administrator, or sign in with expl server login. |

To find a fix by symptom, see [Troubleshooting](https://docs.exploratory.io/en/cli/server/troubleshooting.md).


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