GooseHost-静态网站托管
Project description
GooseHost CLI
在终端里管理 GooseHost 的静态网站,不需要开浏览器。
安装
pip install goosehost-cli
安装后,在终端输入 goosehost 就可以用了。
快速开始
1. 登录(只做一次)
goosehost login --email 你的邮箱 --password 你的密码
登录后凭证保存在本地,下次不用再输入。
2. 部署一个 HTML 文件
goosehost deploy ./index.html
./index.html 表示当前目录下的 index.html 文件。
工具会自动用文件名作为网站名称,并在终端显示访问地址。
3. 查看所有网站
goosehost list
完整命令列表
登录与账号
| 命令 | 说明 |
|---|---|
goosehost login --email xxx --password xxx |
登录并保存凭证 |
goosehost logout |
退出登录(清除本地凭证) |
goosehost register --email xxx --password xxx |
注册新账号 |
网站管理
| 命令 | 说明 |
|---|---|
goosehost list |
列出你的所有网站 |
goosehost create --slug 名称 --type html --file 文件路径 |
从文件创建网站 |
goosehost create --slug 名称 --type html --content "<h1>Hi</h1>" |
直接从文字创建网站 |
goosehost get --slug 网站名称 |
查看html内容 |
goosehost get --slug md/markdown网站名称 |
查看markdown内容 |
goosehost get --slug 网站名称 --output 保存路径 |
下载html内容到本地文件 |
goosehost get --slug md/网站名称 --output 保存路径 |
下载markdown内容到本地文件 |
goosehost update --slug 网站名称 --file 文件路径 |
用本地html文件更新 |
goosehost update --slug md/网站名称 --file 文件路径 |
用本地markdown文件更新 |
goosehost update --slug 网站名称 --content "新内容" |
直接更新内容(markdown站点需加md/前缀,不建议使用此命令) |
goosehost delete --slug 网站名称 --force |
删除html网站(需要加 --force) |
goosehost delete --slug md/网站名称 --force |
删除markdown网站(需要加 --force) |
快捷部署
| 命令 | 说明 |
|---|---|
goosehost deploy ./文件.html |
部署 HTML 文件(自动起名) |
goosehost deploy ./文件.md |
部署 Markdown 文件(自动起名) |
goosehost deploy ./文件.html --slug 自定义名称 |
部署并指定网站名称 |
其他
| 命令 | 说明 |
|---|---|
goosehost config |
查看当前登录状态和配置 |
goosehost --help |
查看所有命令的帮助 |
文件路径怎么写
在命令中,所有 --file 和 --output 后面的路径都支持两种写法:
-
相对路径:相对于当前终端所在的目录
例如:./index.html、backup.html、../my-site/index.html -
绝对路径:从磁盘根目录开始的完整路径
例如:D:/my-site/index.html、C:\Users\Administrator\backup.html
如果不确定当前终端在哪个目录,可以输入:
- Windows:
cd - Mac/Linux:
pwd
常用操作示例
部署当前文件夹里的首页
goosehost deploy ./index.html
输出示例:
部署成功!
访问地址: https://page.goose.cc.cd/s/my-site
网站名称: my-site
直接用文字创建一个 Markdown 网站
goosehost create --slug my-doc --type md --content "# 我的文档\n\n这是内容"
把线上网站下载到本地修改
第一步:下载到当前目录
goosehost get --slug my-site --output backup.html
下载后,当前目录会多出一个 backup.html 文件。
如果你想保存到其他文件夹,可以写完整路径:
goosehost get --slug my-site --output D:/my-backup/index.html
第二步:用编辑器修改 backup.html
第三步:传回去
goosehost update --slug my-site --file backup.html
如果文件在其他路径,就填完整路径:
goosehost update --slug my-site --file D:/my-backup/index.html
查看网站内容(不保存,只显示)
goosehost get --slug my-site
终端会直接打印出网站的全部代码。
删除一个网站
goosehost delete --slug my-site --force
卸载
pip uninstall goosehost-cli
常见问题
登录后每次都要重新登录吗?
不用。凭证保存在本地,下次打开终端会自动生效。
安装后输入 goosehost 提示找不到命令?
重启终端。如果还不行,检查 Python 的 Scripts 目录是否在系统 PATH 里。
部署后访问地址不对(显示 goose.cc.cd 而不是 page.goose.cc.cd)?
确保你安装的是最新版本(>= 0.1.3),升级命令:
pip install --upgrade goosehost-cli
用 pip install goosehost-cli 安装的不是最新版?
国内镜像可能有延迟,临时从官方源安装:
pip install -i https://pypi.org/simple goosehost-cli
--output 不填会怎样?
内容会直接打印在终端,不会保存成文件。
为什么删除网站必须加 --force?
防止手滑误删。确认你真的要删,再加 --force。
更多帮助
查看所有命令:
goosehost --help
查看某个命令的详细用法,例如:
goosehost create --help
Enjoy your static sites! 🚀
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file goosehost_cli-0.1.3.tar.gz.
File metadata
- Download URL: goosehost_cli-0.1.3.tar.gz
- Upload date:
- Size: 6.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c8c64c7c3bd7db386a28d38e9979cc6647b4b75132a914885863c77ec4293dde
|
|
| MD5 |
81315786057882796e49d5e9fd3c5244
|
|
| BLAKE2b-256 |
817684ed0b9ea956f766cd55c38e91742093877cb2f88681a08dbad259dc0b04
|
File details
Details for the file goosehost_cli-0.1.3-py3-none-any.whl.
File metadata
- Download URL: goosehost_cli-0.1.3-py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6368cc3a528bfe03a29dc83a9bb7bc644fe2eec2ab1ee1339b9701756870a041
|
|
| MD5 |
7e4d4f9f95f65676cf3698059b875bd7
|
|
| BLAKE2b-256 |
472fa8fd9ca5dc8536b971c4f0b1ece55f4d781507a6356b9650d49c7119d75e
|