# swarmops auth logout

> Release: 0.13.0 · Last changed: 2026-11-17 · Source: https://github.com/KeiaiLab/SwarmOps/blob/stable/docs/reference/commands/auth-logout.md

Remove a provider's login from your login file.

The token is forgotten here and not revoked at the provider: revoke it there if it may have leaked. Removing a login the file does not hold succeeds (removed is false).

```yaml
title: "swarmops auth logout"
description: "Remove a provider's login from your login file."
group: "auth"
since: "0.12.0"
mutates: false
identity_required: false
mcp_tool: ""
envelope_op: "auth_logout"
exit_codes: [0, 2]
errors: [E_INVALID_ARG]
syntax: "swarmops auth logout [OPTIONS] <--gh>"
```

## Syntax

```text
swarmops auth logout [OPTIONS] <--gh>
```

## Required arguments

Exactly one of `--gh` is required.

### `--gh`

Syntax: `--gh`.

Log out of GitHub (github.com).

## Optional arguments

The command also takes the [global options](../cli.md#global-options).

## Examples

### CLI

```sh
SWARMOPS_AUTH_FILE=[tmp]/state/swarmops/auth.toml swarmops auth logout --gh
```

```json
{
  "ok": true,
  "op": "auth_logout",
  "api": 1,
  "result": {
    "provider": "gh",
    "host": "github.com",
    "removed": true,
    "file": "[tmp]/state/swarmops/auth.toml"
  },
  "meta": {
    "elapsed_ms": "[elapsed_ms]",
    "resolved": {},
    "auth": "trust"
  }
}
```

Exit code 0. Recorded by the CLI tests. A name in square brackets, such as `[tmp]` or `[c1]`, stands for what differs from run to run: the test's temporary directory, an id, a time.

## Return information

`result` is a `AuthLogout` (`swarmops schema AuthLogout` prints its JSON Schema).

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `file` | `string or null` | no | The login file, a path on the caller's host. Omitted on a host that names no directory for it. |
| `host` | `string` | yes | The host the login was for. |
| `provider` | `string` | yes | The provider logged out of. |
| `removed` | `boolean` | yes | Whether the file held the login; false when there was none to remove. |

Envelope `op`: `auth_logout`.

Exit codes:

- `0`: Success.
- `2`: The request or the command line is malformed.

## Errors

- [`E_INVALID_ARG`](../errors.md#e_invalid_arg) (exit 2): A malformed argument or request, including a command-line usage error.

Any command that opens a store may also fail with a store error, such as [`E_NOT_A_REPO`](../errors.md#e_not_a_repo), [`E_IO`](../errors.md#e_io) or [`E_STORE_CORRUPT`](../errors.md#e_store_corrupt); a command line the grammar refuses is [`E_INVALID_ARG`](../errors.md#e_invalid_arg) (exit 2).

## See also

- [`swarmops auth login`](auth-login.md)
- [`swarmops auth status`](auth-status.md)
- [`swarmops auth git-credential`](auth-git-credential.md)
- [CLI reference](../cli.md)
- [Error codes](../errors.md)
