> ## Documentation Index
> Fetch the complete documentation index at: https://libops-renovate-github-com-libops-sitectl-0-x.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Authentication

> Log in to LibOps, inspect the active identity, update your profile, and create API keys for automation.

Use the authentication commands before running LibOps API workflows:

```bash theme={null}
sitectl libops login
sitectl libops whoami
sitectl libops logout
```

For the main LibOps CLI authentication reference, see [Authentication](https://docs.libops.io/cli/authentication). For focused automation setup, see [API Keys](https://docs.libops.io/cli/api-keys) and [SSH Keys](https://docs.libops.io/cli/ssh-keys).

`login` opens the same browser login flow used by the dashboard, including **Login with Google**. The CLI listens on a temporary localhost callback URL, stores OAuth credentials in `~/.sitectl/oauth.json`, and can create a saved API key for sustained access.

```bash theme={null}
sitectl libops login --api-url https://api.libops.io
```

## whoami and profile setup

`whoami` reports the active account, token/API-key state, GitHub username, and LibOps SSH key status:

```bash theme={null}
sitectl libops whoami
```

Set account profile fields from the CLI:

```bash theme={null}
sitectl libops account update --github-username octocat
sitectl libops account update --name "Ada Lovelace"
```

For checkout and SSH workflows, set your GitHub username and add the same public SSH key to both GitHub and LibOps.

## API keys

Use API keys for non-interactive or long-lived access:

```bash theme={null}
sitectl libops create apikey --name workstation --save
sitectl libops create apikey --name ci --scopes organization:read,project:write
sitectl libops list apikeys
sitectl libops delete apikey "$API_KEY_ID" --yes
```

The LibOps plugin checks for a saved API key before falling back to OAuth credentials.

## SSH keys

```bash theme={null}
sitectl libops create ssh-key --name laptop --public-key-file ~/.ssh/id_ed25519.pub
sitectl libops list ssh-keys
sitectl libops delete ssh-key "$KEY_ID" --yes
```
