# no organization: turso CLI: no organization

> The CLI has no organization to act in: not logged in, no default org set, or the account belongs to none.

Source: https://sqlly.app/errors/libsql/cli-no-organization
Last updated: 2026-11-30
License: Text and data [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) (credit SQLly, sqlly.app); code and SQL snippets [MIT](https://opensource.org/license/mit). [Details](https://sqlly.app/license).
Note: Quoted error message text belongs to its database vendor.

- Error: `no organization`
- Category: Authentication and tokens

Error message:

```text
no organization selected or available
```

## What it means

The turso CLI acts inside one organization at a time. `turso auth login` picks a default interactively; automation runs without prompts (the `--headless` flag) and relies on its token's organization context. When the CLI has no organization to act in, commands that need one fail with this error. It is CLI state, not a rejected token: a bad token fails with an authentication error instead.

## Common causes

- Not logged in with `turso auth login`.
- No default organization selected for the account.
- An automation run whose token does not carry the organization context the command needs.

## How to fix it

1. Log in and set an organization:

   ```sql
   turso auth login
   turso org list
   turso org switch <org>
   ```

## Reproduce it safely

```sql
Needs CLI state with no usable organization, which is CI territory: an automation run whose token carries no organization context, or a login on an account with no organization selected yet. No honest offline repro; the error comes from the platform's answer about the account.
```

## How SQLly helps

SQLly connects straight to a `libsql://` URL with a database token and never needs a CLI organization: a connection that works in SQLly while the CLI reports no organization points at CLI setup, not at the database.

## Questions

### How do I use the turso CLI in CI without an interactive login?

Run with the `--headless` flag and authenticate with an API token minted for the organization the job acts on: `turso auth api-tokens mint <name> --org <org>`. If the account can see several organizations, set the active one explicitly.

### Is 'no organization' the same as a bad token?

No. The token can be perfectly valid while the CLI still lacks an organization to act in. A rejected token produces an authentication failure instead; `turso auth whoami` separates the two.

## Related errors

- [`401 Unauthorized`](https://sqlly.app/errors/libsql/unauthorized-401): 401 Unauthorized: bad or missing auth token
- [`auth token expired`](https://sqlly.app/errors/libsql/token-expired): Auth token expired
- [`database not found`](https://sqlly.app/errors/libsql/cli-database-not-found): turso CLI: database not found

The code and message text are from the [libSQL / Turso documentation](https://docs.turso.tech/).
