Skip to content

Commit be579e9

Browse files
claudespicelukekim
authored andcommitted
docs: Document spice cloud login subcommands and OAuth2 client credentials
Add documentation for the restructured spice cloud login command including subscription (browser-based), pat (personal access token), and api (OAuth2 client credentials) authentication methods, along with environment variable support.
1 parent 9f261b6 commit be579e9

1 file changed

Lines changed: 59 additions & 0 deletions

File tree

website/docs/cli/reference/login.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,62 @@ spice login
4545
```shell
4646
spice login --key <API_KEY>
4747
```
48+
49+
## `spice cloud login`
50+
51+
Authenticate with the Spice Cloud Platform. Running `spice cloud login` without a subcommand opens an interactive method chooser when stdin is a TTY. Non-interactive callers must specify a method explicitly.
52+
53+
### Methods
54+
55+
#### `spice cloud login subscription`
56+
57+
Browser-based OAuth login flow. Automatically opens a browser for authentication.
58+
59+
```shell
60+
spice cloud login subscription
61+
```
62+
63+
Use `--device` to print the URL and one-time code without opening a browser (useful for SSH/headless environments):
64+
65+
```shell
66+
spice cloud login subscription --device
67+
```
68+
69+
#### `spice cloud login pat`
70+
71+
Authenticate with a personal access token.
72+
73+
```shell
74+
spice cloud login pat --token <TOKEN>
75+
```
76+
77+
The token can also be provided via the `SPICE_CLOUD_PAT` environment variable:
78+
79+
```shell
80+
export SPICE_CLOUD_PAT=<TOKEN>
81+
spice cloud login pat
82+
```
83+
84+
#### `spice cloud login api`
85+
86+
Authenticate using OAuth2 client credentials for CI/automation workflows.
87+
88+
```shell
89+
spice cloud login api --client-id <CLIENT_ID> --client-secret <CLIENT_SECRET>
90+
```
91+
92+
Credentials can also be provided via environment variables:
93+
94+
```shell
95+
export SPICE_CLOUD_CLIENT_ID=<CLIENT_ID>
96+
export SPICE_CLOUD_CLIENT_SECRET=<CLIENT_SECRET>
97+
spice cloud login api
98+
```
99+
100+
### Environment Variables
101+
102+
| Variable | Used by | Description |
103+
| --- | --- | --- |
104+
| `SPICE_CLOUD_PAT` | `login pat` | Personal access token |
105+
| `SPICE_CLOUD_CLIENT_ID` | `login api` | OAuth2 client ID |
106+
| `SPICE_CLOUD_CLIENT_SECRET` | `login api` | OAuth2 client secret |

0 commit comments

Comments
 (0)