@fugood/bricks-cli 2.25.0-beta.74 → 2.25.0-beta.76
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +54 -26
- package/lib/1001.js +1 -0
- package/lib/1708.js +2 -2
- package/lib/1936.js +1 -1
- package/lib/1946.js +1 -0
- package/lib/2486.js +1 -1
- package/lib/{8026.js → 3593.js} +1 -1
- package/lib/4305.js +1 -1
- package/lib/6194.js +1 -1
- package/lib/6818.js +1 -1
- package/lib/7294.js +19 -0
- package/lib/7494.js +18 -0
- package/lib/7511.js +1 -1
- package/lib/8117.js +231 -231
- package/lib/8295.js +109 -0
- package/lib/907.js +14 -12
- package/lib/9215.js +1 -0
- package/lib/9387.js +6 -9
- package/lib/9583.js +3 -6
- package/lib/index.js +166 -98
- package/lib/lib.js +1077 -0
- package/package.json +5 -6
- package/lib/2209.js +0 -112
- package/lib/5785.js +0 -1
- package/lib/6370.js +0 -1
- package/lib/9940.js +0 -19
package/README.md
CHANGED
|
@@ -15,11 +15,15 @@ npm install -g @fugood/bricks-cli
|
|
|
15
15
|
## Quick Start
|
|
16
16
|
|
|
17
17
|
```bash
|
|
18
|
-
#
|
|
19
|
-
bricks auth login
|
|
18
|
+
# Sign in with your BRICKS account (opens the browser, recommended)
|
|
19
|
+
bricks auth login
|
|
20
20
|
|
|
21
|
-
#
|
|
22
|
-
bricks auth
|
|
21
|
+
# Select a workspace as the active profile
|
|
22
|
+
bricks auth use-workspace
|
|
23
|
+
|
|
24
|
+
# Workspace auth for CI/automation: one-time passcode or token
|
|
25
|
+
bricks auth login-workspace <passcode>
|
|
26
|
+
bricks auth login-workspace --token <your-workspace-token>
|
|
23
27
|
|
|
24
28
|
# Check connection status
|
|
25
29
|
bricks auth status
|
|
@@ -44,54 +48,78 @@ bricks media boxes
|
|
|
44
48
|
|
|
45
49
|
## Authentication Methods
|
|
46
50
|
|
|
47
|
-
### Method 1:
|
|
51
|
+
### Method 1: OAuth Sign-in (Recommended)
|
|
48
52
|
|
|
49
|
-
|
|
53
|
+
Sign in with your BRICKS account — the CLI opens your browser (Authorization
|
|
54
|
+
Code + PKCE against Auth0) and keeps the session refreshed automatically:
|
|
50
55
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
```bash
|
|
56
|
-
bricks auth login <passcode>
|
|
57
|
-
```
|
|
56
|
+
```bash
|
|
57
|
+
bricks auth login # opens the browser
|
|
58
|
+
bricks auth login --no-browser # device-code flow for SSH/headless terminals
|
|
59
|
+
```
|
|
58
60
|
|
|
59
|
-
|
|
61
|
+
Only one account can be signed in at a time; signing in again replaces the
|
|
62
|
+
identity (saved profiles are kept). After signing in, pick which workspaces to
|
|
63
|
+
work with — each becomes a profile:
|
|
60
64
|
|
|
61
|
-
|
|
65
|
+
```bash
|
|
66
|
+
bricks auth workspaces # list workspaces your account can access
|
|
67
|
+
bricks auth use-workspace # interactive picker (or pass an id/name)
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
OAuth profiles authorize by your role in the workspace — the same permissions
|
|
71
|
+
you have in the web controller. `bricks auth logout` revokes the session;
|
|
72
|
+
profiles remain and reactivate on the next login.
|
|
73
|
+
|
|
74
|
+
> Note: OAuth login requires the Auth0 native client to be configured in the
|
|
75
|
+
> build (or `BRICKS_OAUTH_CLIENT_ID`). Until then, use workspace auth below.
|
|
76
|
+
|
|
77
|
+
### Method 2: Workspace Auth (CI / automation)
|
|
62
78
|
|
|
63
|
-
|
|
79
|
+
Workspace tokens are scoped, self-contained credentials — ideal for CI:
|
|
64
80
|
|
|
65
81
|
1. Go to [BRICKS Controller](https://control.bricks.tools)
|
|
66
82
|
2. Navigate to Workspace Settings > API Token
|
|
67
|
-
3. Generate
|
|
68
|
-
4. Use
|
|
83
|
+
3. Click "Generate OTP" (valid 5 minutes, single use) or create a token
|
|
84
|
+
4. Use it in the CLI:
|
|
69
85
|
```bash
|
|
70
|
-
bricks auth login-
|
|
86
|
+
bricks auth login-workspace <passcode>
|
|
87
|
+
bricks auth login-workspace --token <your-workspace-token>
|
|
71
88
|
```
|
|
72
89
|
|
|
90
|
+
> `bricks auth login <passcode>` remains as a deprecated alias for
|
|
91
|
+
> `bricks auth login-workspace <passcode>`; `bricks auth login` without a
|
|
92
|
+
> passcode now performs the OAuth browser sign-in. `login-token` is also deprecated.
|
|
93
|
+
|
|
73
94
|
## Commands
|
|
74
95
|
|
|
75
96
|
### Authentication
|
|
76
97
|
|
|
77
98
|
```bash
|
|
78
|
-
#
|
|
79
|
-
bricks auth login
|
|
99
|
+
# Sign in with your BRICKS account (OAuth via browser)
|
|
100
|
+
bricks auth login [--no-browser]
|
|
101
|
+
|
|
102
|
+
# List workspaces / select one as the active profile
|
|
103
|
+
bricks auth workspaces [-j|--json]
|
|
104
|
+
bricks auth use-workspace [workspace] [-p profile-name]
|
|
80
105
|
|
|
81
|
-
#
|
|
82
|
-
bricks auth login-token
|
|
106
|
+
# Workspace auth (one-time passcode or token)
|
|
107
|
+
bricks auth login-workspace [passcode] [--token <token>] [-p profile-name]
|
|
83
108
|
|
|
84
109
|
# Check status
|
|
85
110
|
bricks auth status [-j|--json]
|
|
86
111
|
|
|
87
|
-
# List all profiles
|
|
112
|
+
# List all profiles (kind: oauth | token)
|
|
88
113
|
bricks auth list
|
|
89
114
|
|
|
90
115
|
# Switch profile
|
|
91
116
|
bricks auth use <profile-name>
|
|
92
117
|
|
|
93
|
-
#
|
|
94
|
-
bricks auth logout [
|
|
118
|
+
# Sign out of the OAuth session (profiles are kept; --all removes them too)
|
|
119
|
+
bricks auth logout [--all]
|
|
120
|
+
|
|
121
|
+
# Remove a saved profile
|
|
122
|
+
bricks auth remove <profile-name>
|
|
95
123
|
|
|
96
124
|
# Set custom API URL
|
|
97
125
|
bricks auth set-url <url>
|
package/lib/1001.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as e from"ink";import*as r from"react";import*as o from"react/jsx-runtime";export const __rspack_esm_id=1001;export const __rspack_esm_ids=[1001];export const __webpack_modules__={8498(r){r.exports=e},51649(e){e.exports=r},71178(e){e.exports=o},52928(e,r,o){o.r(r),o.d(r,{WorkspacePicker:()=>l,applyWorkspaceSearchInput:()=>i,filterWorkspaces:()=>a});var t=o(68832),s=o(51649),c=o(8498),n=o(71178),a=(e,r)=>{var o=r.trim().toLowerCase();return o?e.filter(e=>[e.name,e._id].some(e=>String(e||"").toLowerCase().includes(o))):e},i=(e,r,o={})=>o.backspace||o.delete?e.slice(0,-1):!r||o.ctrl||o.meta?e:e+r,l=({workspaces:e,onSelect:r,onCancel:o})=>{var l=t((0,s.useState)(""),2),x=l[0],d=l[1],p=t((0,s.useState)(0),2),m=p[0],h=p[1],u=(0,s.useMemo)(()=>a(e,x),[e,x]);(0,c.useInput)((e,t)=>{if(t.escape)return void o();if(t.upArrow||t.downArrow){if(0===u.length)return;var s=t.upArrow?-1:1;h(e=>(e+s+u.length)%u.length);return}if(t.return){var c=u[m];c&&r(c);return}var n=i(x,e,t);n!==x&&(d(n),h(0))});var j=Math.min(Math.max(m-Math.floor(5),0),Math.max(u.length-10,0)),_=u.slice(j,j+10);return(0,n.jsxs)(c.Box,{flexDirection:"column",children:[(0,n.jsx)(c.Text,{bold:!0,children:"Select a workspace"}),(0,n.jsxs)(c.Box,{marginTop:1,children:[(0,n.jsx)(c.Text,{children:"Search: "}),x?(0,n.jsx)(c.Text,{color:"cyan",children:x}):(0,n.jsx)(c.Text,{dimColor:!0,children:"Name or workspace ID"}),(0,n.jsx)(c.Text,{inverse:!0,children:" "})]}),(0,n.jsx)(c.Box,{marginTop:1,flexDirection:"column",children:_.length>0?_.map((e,r)=>{var o=j+r===m;return(0,n.jsxs)(c.Box,{children:[(0,n.jsx)(c.Text,{color:o?"cyan":void 0,children:o?"❯ ":" "}),(0,n.jsx)(c.Text,{color:o?"cyan":void 0,children:e.name}),(0,n.jsxs)(c.Text,{dimColor:!0,children:[" ",e._id]})]},e._id)}):(0,n.jsx)(c.Text,{color:"yellow",children:"No matching workspaces"})}),(0,n.jsx)(c.Box,{marginTop:1,children:(0,n.jsx)(c.Text,{dimColor:!0,children:"Type anywhere to search \xb7 ↑/↓ navigate \xb7 Enter select \xb7 Esc cancel"})})]})}}};
|