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

# CLI Authentication

> How to authenticate the Moneda CLI

The Moneda CLI uses OAuth 2.0 to securely connect to your account. Your credentials are never stored in plain text — the CLI saves an encrypted token on your machine.

## Logging in

Run the login command to authenticate:

```bash theme={null}
moneda auth login
```

This opens your default browser where you sign in to your Moneda account and approve the requested permissions. Once approved, the CLI stores your token locally and you're ready to use any command.

<Info>
  Your password is never shared with the CLI. The OAuth flow means the CLI only receives a scoped access token, not your credentials.
</Info>

## Checking your session

To see if you're currently logged in and which account is active:

```bash theme={null}
moneda auth status
```

This shows your username, email, and when your token expires.

## Logging out

To clear your stored credentials:

```bash theme={null}
moneda auth logout
```

This removes the saved token from your machine. You'll need to run `moneda auth login` again to use the CLI.

## Token storage

The CLI stores your OAuth token in:

```
~/.moneda/auth.json
```

<Warning>
  This file contains your access token. Keep it secure and don't share it. If you suspect your token has been compromised, run `moneda auth logout` immediately to revoke it.
</Warning>

## What's next?

<CardGroup cols={2}>
  <Card title="Command Reference" icon="book" href="/cli/commands">
    See all available CLI commands.
  </Card>

  <Card title="CLI Examples" icon="lightbulb" href="/cli/examples">
    Common workflows using the CLI.
  </Card>

  <Card title="Scopes" icon="list-check" href="/scopes">
    Understand what permissions the CLI requests.
  </Card>

  <Card title="REST API Authentication" icon="shield-check" href="/api/authentication">
    How authentication works at the API level.
  </Card>
</CardGroup>
