> For the complete documentation index, see [llms.txt](https://docs.auroralabs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.auroralabs.com/loci-plugin-for-ai-coding-assistants/loci-plugin/authenticating-loci-plugin.md). Agents can also search and read this documentation through its [MCP server](https://docs.auroralabs.com/~gitbook/mcp).

# Authenticating LOCI  Plugin

### Why sign-in is required

The `loci` CLI requires sign-in for every analysis command, including ones that never touch the network, like `loci elf stack` and `loci cockpit`. Commands that work signed out: `loci login`, `loci logout`, `loci auth status`, `loci doctor`, every `loci contract` command, `loci frequency models`, and local housekeeping verbs (`loci build fresh`, `affected`, `clean`, `loci init probe`, `loci project`).

In practice this means: **all 7 analysis skills and `/loci:init` require a signed-in session.**&#x20;

Only `/loci:help`, `/loci:setup`, `/loci:bug-report` and `/loci:contract` work signed out.

| Requires sign-in             | Doesn't require sign-in |
| ---------------------------- | ----------------------- |
| `loci-preflight` (automatic) | `/loci:help`            |
| `loci-post-edit` (automatic) | `/loci:setup`           |
| `/loci:exec-trace`           | `/loci:bug-report`      |
| `/loci:stack-depth`          | `/loci:contract`        |
| `/loci:memory-report`        |                         |
| `/loci:control-flow`         |                         |
| `/loci:trends`               |                         |
| `/loci:init`                 |                         |

### Signing in

```
! loci login
```

(or `loci login` directly in a terminal). This opens your default browser to a one-time OAuth sign-in (PKCE flow). Free tier works on one repository, no credit card required.

Confirm it worked:

```
! loci auth status
```

Shows `signed_in` plus your session's expiry time.

### Where your session is stored

Your session token is stored in your OS's credential manager (keyring) when one is available. On hosts without a usable keyring (headless/SSH/WSL/Docker/CI), it falls back to a `0600`-permission file at `~/.loci/credentials.json`. `loci doctor` reports which backend is in use.

### Session expiry and re-authentication

Sessions expire after a period of inactivity. When that happens, the next analysis skill reports `auth_required` — run `! loci login` again and retry.

### Signing out

```
! loci logout
```

Removes your stored credential from both the keyring and the file fallback.

### Headless environments (no browser)

On a machine with no local browser (SSH, containers, CI), `loci login` switches to a device-code sign-in: it prints a URL and a code that you open and enter in a browser on any device. Force it with `loci login --device`, or force the browser flow with `--no-device`.

### Common issues

**A skill reports `auth_required`:**

1. Run `! loci login`, then retry the skill.
2. Confirm with `! loci auth status` that it now shows `signed_in`.

**A skill reports `quota_exceeded`:** this is different from `auth_required` — you're signed in, but you've hit your plan's daily limit. The error message includes the reset time. See Account Plans (or your current pricing page) to raise the limit.

### Related pages

* [Installing the Plugin](https://docs.auroralabs.com/loci-plugin-for-ai-coding-assistants/loci-plugin/installing-the-loci-plugin.md)
* [Skills Reference](https://docs.auroralabs.com/loci-plugin-for-ai-coding-assistants/loci-plugin/skills-reference-for-loci-plugin.md)
* [Troubleshooting](https://docs.auroralabs.com/loci-plugin-for-ai-coding-assistants/loci-plugin/troubleshooting.md)
