magic-spells 0.1.0 → 0.2.0
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 +41 -17
- package/dist/{chunk-YT2Z756Z.js → chunk-JZ7XESF4.js} +733 -32
- package/dist/{chunk-S5IUP7G2.js → chunk-PQFOO5A7.js} +1 -1
- package/dist/main.js +618 -64
- package/dist/{operations-P3DUAVPP.js → operations-GGMLIYEW.js} +2 -2
- package/dist/src-DJYPPJFM.js +16 -0
- package/dist/src-KJGFPRQP.js +17 -0
- package/dist/{src-4S3XHPWY.js → src-L2I546M7.js} +7 -234
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,28 +6,48 @@
|
|
|
6
6
|
npx -y magic-spells --help # or: npm i -g magic-spells
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
## Sign in
|
|
9
|
+
## Sign in
|
|
10
10
|
|
|
11
11
|
```sh
|
|
12
|
-
magic login
|
|
13
|
-
|
|
14
|
-
magic whoami
|
|
15
|
-
magic logout
|
|
12
|
+
magic login # opens your browser; or prints a code when there is none
|
|
13
|
+
magic login --device # always use a code (SSH, containers, another device)
|
|
14
|
+
magic whoami # your account, and your workspaces and keys in each product
|
|
15
|
+
magic logout # revoke your keys and sign-in, forget everything stored
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
`magic login` signs in to your Magic Spells account, then mints a short-lived key (24 h)
|
|
19
|
+
in Pyramid, Sites and Marketing for every workspace you belong to. Expired keys are
|
|
20
|
+
re-minted for you while your sign-in lives (60 days, or 14 days unused); a product where
|
|
21
|
+
you have no workspace is skipped. With a local browser it uses a one-time callback on
|
|
22
|
+
`127.0.0.1` (PKCE); over SSH or on Linux without a display it uses a code you enter at
|
|
23
|
+
the verification page on any device. With several workspaces in a product, pick one per
|
|
24
|
+
command with `--workspace <handle>` (or set `defaultWorkspace` in
|
|
25
|
+
`~/.config/magic/config.json`). `magic login --product <p>` re-mints one product;
|
|
26
|
+
`magic logout --product <p>` forgets one.
|
|
27
|
+
|
|
28
|
+
Credentials live in the macOS Keychain (service `io.magicspells.cli`) or, elsewhere, a
|
|
29
|
+
mode-0600 file in `~/.config/magic/credentials.json`: `account:grant`, `account:sessions`
|
|
30
|
+
and one `<product>:<workspace>` item per key.
|
|
31
|
+
|
|
32
|
+
### Product keys (CI)
|
|
33
|
+
|
|
34
|
+
```sh
|
|
35
|
+
echo "$KEY" | magic login --product-key pyramid # or paste at the hidden prompt
|
|
36
|
+
export MAGIC_PYRAMID_KEY=pyramid_… # or just set the variable
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Keys are read from the prompt or stdin, never from arguments. A key in the environment
|
|
40
|
+
wins over a stored one; pasted keys are never re-minted.
|
|
22
41
|
|
|
23
42
|
## Commands
|
|
24
43
|
|
|
25
44
|
| Command | Does |
|
|
26
45
|
|---|---|
|
|
46
|
+
| `magic login [--device] [--product <p>] [--yes]` | sign in to your account and mint product keys |
|
|
27
47
|
| `magic login --product-key [<product>]` | store a product key (product detected from the key's prefix) |
|
|
28
|
-
| `magic logout [--product <p>]` | forget
|
|
29
|
-
| `magic whoami [--json]` | per product: key source (env,
|
|
30
|
-
| `magic doctor [--json]` | Node, credential store, and per product: API reachable, key present, product checks |
|
|
48
|
+
| `magic logout [--product <p>]` | revoke and forget credentials |
|
|
49
|
+
| `magic whoami [--json]` | your account (name, email, sign-in expiry) and per product: key source (env, account, manual, none), workspaces, default, masked keys |
|
|
50
|
+
| `magic doctor [--json]` | Node, credential store, Account and your sign-in, and per product: API reachable, key present, product checks |
|
|
31
51
|
| `magic mcp [--products a,b]` | the MCP server over stdio: every product's tools, prefixed (`pyramid_*`) |
|
|
32
52
|
| `magic pyramid <noun> <verb>` | Pyramid: `task next`, `task move WEB-42 --status "In Review"`, `task comment`, `project list`, `whoami`, … (`magic pyramid --help`) |
|
|
33
53
|
|
|
@@ -41,15 +61,19 @@ Output is JSON whenever stdout is not a terminal; errors go to stderr as
|
|
|
41
61
|
claude mcp add magic -- npx -y magic-spells mcp
|
|
42
62
|
```
|
|
43
63
|
|
|
44
|
-
|
|
45
|
-
key
|
|
64
|
+
It uses the keys `magic login` stored (and re-mints them when they expire). A product
|
|
65
|
+
without a key still lists its tools; their calls answer `not_logged_in` until a key is
|
|
66
|
+
stored, without restarting the server. With several workspaces in a product, set
|
|
67
|
+
`defaultWorkspace` in the config file so its tools know which one to use.
|
|
46
68
|
|
|
47
69
|
## Environment
|
|
48
70
|
|
|
49
71
|
| Variable | Meaning |
|
|
50
72
|
|---|---|
|
|
51
|
-
| `MAGIC_<PRODUCT>_KEY` | the product's key, e.g. `MAGIC_PYRAMID_KEY=pyramid_…`; never stored |
|
|
52
|
-
| `MAGIC_<PRODUCT>_URL` | the product's API base URL, e.g. `MAGIC_PYRAMID_URL` |
|
|
73
|
+
| `MAGIC_<PRODUCT>_KEY` | the product's key, e.g. `MAGIC_PYRAMID_KEY=pyramid_…`; never stored, wins over the sign-in |
|
|
74
|
+
| `MAGIC_<PRODUCT>_URL` | the product's API base URL, e.g. `MAGIC_PYRAMID_URL`, `MAGIC_SITES_URL`, `MAGIC_MARKETING_URL` |
|
|
75
|
+
| `MAGIC_ACCOUNT_URL` | the Account to sign in with, default `https://account.magicspells.io` |
|
|
76
|
+
| `MAGIC_ACCOUNT_CLIENT_ID` | the `magic` application's client id at that Account |
|
|
53
77
|
| `MAGIC_ALLOW_DESTRUCTIVE=1` | allow destructive operations (with `--yes`, or `yes: true` in MCP) |
|
|
54
78
|
| `MAGIC_CREDENTIALS_FILE=1` | store keys in the 0600 file instead of the OS keychain |
|
|
55
79
|
| `XDG_CONFIG_HOME` | where `magic/` (config and credentials file) lives |
|
|
@@ -58,7 +82,7 @@ key is stored, without restarting the server.
|
|
|
58
82
|
## Exit codes
|
|
59
83
|
|
|
60
84
|
Scripts branch on the exit code, or on `error.code` in the JSON envelope: 0 ok, 1 unknown,
|
|
61
|
-
2 usage, 3 not logged in or
|
|
85
|
+
2 usage, 3 not logged in, bad or expired key, or sign-in cancelled, 4 permission denied, 5 not found, 6 ambiguous name,
|
|
62
86
|
7 validation or conflict, 8 destructive action disabled, 9 rate limited, 10 network,
|
|
63
87
|
11 product unavailable. The table lives in
|
|
64
88
|
[`packages/kit/src/errors.ts`](https://github.com/magic-spells/cli/blob/main/packages/kit/src/errors.ts)
|