goosehost-cli 0.1.2__tar.gz → 0.1.4__tar.gz
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.
- goosehost_cli-0.1.4/PKG-INFO +242 -0
- goosehost_cli-0.1.4/README.md +232 -0
- goosehost_cli-0.1.4/goosehost_cli.egg-info/PKG-INFO +242 -0
- {goosehost_cli-0.1.2 → goosehost_cli-0.1.4}/goosehost_cli.egg-info/SOURCES.txt +1 -0
- {goosehost_cli-0.1.2 → goosehost_cli-0.1.4}/goosehost_cli.py +10 -7
- {goosehost_cli-0.1.2 → goosehost_cli-0.1.4}/pyproject.toml +2 -2
- goosehost_cli-0.1.2/PKG-INFO +0 -9
- goosehost_cli-0.1.2/goosehost_cli.egg-info/PKG-INFO +0 -9
- {goosehost_cli-0.1.2 → goosehost_cli-0.1.4}/goosehost_cli.egg-info/dependency_links.txt +0 -0
- {goosehost_cli-0.1.2 → goosehost_cli-0.1.4}/goosehost_cli.egg-info/entry_points.txt +0 -0
- {goosehost_cli-0.1.2 → goosehost_cli-0.1.4}/goosehost_cli.egg-info/requires.txt +0 -0
- {goosehost_cli-0.1.2 → goosehost_cli-0.1.4}/goosehost_cli.egg-info/top_level.txt +0 -0
- {goosehost_cli-0.1.2 → goosehost_cli-0.1.4}/setup.cfg +0 -0
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: goosehost-cli
|
|
3
|
+
Version: 0.1.4
|
|
4
|
+
Summary: GooseHost-静态网站托管
|
|
5
|
+
Author-email: Minecraft_goose <support@goose2.cc.cd>
|
|
6
|
+
License: MIT
|
|
7
|
+
Requires-Python: >=3.7
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
Requires-Dist: requests>=2.25
|
|
10
|
+
|
|
11
|
+
# GooseHost CLI
|
|
12
|
+
|
|
13
|
+
在终端里管理 GooseHost 的静态网站,不需要开浏览器。
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## 安装
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
pip install goosehost-cli
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
安装后,在终端输入 `goosehost` 就可以用了。
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## 快速开始
|
|
28
|
+
|
|
29
|
+
### 1. 登录(只做一次)
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
goosehost login --email 你的邮箱 --password 你的密码
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
登录后凭证保存在本地,下次不用再输入。
|
|
36
|
+
|
|
37
|
+
### 2. 部署一个 HTML 文件
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
goosehost deploy ./index.html
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
`./index.html` 表示当前目录下的 `index.html` 文件。
|
|
44
|
+
工具会自动用文件名作为网站名称,并在终端显示访问地址。
|
|
45
|
+
|
|
46
|
+
### 3. 查看所有网站
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
goosehost list
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## 完整命令列表
|
|
55
|
+
|
|
56
|
+
### 登录与账号
|
|
57
|
+
|
|
58
|
+
| 命令 | 说明 |
|
|
59
|
+
|------|------|
|
|
60
|
+
| `goosehost login --email xxx --password xxx` | 登录并保存凭证 |
|
|
61
|
+
| `goosehost logout` | 退出登录(清除本地凭证) |
|
|
62
|
+
| `goosehost register --email xxx --password xxx` | 注册新账号 |
|
|
63
|
+
|
|
64
|
+
### 网站管理
|
|
65
|
+
|
|
66
|
+
| 命令 | 说明 |
|
|
67
|
+
|------|------|
|
|
68
|
+
| `goosehost list` | 列出你的所有网站 |
|
|
69
|
+
| `goosehost create --slug 名称 --type html --file 文件路径` | 从文件创建网站 |
|
|
70
|
+
| `goosehost create --slug 名称 --type html --content "<h1>Hi</h1>"` | 直接从文字创建网站 |
|
|
71
|
+
| `goosehost get --slug 网站名称` | 查看html内容 |
|
|
72
|
+
| `goosehost get --slug md/markdown网站名称` | 查看markdown内容 |
|
|
73
|
+
| `goosehost get --slug 网站名称 --output 保存路径` | 下载html内容到本地文件 |
|
|
74
|
+
| `goosehost get --slug md/网站名称 --output 保存路径` | 下载markdown内容到本地文件 |
|
|
75
|
+
| `goosehost update --slug 网站名称 --file 文件路径` | 用本地html文件更新 |
|
|
76
|
+
| `goosehost update --slug md/网站名称 --file 文件路径` | 用本地markdown文件更新 |
|
|
77
|
+
| `goosehost update --slug 网站名称 --content "新内容"` | 直接更新内容(markdown站点需加md/前缀,不建议使用此命令) |
|
|
78
|
+
| `goosehost delete --slug 网站名称 --force` | 删除html网站(需要加 `--force`) |
|
|
79
|
+
| `goosehost delete --slug md/网站名称 --force` | 删除markdown网站(需要加 `--force`) |
|
|
80
|
+
|
|
81
|
+
### 快捷部署
|
|
82
|
+
|
|
83
|
+
| 命令 | 说明 |
|
|
84
|
+
|------|------|
|
|
85
|
+
| `goosehost deploy ./文件.html` | 部署 HTML 文件(自动起名) |
|
|
86
|
+
| `goosehost deploy ./文件.md` | 部署 Markdown 文件(自动起名) |
|
|
87
|
+
| `goosehost deploy ./文件.html --slug 自定义名称` | 部署并指定网站名称 |
|
|
88
|
+
|
|
89
|
+
### 其他
|
|
90
|
+
|
|
91
|
+
| 命令 | 说明 |
|
|
92
|
+
|------|------|
|
|
93
|
+
| `goosehost config` | 查看当前登录状态和配置 |
|
|
94
|
+
| `goosehost --help` | 查看所有命令的帮助 |
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## 文件路径怎么写
|
|
99
|
+
|
|
100
|
+
在命令中,所有 `--file` 和 `--output` 后面的路径都支持两种写法:
|
|
101
|
+
|
|
102
|
+
- **相对路径**:相对于当前终端所在的目录
|
|
103
|
+
例如:`./index.html`、`backup.html`、`../my-site/index.html`
|
|
104
|
+
|
|
105
|
+
- **绝对路径**:从磁盘根目录开始的完整路径
|
|
106
|
+
例如:`D:/my-site/index.html`、`C:\Users\Administrator\backup.html`
|
|
107
|
+
|
|
108
|
+
如果不确定当前终端在哪个目录,可以输入:
|
|
109
|
+
|
|
110
|
+
- Windows:`cd`
|
|
111
|
+
- Mac/Linux:`pwd`
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## 常用操作示例
|
|
116
|
+
|
|
117
|
+
### 部署当前文件夹里的首页
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
goosehost deploy ./index.html
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
输出示例:
|
|
124
|
+
|
|
125
|
+
```text
|
|
126
|
+
部署成功!
|
|
127
|
+
访问地址: https://page.goose.cc.cd/s/my-site
|
|
128
|
+
网站名称: my-site
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### 直接用文字创建一个 Markdown 网站
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
goosehost create --slug my-doc --type md --content "# 我的文档\n\n这是内容"
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### 把线上网站下载到本地修改
|
|
138
|
+
|
|
139
|
+
**第一步:下载到当前目录**
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
goosehost get --slug my-site --output backup.html
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
下载后,当前目录会多出一个 `backup.html` 文件。
|
|
146
|
+
如果你想保存到其他文件夹,可以写完整路径:
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
goosehost get --slug my-site --output D:/my-backup/index.html
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
**第二步:用编辑器修改 `backup.html`**
|
|
153
|
+
|
|
154
|
+
**第三步:传回去**
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
goosehost update --slug my-site --file backup.html
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
如果文件在其他路径,就填完整路径:
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
goosehost update --slug my-site --file D:/my-backup/index.html
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### 查看网站内容(不保存,只显示)
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
goosehost get --slug my-site
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
终端会直接打印出网站的全部代码。
|
|
173
|
+
|
|
174
|
+
### 删除一个网站
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
goosehost delete --slug my-site --force
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
## 卸载
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
pip uninstall goosehost-cli
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
## 常见问题
|
|
191
|
+
|
|
192
|
+
### 登录后每次都要重新登录吗?
|
|
193
|
+
|
|
194
|
+
不用。凭证保存在本地,下次打开终端会自动生效。
|
|
195
|
+
|
|
196
|
+
### 安装后输入 `goosehost` 提示找不到命令?
|
|
197
|
+
|
|
198
|
+
重启终端。如果还不行,检查 Python 的 Scripts 目录是否在系统 PATH 里。
|
|
199
|
+
|
|
200
|
+
### 部署后访问地址不对(显示 goose.cc.cd 而不是 page.goose.cc.cd)?
|
|
201
|
+
|
|
202
|
+
确保你安装的是最新版本(>= 0.1.3),升级命令:
|
|
203
|
+
|
|
204
|
+
```bash
|
|
205
|
+
pip install --upgrade goosehost-cli
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
### 用 `pip install goosehost-cli` 安装的不是最新版?
|
|
209
|
+
|
|
210
|
+
国内镜像可能有延迟,临时从官方源安装:
|
|
211
|
+
|
|
212
|
+
```bash
|
|
213
|
+
pip install -i https://pypi.org/simple goosehost-cli
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
### `--output` 不填会怎样?
|
|
217
|
+
|
|
218
|
+
内容会直接打印在终端,不会保存成文件。
|
|
219
|
+
|
|
220
|
+
### 为什么删除网站必须加 `--force`?
|
|
221
|
+
|
|
222
|
+
防止手滑误删。确认你真的要删,再加 `--force`。
|
|
223
|
+
|
|
224
|
+
---
|
|
225
|
+
|
|
226
|
+
## 更多帮助
|
|
227
|
+
|
|
228
|
+
查看所有命令:
|
|
229
|
+
|
|
230
|
+
```bash
|
|
231
|
+
goosehost --help
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
查看某个命令的详细用法,例如:
|
|
235
|
+
|
|
236
|
+
```bash
|
|
237
|
+
goosehost create --help
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
**Enjoy your static sites! 🚀**
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
# GooseHost CLI
|
|
2
|
+
|
|
3
|
+
在终端里管理 GooseHost 的静态网站,不需要开浏览器。
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 安装
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pip install goosehost-cli
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
安装后,在终端输入 `goosehost` 就可以用了。
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## 快速开始
|
|
18
|
+
|
|
19
|
+
### 1. 登录(只做一次)
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
goosehost login --email 你的邮箱 --password 你的密码
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
登录后凭证保存在本地,下次不用再输入。
|
|
26
|
+
|
|
27
|
+
### 2. 部署一个 HTML 文件
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
goosehost deploy ./index.html
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
`./index.html` 表示当前目录下的 `index.html` 文件。
|
|
34
|
+
工具会自动用文件名作为网站名称,并在终端显示访问地址。
|
|
35
|
+
|
|
36
|
+
### 3. 查看所有网站
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
goosehost list
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## 完整命令列表
|
|
45
|
+
|
|
46
|
+
### 登录与账号
|
|
47
|
+
|
|
48
|
+
| 命令 | 说明 |
|
|
49
|
+
|------|------|
|
|
50
|
+
| `goosehost login --email xxx --password xxx` | 登录并保存凭证 |
|
|
51
|
+
| `goosehost logout` | 退出登录(清除本地凭证) |
|
|
52
|
+
| `goosehost register --email xxx --password xxx` | 注册新账号 |
|
|
53
|
+
|
|
54
|
+
### 网站管理
|
|
55
|
+
|
|
56
|
+
| 命令 | 说明 |
|
|
57
|
+
|------|------|
|
|
58
|
+
| `goosehost list` | 列出你的所有网站 |
|
|
59
|
+
| `goosehost create --slug 名称 --type html --file 文件路径` | 从文件创建网站 |
|
|
60
|
+
| `goosehost create --slug 名称 --type html --content "<h1>Hi</h1>"` | 直接从文字创建网站 |
|
|
61
|
+
| `goosehost get --slug 网站名称` | 查看html内容 |
|
|
62
|
+
| `goosehost get --slug md/markdown网站名称` | 查看markdown内容 |
|
|
63
|
+
| `goosehost get --slug 网站名称 --output 保存路径` | 下载html内容到本地文件 |
|
|
64
|
+
| `goosehost get --slug md/网站名称 --output 保存路径` | 下载markdown内容到本地文件 |
|
|
65
|
+
| `goosehost update --slug 网站名称 --file 文件路径` | 用本地html文件更新 |
|
|
66
|
+
| `goosehost update --slug md/网站名称 --file 文件路径` | 用本地markdown文件更新 |
|
|
67
|
+
| `goosehost update --slug 网站名称 --content "新内容"` | 直接更新内容(markdown站点需加md/前缀,不建议使用此命令) |
|
|
68
|
+
| `goosehost delete --slug 网站名称 --force` | 删除html网站(需要加 `--force`) |
|
|
69
|
+
| `goosehost delete --slug md/网站名称 --force` | 删除markdown网站(需要加 `--force`) |
|
|
70
|
+
|
|
71
|
+
### 快捷部署
|
|
72
|
+
|
|
73
|
+
| 命令 | 说明 |
|
|
74
|
+
|------|------|
|
|
75
|
+
| `goosehost deploy ./文件.html` | 部署 HTML 文件(自动起名) |
|
|
76
|
+
| `goosehost deploy ./文件.md` | 部署 Markdown 文件(自动起名) |
|
|
77
|
+
| `goosehost deploy ./文件.html --slug 自定义名称` | 部署并指定网站名称 |
|
|
78
|
+
|
|
79
|
+
### 其他
|
|
80
|
+
|
|
81
|
+
| 命令 | 说明 |
|
|
82
|
+
|------|------|
|
|
83
|
+
| `goosehost config` | 查看当前登录状态和配置 |
|
|
84
|
+
| `goosehost --help` | 查看所有命令的帮助 |
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## 文件路径怎么写
|
|
89
|
+
|
|
90
|
+
在命令中,所有 `--file` 和 `--output` 后面的路径都支持两种写法:
|
|
91
|
+
|
|
92
|
+
- **相对路径**:相对于当前终端所在的目录
|
|
93
|
+
例如:`./index.html`、`backup.html`、`../my-site/index.html`
|
|
94
|
+
|
|
95
|
+
- **绝对路径**:从磁盘根目录开始的完整路径
|
|
96
|
+
例如:`D:/my-site/index.html`、`C:\Users\Administrator\backup.html`
|
|
97
|
+
|
|
98
|
+
如果不确定当前终端在哪个目录,可以输入:
|
|
99
|
+
|
|
100
|
+
- Windows:`cd`
|
|
101
|
+
- Mac/Linux:`pwd`
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## 常用操作示例
|
|
106
|
+
|
|
107
|
+
### 部署当前文件夹里的首页
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
goosehost deploy ./index.html
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
输出示例:
|
|
114
|
+
|
|
115
|
+
```text
|
|
116
|
+
部署成功!
|
|
117
|
+
访问地址: https://page.goose.cc.cd/s/my-site
|
|
118
|
+
网站名称: my-site
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### 直接用文字创建一个 Markdown 网站
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
goosehost create --slug my-doc --type md --content "# 我的文档\n\n这是内容"
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### 把线上网站下载到本地修改
|
|
128
|
+
|
|
129
|
+
**第一步:下载到当前目录**
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
goosehost get --slug my-site --output backup.html
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
下载后,当前目录会多出一个 `backup.html` 文件。
|
|
136
|
+
如果你想保存到其他文件夹,可以写完整路径:
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
goosehost get --slug my-site --output D:/my-backup/index.html
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
**第二步:用编辑器修改 `backup.html`**
|
|
143
|
+
|
|
144
|
+
**第三步:传回去**
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
goosehost update --slug my-site --file backup.html
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
如果文件在其他路径,就填完整路径:
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
goosehost update --slug my-site --file D:/my-backup/index.html
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
### 查看网站内容(不保存,只显示)
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
goosehost get --slug my-site
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
终端会直接打印出网站的全部代码。
|
|
163
|
+
|
|
164
|
+
### 删除一个网站
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
goosehost delete --slug my-site --force
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
## 卸载
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
pip uninstall goosehost-cli
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
## 常见问题
|
|
181
|
+
|
|
182
|
+
### 登录后每次都要重新登录吗?
|
|
183
|
+
|
|
184
|
+
不用。凭证保存在本地,下次打开终端会自动生效。
|
|
185
|
+
|
|
186
|
+
### 安装后输入 `goosehost` 提示找不到命令?
|
|
187
|
+
|
|
188
|
+
重启终端。如果还不行,检查 Python 的 Scripts 目录是否在系统 PATH 里。
|
|
189
|
+
|
|
190
|
+
### 部署后访问地址不对(显示 goose.cc.cd 而不是 page.goose.cc.cd)?
|
|
191
|
+
|
|
192
|
+
确保你安装的是最新版本(>= 0.1.3),升级命令:
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
pip install --upgrade goosehost-cli
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### 用 `pip install goosehost-cli` 安装的不是最新版?
|
|
199
|
+
|
|
200
|
+
国内镜像可能有延迟,临时从官方源安装:
|
|
201
|
+
|
|
202
|
+
```bash
|
|
203
|
+
pip install -i https://pypi.org/simple goosehost-cli
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
### `--output` 不填会怎样?
|
|
207
|
+
|
|
208
|
+
内容会直接打印在终端,不会保存成文件。
|
|
209
|
+
|
|
210
|
+
### 为什么删除网站必须加 `--force`?
|
|
211
|
+
|
|
212
|
+
防止手滑误删。确认你真的要删,再加 `--force`。
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
## 更多帮助
|
|
217
|
+
|
|
218
|
+
查看所有命令:
|
|
219
|
+
|
|
220
|
+
```bash
|
|
221
|
+
goosehost --help
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
查看某个命令的详细用法,例如:
|
|
225
|
+
|
|
226
|
+
```bash
|
|
227
|
+
goosehost create --help
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
---
|
|
231
|
+
|
|
232
|
+
**Enjoy your static sites! 🚀**
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: goosehost-cli
|
|
3
|
+
Version: 0.1.4
|
|
4
|
+
Summary: GooseHost-静态网站托管
|
|
5
|
+
Author-email: Minecraft_goose <support@goose2.cc.cd>
|
|
6
|
+
License: MIT
|
|
7
|
+
Requires-Python: >=3.7
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
Requires-Dist: requests>=2.25
|
|
10
|
+
|
|
11
|
+
# GooseHost CLI
|
|
12
|
+
|
|
13
|
+
在终端里管理 GooseHost 的静态网站,不需要开浏览器。
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## 安装
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
pip install goosehost-cli
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
安装后,在终端输入 `goosehost` 就可以用了。
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## 快速开始
|
|
28
|
+
|
|
29
|
+
### 1. 登录(只做一次)
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
goosehost login --email 你的邮箱 --password 你的密码
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
登录后凭证保存在本地,下次不用再输入。
|
|
36
|
+
|
|
37
|
+
### 2. 部署一个 HTML 文件
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
goosehost deploy ./index.html
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
`./index.html` 表示当前目录下的 `index.html` 文件。
|
|
44
|
+
工具会自动用文件名作为网站名称,并在终端显示访问地址。
|
|
45
|
+
|
|
46
|
+
### 3. 查看所有网站
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
goosehost list
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## 完整命令列表
|
|
55
|
+
|
|
56
|
+
### 登录与账号
|
|
57
|
+
|
|
58
|
+
| 命令 | 说明 |
|
|
59
|
+
|------|------|
|
|
60
|
+
| `goosehost login --email xxx --password xxx` | 登录并保存凭证 |
|
|
61
|
+
| `goosehost logout` | 退出登录(清除本地凭证) |
|
|
62
|
+
| `goosehost register --email xxx --password xxx` | 注册新账号 |
|
|
63
|
+
|
|
64
|
+
### 网站管理
|
|
65
|
+
|
|
66
|
+
| 命令 | 说明 |
|
|
67
|
+
|------|------|
|
|
68
|
+
| `goosehost list` | 列出你的所有网站 |
|
|
69
|
+
| `goosehost create --slug 名称 --type html --file 文件路径` | 从文件创建网站 |
|
|
70
|
+
| `goosehost create --slug 名称 --type html --content "<h1>Hi</h1>"` | 直接从文字创建网站 |
|
|
71
|
+
| `goosehost get --slug 网站名称` | 查看html内容 |
|
|
72
|
+
| `goosehost get --slug md/markdown网站名称` | 查看markdown内容 |
|
|
73
|
+
| `goosehost get --slug 网站名称 --output 保存路径` | 下载html内容到本地文件 |
|
|
74
|
+
| `goosehost get --slug md/网站名称 --output 保存路径` | 下载markdown内容到本地文件 |
|
|
75
|
+
| `goosehost update --slug 网站名称 --file 文件路径` | 用本地html文件更新 |
|
|
76
|
+
| `goosehost update --slug md/网站名称 --file 文件路径` | 用本地markdown文件更新 |
|
|
77
|
+
| `goosehost update --slug 网站名称 --content "新内容"` | 直接更新内容(markdown站点需加md/前缀,不建议使用此命令) |
|
|
78
|
+
| `goosehost delete --slug 网站名称 --force` | 删除html网站(需要加 `--force`) |
|
|
79
|
+
| `goosehost delete --slug md/网站名称 --force` | 删除markdown网站(需要加 `--force`) |
|
|
80
|
+
|
|
81
|
+
### 快捷部署
|
|
82
|
+
|
|
83
|
+
| 命令 | 说明 |
|
|
84
|
+
|------|------|
|
|
85
|
+
| `goosehost deploy ./文件.html` | 部署 HTML 文件(自动起名) |
|
|
86
|
+
| `goosehost deploy ./文件.md` | 部署 Markdown 文件(自动起名) |
|
|
87
|
+
| `goosehost deploy ./文件.html --slug 自定义名称` | 部署并指定网站名称 |
|
|
88
|
+
|
|
89
|
+
### 其他
|
|
90
|
+
|
|
91
|
+
| 命令 | 说明 |
|
|
92
|
+
|------|------|
|
|
93
|
+
| `goosehost config` | 查看当前登录状态和配置 |
|
|
94
|
+
| `goosehost --help` | 查看所有命令的帮助 |
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## 文件路径怎么写
|
|
99
|
+
|
|
100
|
+
在命令中,所有 `--file` 和 `--output` 后面的路径都支持两种写法:
|
|
101
|
+
|
|
102
|
+
- **相对路径**:相对于当前终端所在的目录
|
|
103
|
+
例如:`./index.html`、`backup.html`、`../my-site/index.html`
|
|
104
|
+
|
|
105
|
+
- **绝对路径**:从磁盘根目录开始的完整路径
|
|
106
|
+
例如:`D:/my-site/index.html`、`C:\Users\Administrator\backup.html`
|
|
107
|
+
|
|
108
|
+
如果不确定当前终端在哪个目录,可以输入:
|
|
109
|
+
|
|
110
|
+
- Windows:`cd`
|
|
111
|
+
- Mac/Linux:`pwd`
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## 常用操作示例
|
|
116
|
+
|
|
117
|
+
### 部署当前文件夹里的首页
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
goosehost deploy ./index.html
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
输出示例:
|
|
124
|
+
|
|
125
|
+
```text
|
|
126
|
+
部署成功!
|
|
127
|
+
访问地址: https://page.goose.cc.cd/s/my-site
|
|
128
|
+
网站名称: my-site
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### 直接用文字创建一个 Markdown 网站
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
goosehost create --slug my-doc --type md --content "# 我的文档\n\n这是内容"
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### 把线上网站下载到本地修改
|
|
138
|
+
|
|
139
|
+
**第一步:下载到当前目录**
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
goosehost get --slug my-site --output backup.html
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
下载后,当前目录会多出一个 `backup.html` 文件。
|
|
146
|
+
如果你想保存到其他文件夹,可以写完整路径:
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
goosehost get --slug my-site --output D:/my-backup/index.html
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
**第二步:用编辑器修改 `backup.html`**
|
|
153
|
+
|
|
154
|
+
**第三步:传回去**
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
goosehost update --slug my-site --file backup.html
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
如果文件在其他路径,就填完整路径:
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
goosehost update --slug my-site --file D:/my-backup/index.html
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### 查看网站内容(不保存,只显示)
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
goosehost get --slug my-site
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
终端会直接打印出网站的全部代码。
|
|
173
|
+
|
|
174
|
+
### 删除一个网站
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
goosehost delete --slug my-site --force
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
## 卸载
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
pip uninstall goosehost-cli
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
## 常见问题
|
|
191
|
+
|
|
192
|
+
### 登录后每次都要重新登录吗?
|
|
193
|
+
|
|
194
|
+
不用。凭证保存在本地,下次打开终端会自动生效。
|
|
195
|
+
|
|
196
|
+
### 安装后输入 `goosehost` 提示找不到命令?
|
|
197
|
+
|
|
198
|
+
重启终端。如果还不行,检查 Python 的 Scripts 目录是否在系统 PATH 里。
|
|
199
|
+
|
|
200
|
+
### 部署后访问地址不对(显示 goose.cc.cd 而不是 page.goose.cc.cd)?
|
|
201
|
+
|
|
202
|
+
确保你安装的是最新版本(>= 0.1.3),升级命令:
|
|
203
|
+
|
|
204
|
+
```bash
|
|
205
|
+
pip install --upgrade goosehost-cli
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
### 用 `pip install goosehost-cli` 安装的不是最新版?
|
|
209
|
+
|
|
210
|
+
国内镜像可能有延迟,临时从官方源安装:
|
|
211
|
+
|
|
212
|
+
```bash
|
|
213
|
+
pip install -i https://pypi.org/simple goosehost-cli
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
### `--output` 不填会怎样?
|
|
217
|
+
|
|
218
|
+
内容会直接打印在终端,不会保存成文件。
|
|
219
|
+
|
|
220
|
+
### 为什么删除网站必须加 `--force`?
|
|
221
|
+
|
|
222
|
+
防止手滑误删。确认你真的要删,再加 `--force`。
|
|
223
|
+
|
|
224
|
+
---
|
|
225
|
+
|
|
226
|
+
## 更多帮助
|
|
227
|
+
|
|
228
|
+
查看所有命令:
|
|
229
|
+
|
|
230
|
+
```bash
|
|
231
|
+
goosehost --help
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
查看某个命令的详细用法,例如:
|
|
235
|
+
|
|
236
|
+
```bash
|
|
237
|
+
goosehost create --help
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
**Enjoy your static sites! 🚀**
|
|
@@ -164,7 +164,6 @@ def cmd_create(args):
|
|
|
164
164
|
sys.exit(1)
|
|
165
165
|
data = resp.json()
|
|
166
166
|
if data.get("success"):
|
|
167
|
-
# 修复:手动拼接正确的访问地址,与前端逻辑一致
|
|
168
167
|
if site_type == "md":
|
|
169
168
|
visit_url = f"{args.api}/md/{args.slug}"
|
|
170
169
|
else:
|
|
@@ -302,7 +301,6 @@ def cmd_deploy(args):
|
|
|
302
301
|
sys.exit(1)
|
|
303
302
|
data = resp.json()
|
|
304
303
|
if data.get("success"):
|
|
305
|
-
# 修复:手动拼接正确的访问地址
|
|
306
304
|
if site_type == "md":
|
|
307
305
|
visit_url = f"{args.api}/md/{slug}"
|
|
308
306
|
else:
|
|
@@ -321,10 +319,15 @@ def main():
|
|
|
321
319
|
print("好了,你现在要做的是登录:goosehost login --email 你的邮箱 --password 你的密码")
|
|
322
320
|
print("成功了否?看下面↓")
|
|
323
321
|
print(" 查看全部命令: goosehost --help")
|
|
324
|
-
print("
|
|
322
|
+
print("更详细命令请访问 https://page.goose.cc.cd/md/cli/")
|
|
323
|
+
print("GooseHost官网:https://host.goose.cc.cd/")
|
|
324
|
+
print("记得来官网玩玩!https://goosecode.surge.sh/")
|
|
325
325
|
sys.exit(0)
|
|
326
326
|
|
|
327
|
-
parser = argparse.ArgumentParser(
|
|
327
|
+
parser = argparse.ArgumentParser(
|
|
328
|
+
description="GooseHost-静态网站托管",
|
|
329
|
+
epilog="更详细命令请访问 https://host.goose.cc.cd/s/cli/"
|
|
330
|
+
)
|
|
328
331
|
parser.add_argument("--api", default=DEFAULT_API, help="API基础地址")
|
|
329
332
|
subparsers = parser.add_subparsers(dest="command", required=True, help="子命令")
|
|
330
333
|
|
|
@@ -350,18 +353,18 @@ def main():
|
|
|
350
353
|
|
|
351
354
|
# 获取
|
|
352
355
|
p_get = subparsers.add_parser("get", help="获取网站内容")
|
|
353
|
-
p_get.add_argument("--slug", required=True, help="
|
|
356
|
+
p_get.add_argument("--slug", required=True, help="网站名称,markdown站点需要添加md/前缀")
|
|
354
357
|
p_get.add_argument("--output", "-o", help="保存到文件")
|
|
355
358
|
|
|
356
359
|
# 更新
|
|
357
360
|
p_update = subparsers.add_parser("update", help="更新网站内容")
|
|
358
|
-
p_update.add_argument("--slug", required=True, help="
|
|
361
|
+
p_update.add_argument("--slug", required=True, help="网站名称,markdown站点需要添加md/前缀")
|
|
359
362
|
p_update.add_argument("--file", help="从文件读取内容")
|
|
360
363
|
p_update.add_argument("--content", help="直接指定内容")
|
|
361
364
|
|
|
362
365
|
# 删除
|
|
363
366
|
p_delete = subparsers.add_parser("delete", help="删除网站")
|
|
364
|
-
p_delete.add_argument("--slug", required=True, help="
|
|
367
|
+
p_delete.add_argument("--slug", required=True, help="网站名称,markdown站点需要添加md/前缀")
|
|
365
368
|
p_delete.add_argument("--force", action="store_true", help="强制删除,无需确认")
|
|
366
369
|
|
|
367
370
|
# 本地配置
|
|
@@ -4,10 +4,10 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "goosehost-cli"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.4"
|
|
8
8
|
description = "GooseHost-静态网站托管"
|
|
9
9
|
readme = "README.md"
|
|
10
|
-
authors = [{ name = "
|
|
10
|
+
authors = [{ name = "Minecraft_goose", email = "support@goose2.cc.cd" }]
|
|
11
11
|
license = { text = "MIT" }
|
|
12
12
|
requires-python = ">=3.7"
|
|
13
13
|
dependencies = [
|
goosehost_cli-0.1.2/PKG-INFO
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|