@greatstore/cli 0.0.2 → 0.0.3
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 +9 -64
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -11,85 +11,30 @@ gs push
|
|
|
11
11
|
gs publish my-widget
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
-
> **Status — MVP.** Authentication today targets a nav-side OAuth bounce
|
|
15
|
-
> at `nav.maker.co/connect_oauth_done` and a short-lived JWT stored at
|
|
16
|
-
> `~/.greatstore/credentials.json`. Bearer acceptance on the worker is a
|
|
17
|
-
> separate planned change (see
|
|
18
|
-
> `tasks/backburner/builder-cli-bearer-auth.md` in the main repo); until
|
|
19
|
-
> that lands, push/publish/list etc. will 401 against the live API.
|
|
20
|
-
|
|
21
14
|
## Commands
|
|
22
15
|
|
|
23
16
|
| Command | What it does |
|
|
24
17
|
| --------------------------------------------- | ------------------------------------------------------------- |
|
|
25
|
-
| `gs login
|
|
26
|
-
| `gs logout` |
|
|
27
|
-
| `gs whoami` | Print the identity
|
|
18
|
+
| `gs login` | Sign in. |
|
|
19
|
+
| `gs logout` | Sign out. |
|
|
20
|
+
| `gs whoami` | Print the identity you're signed in as. |
|
|
28
21
|
| `gs init <name> [--out <dir>] [--store <s>]` | Scaffold a working component project. |
|
|
29
|
-
| `gs list [--json]` | List
|
|
22
|
+
| `gs list [--json]` | List components in the current store. |
|
|
30
23
|
| `gs pull <name> [--draft\|--live\|--version N] [-o <dir>]` | Download manifest + bundle to disk. |
|
|
31
24
|
| `gs push [<name>] [--manifest path] [--bundle path]` | Upload a new draft revision. |
|
|
32
|
-
| `gs publish <name> [--version N]` | Promote a draft (or
|
|
33
|
-
| `gs unpublish <name>` | Clear the live pointer;
|
|
34
|
-
| `gs delete <name> [--yes]` |
|
|
25
|
+
| `gs publish <name> [--version N]` | Promote a draft (or roll back to a historical version) to live.|
|
|
26
|
+
| `gs unpublish <name>` | Clear the live pointer; draft + history stay. |
|
|
27
|
+
| `gs delete <name> [--yes]` | Remove the component. |
|
|
35
28
|
|
|
36
29
|
## Store selection
|
|
37
30
|
|
|
38
31
|
Every command except `login`, `logout`, and `whoami` needs a store. The
|
|
39
|
-
CLI
|
|
32
|
+
CLI picks one in this order:
|
|
40
33
|
|
|
41
34
|
1. `--store <slug>` flag.
|
|
42
35
|
2. `.gsrc` in the current directory or any ancestor: `{"store":"demo"}`.
|
|
43
36
|
3. `GS_STORE` environment variable.
|
|
44
37
|
4. Error.
|
|
45
38
|
|
|
46
|
-
`gs init` writes a `.gsrc` for you so commands inside a scaffolded
|
|
39
|
+
`gs init` writes a `.gsrc` for you, so commands inside a scaffolded
|
|
47
40
|
project don't need a flag.
|
|
48
|
-
|
|
49
|
-
## Environment
|
|
50
|
-
|
|
51
|
-
- `GS_API_BASE` — override the API base URL (default
|
|
52
|
-
`https://<slug>.greatstore.ai`). Used for local dev:
|
|
53
|
-
`GS_API_BASE=http://demo.localhost:8787`.
|
|
54
|
-
- `GS_NAV_BASE` — override the nav OAuth base (default
|
|
55
|
-
`https://nav.maker.co`). Used for testing against a non-prod Clerk
|
|
56
|
-
tenant.
|
|
57
|
-
- `GS_BROWSER_CMD` — override the command used to open the browser
|
|
58
|
-
during `gs login`. Defaults to `open` on macOS, `xdg-open` on Linux,
|
|
59
|
-
`start` on Windows.
|
|
60
|
-
|
|
61
|
-
## Credentials storage
|
|
62
|
-
|
|
63
|
-
`~/.greatstore/credentials.json` is created with mode `0700` on its
|
|
64
|
-
directory and `0600` on the file. The CLI verifies this on every read
|
|
65
|
-
and refuses to use a file with broader permissions.
|
|
66
|
-
|
|
67
|
-
The credentials file holds a single short-lived JWT plus its decoded
|
|
68
|
-
identity claims. There is no refresh token; when the JWT expires, the
|
|
69
|
-
next command prompts for re-auth and re-runs the browser flow.
|
|
70
|
-
|
|
71
|
-
## Development
|
|
72
|
-
|
|
73
|
-
```
|
|
74
|
-
cd cli
|
|
75
|
-
npm install
|
|
76
|
-
npm run typecheck
|
|
77
|
-
npm test
|
|
78
|
-
npm run build
|
|
79
|
-
node dist/cli.js --help
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
To exercise against local `wrangler dev`, point at the tenant host:
|
|
83
|
-
|
|
84
|
-
```
|
|
85
|
-
GS_API_BASE=http://demo.localhost:8787 \
|
|
86
|
-
GS_NAV_BASE=https://nav.maker.co \
|
|
87
|
-
node dist/cli.js list --store demo
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
## Release flow
|
|
91
|
-
|
|
92
|
-
1. Bump `cli/package.json` version.
|
|
93
|
-
2. Tag: `git tag cli-v0.0.2 && git push origin cli-v0.0.2`.
|
|
94
|
-
3. `cli-publish` GitHub Actions workflow runs typecheck + test + build,
|
|
95
|
-
then `npm publish --access public` with `NPM_TOKEN`.
|