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

# Login and authentication

> You will need an active account and valid authentication session to use Auggie CLI, which you can get by following the instructions below.

## About authentication

Before you can use Auggie, you will need to login to create an authentication session that can be used by Auggie in both interactive and automation modes.

<Note>Augment authentication tokens are secrets and should be protected with the same level of security you'd use for any sensitive credential. Tokens are tied to the user who logged in, not to your team or enterprise account, so each user has a unique augment token.</Note>

## Logging in

You can login by running the following command and following the prompts.

```sh theme={null}
auggie login
```

## Logging out

You can logout by running the following command. This will remove the local token from your machine and you will need to login again to use Auggie.

```sh theme={null}
auggie logout
```

## Getting your session details

For automation, you will need to provide authentication details each time you run Auggie. After you have logged in above, you can print your current session JSON by running the following command.

```sh theme={null}
auggie token print
```

## Using your session details

After you have your session details, you can pass them to Auggie through a number of methods depending on your use case and environment.

### Environment variables

You can set the `AUGMENT_SESSION_AUTH` environment variable to the session JSON before running Auggie. Pass it before you run the command, add it to your environment, or add it to your shell's rc file to persist it.

```sh theme={null}
AUGMENT_SESSION_AUTH='<session-json>'
```

### Command-line flag

You can pass the session JSON directly using the `--augment-session-json` flag:

```sh theme={null}
auggie --augment-session-json '<session-json>'
```

## Revoking your tokens

You can revoke all the tokens for the current logged in user by running the following command. Using `logout` will only remove the local token from your machine.

```sh theme={null}
auggie token revoke
```
