# CLI_TOKEN_INVALID

- Surface: CLI
- Exit code: 2

## Cause

`SPLITCH_TOKEN` is empty or malformed, or a request in token mode returned HTTP 401 or HTTP 403 with `CREDENTIAL_REVOKED`. Other HTTP 403 responses keep their server error code.

## Fix

Set `SPLITCH_TOKEN` to a valid, active Personal Access Token, or unset `SPLITCH_TOKEN` and run `splitch login`. Retry `splitch context --json` to verify authentication. Never pass the secret as a command argument or print it.

## Related

- [UNAUTHORIZED](https://splitch.dev/docs/error/UNAUTHORIZED)
- [CREDENTIAL_REVOKED](https://splitch.dev/docs/error/CREDENTIAL_REVOKED)
- [FORBIDDEN](https://splitch.dev/docs/error/FORBIDDEN)

Source: https://splitch.dev/docs/error/CLI_TOKEN_INVALID