Ghost CLI
$ ghost 官方出品 中风险Ghost CLI(ghost / ghost-cli)负责自托管 Ghost 站点的安装、版本升级、进程管理、Nginx/SSL 配置及健康检查。支持 --no-prompt、--no-color、--dir 与 --verbose 参数以适配脚本化部署,但聚焦于宿主机运维而非内容 API 管理。
npm install -g ghost-cli ghost 负责管理宿主机进程、systemd 服务单元、Nginx/SSL 配置与核心文件,属于本地系统运维工具,MCP 无法替代。
Agent 友好度体检单
当前为静态评估(本机尚未安装或尚未运行探针)。可在本地运行 npm run data:probe 并提交 data/probes/ 升级为实测证据。
FCRS-1.0 六维评分拆解
支持 --no-prompt、--no-color 与 --dir,但输出采用面向人工阅读的 Listr 任务日志,缺少 --json 模式。
--no-promptfails cleanly when required install flags are missing- Lacks
--jsonoutput acrossls,doctor, andstatus
ghost ls 与 ghost doctor 为安全只读诊断,而 install/setup/uninstall 会调用 sudo 修改 systemd 与 Nginx。
ghost doctorchecks system prerequisites before mutating host services
通过 npm install -g ghost-cli 安装;本地模式支持多平台,但生产模式主要面向 Ubuntu/Linux systemd 环境。
- Global npm package with local and Linux production modes
自动化覆盖自托管 Ghost 生命周期(install、update、start、doctor),但不涉及文章或会员内容管理。
- Streamlines server lifecycle and upgrades via
ghost update
Ghost 基金会官方仓库(TryGhost/Ghost-CLI),采用 MIT 协议开源。
- Official Ghost Foundation CLI
ghost.org/docs/ghost-cli/ 提供官方指南,部分非交互标志组合需结合 --help 核对。
- Official Ghost CLI docs and
--helpoutput
安全边界、鉴权与放权指南
从实例目录中的 config.<env>.json 与 .ghost-cli 读取数据库及站点配置;系统级安装依赖本地 sudo/systemd 权限。
MIT 开源 CLI 免费;自托管 Ghost 同为 MIT 开源软件,仅需承担服务器资源费用。
# Ghost CLI (ghost) Agent Rules - Always pass `--no-prompt --no-color` and explicit `--dir <path>` on automation commands. - Run `ghost doctor` before `ghost update` or `ghost restart` to catch permission or Node mismatches. - Never run `ghost uninstall` without explicit human approval and verified database backups.
Agent 高频安全命令配方
只读查询(安全推荐)
ghost ls --no-color
列出宿主机上已登记的 Ghost 安装目录、URL 与进程状态,不作任何修改。
ghost doctor --dir /var/www/ghost --no-color
检查目标 Ghost 目录的 Node 版本、文件权限、systemd 与配置完整性。
受控写入与预演
ghost update --dir /var/www/ghost --no-prompt --no-color
在不弹出确认提示的情况下下载并应用兼容的最新 Ghost 版本。
核心优势
- + 在参数齐全时可通过
--no-prompt与--no-color实现无人值守运维。 - +
ghost doctor可提前排查环境、权限与配置隐患。
注意事项与踩坑点
- ! 不支持
--json输出,状态与诊断信息以表格和任务进度文本呈现。 - ! 生产命令默认假设 Linux systemd 与
sudo环境,且不支持管理博客文章内容。