You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: Update CLI documentation for auth login command
Add comprehensive documentation for the new `studio auth login` command
including usage instructions, flow description, and important notes about
token lifetime and authentication sharing between CLI and desktop app.
Co-authored-by: Fredrik Rombach Ekelund <undefined@users.noreply.github.com>
Copy file name to clipboardExpand all lines: docs/ai-instructions.md
+52Lines changed: 52 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,6 +39,56 @@ npm test -- path/to/test.test.ts
39
39
npm test -- --testNamePattern="test name pattern"
40
40
```
41
41
42
+
## CLI Commands
43
+
44
+
The Studio CLI provides commands for managing authentication, preview sites, and local sites (beta). All CLI commands follow this pattern:
45
+
46
+
```bash
47
+
npm run cli:build && node dist/cli/main.js <command>
48
+
```
49
+
50
+
### Authentication Commands
51
+
52
+
#### `studio auth login`
53
+
Log in to WordPress.com using OAuth2 authentication.
54
+
55
+
**Usage:**
56
+
```bash
57
+
node dist/cli/main.js auth login
58
+
```
59
+
60
+
**Description:**
61
+
This command initiates the WordPress.com OAuth2 authentication flow:
62
+
1. Opens your default browser to the WordPress.com authorization page
63
+
2. After authorization, you'll be redirected to a page with your access token
64
+
3. Copy the token and paste it back into the terminal
65
+
4. The token is stored in your app data and shared with the Studio desktop app
66
+
67
+
**Options:**
68
+
- None required
69
+
70
+
**Example:**
71
+
```bash
72
+
npm run cli:build
73
+
node dist/cli/main.js auth login
74
+
# Browser opens for authentication
75
+
# Copy token from browser and paste when prompted
76
+
```
77
+
78
+
**Notes:**
79
+
- The access token is valid for 2 weeks
80
+
- If already authenticated, the command will notify you
81
+
- Authentication is shared between the CLI and the Studio desktop app
82
+
- If the browser fails to open, the URL will be displayed for manual opening
83
+
84
+
### Preview Site Commands
85
+
86
+
See the existing preview site commands (create, list, delete, update) in `cli/commands/preview/`.
87
+
88
+
### Local Site Commands (Beta)
89
+
90
+
Local site management commands are available when the `studioSitesCli` beta feature is enabled in app data.
91
+
42
92
## WordPress Studio - Architecture Overview
43
93
44
94
WordPress Studio is a desktop application for creating, managing, and testing WordPress sites locally. It's built as an Electron desktop application with a React renderer, powered by WordPress Playground and PHP WASM.
@@ -109,11 +159,13 @@ WordPress Studio is a desktop application for creating, managing, and testing Wo
109
159
### `/cli` - Command-Line Interface
110
160
-**`index.ts`** - CLI entry point using yargs
111
161
-**`commands/`** - Command implementations
162
+
-`auth/` - Authentication commands (login to WordPress.com)
0 commit comments