magic-builder 0.1.1 → 0.1.2
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 +139 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
# magic-builder
|
|
2
|
+
|
|
3
|
+
CLI for Magic Builder (妙笔): publish HTML pages, deploy FaaS functions, upload assets, generate links, and install the Magic Builder Codex skill.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g magic-builder
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
With Bun:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
bun add -g magic-builder
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
The package provides three equivalent command names:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
magic-builder --help
|
|
21
|
+
magic-cli --help
|
|
22
|
+
miaobi --help
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
You can also run it without installing:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npx magic-builder help
|
|
29
|
+
bunx magic-builder help
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Authentication
|
|
33
|
+
|
|
34
|
+
Most write operations need a Magic developer token.
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
magic-builder auth login
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Manual token setup:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
magic-builder auth set <token>
|
|
44
|
+
magic-builder auth show
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Token lookup order:
|
|
48
|
+
|
|
49
|
+
1. `--token`
|
|
50
|
+
2. `MAGIC_TOKEN`
|
|
51
|
+
3. `~/.magic-token`
|
|
52
|
+
4. project `.magic-token`
|
|
53
|
+
|
|
54
|
+
## Common Commands
|
|
55
|
+
|
|
56
|
+
Publish an HTML page:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
magic-builder page publish app.html --title "Dashboard"
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
List or export pages:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
magic-builder page list --scope mine
|
|
66
|
+
magic-builder page list --scope public --title demo
|
|
67
|
+
magic-builder page export --id <id> --out app.html
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Deploy a FaaS function:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
magic-builder faas publish handler.js --name report-api
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Upload an asset:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
magic-builder asset upload logo.png
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Generate a Magic link:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
magic-builder link create --title "Weekly Report"
|
|
86
|
+
magic-builder link create --fid <faas-id>
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Create or append a Feishu document HTML Box:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
magic-builder doc create --html app.html --title "Demo"
|
|
93
|
+
magic-builder doc append --html app.html --doc-token <docx-token>
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Install or update the Magic Builder Codex skill:
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
magic-builder skill install
|
|
100
|
+
magic-builder skill check-update
|
|
101
|
+
magic-builder skill update
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Check local environment:
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
magic-builder doctor
|
|
108
|
+
magic-builder config get
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## Help
|
|
112
|
+
|
|
113
|
+
All of these forms are supported:
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
magic-builder help
|
|
117
|
+
magic-builder help page
|
|
118
|
+
magic-builder page help
|
|
119
|
+
magic-builder page publish help
|
|
120
|
+
magic-builder man
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
`--help`, `-h`, and `--man` are also supported.
|
|
124
|
+
|
|
125
|
+
## Global Options
|
|
126
|
+
|
|
127
|
+
```text
|
|
128
|
+
--base-url, --magic-base-url <url> Magic service base URL
|
|
129
|
+
--token <token> Auth token override
|
|
130
|
+
--format json|table|plain Output format, default json
|
|
131
|
+
--quiet, -q Suppress progress messages
|
|
132
|
+
--version, -v Show version
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Default Magic service:
|
|
136
|
+
|
|
137
|
+
```text
|
|
138
|
+
https://magic.solutionsuite.cn
|
|
139
|
+
```
|