This article follows the official documentation. We haven’t tested this tool for a hands-on review.
When a coding agent needs to manage a Ghost website's server installation, Ghost-CLI provides commands to inspect and maintain it. Ghost is a publishing platform; Ghost-CLI is its command-line tool for installing, upgrading, backing up, restarting, and diagnosing Ghost on a server. The agent runs those commands through a shell with access to the host.
Install Ghost-CLI
The official Ghost-CLI documentation gives this global npm installation command for a production server, run as a non-root user:
sudo npm install -g ghost-cli@latest
This downloads the package from npm and installs the ghost command for the current machine. It needs Node.js and npm on the server. The docs say you likely don't need sudo on a local machine. Because the command asks for @latest, the same line also updates an existing Ghost-CLI. Check the installed command with:
ghost --version
ghost help
According to the docs, ghost --version prints the Ghost-CLI version and the Ghost version.
Ghost-CLI is intended for Ghost server administration. Ghost's Ubuntu install guide lists the recommended server stack and the versions it supports. The Ghost-CLI docs say the tool works with that recommended stack and is the only supported install method. Check the current requirements before asking an agent to manage an existing host.
The docs describe no Ghost account login or API token for these server commands. The person or agent running them needs shell access to the host and enough operating-system permissions for the requested task. Keep SSH credentials and other secrets in the host's existing credential setup; do not paste them into an agent prompt.
Inspect an existing installation
A useful first task is to ask an agent to check a Ghost installation and report its status without changing it. Connect to the server using your existing shell or SSH access, then run the CLI from the Ghost installation directory. Replace the path below with the actual directory on your host:
cd /path/to/your/ghost-install
ghost ls
ghost doctor
ghost log --error -n 50
ghost ls lists the Ghost sites and their status from the current user's ~/.ghost/config file, so it works from any directory. On a production server, the docs show it calling sudo systemctl to read the site status. ghost doctor checks the system for problems that can affect installing or updating Ghost and says what needs to be fixed. It looks at the Ghost install in the current directory. ghost log --error -n 50 prints the last 50 lines of the site's error log. It only works when Ghost writes its logs to files, which is the default setup.
These commands inspect Ghost without upgrading or restarting it. Leave out ghost log --follow in an agent task, because it keeps running like tail -f. Read the command output and have the agent summarize the reported checks and any issues. The exact output depends on the installation, so do not assume a particular status message or format.
Recent Ghost-CLI releases also accept ghost ls --json, which prints the site list as JSON. The docs page does not list this option yet, but the ls command source in the official repository defines it. Check ghost ls --help on your server before an agent relies on it.
A realistic agent prompt is:
From
/path/to/your/ghost-install, runghost lsandghost doctor. Then read the last 50 lines of the error log withghost log --error -n 50. Do not install, update, restart, or change configuration. Summarize the checks and report any errors exactly as shown.
The commands run locally on the server where Ghost-CLI is installed. They do not change posts or other site content. An agent can affect the live site when it installs or upgrades Ghost. It can also affect the site by restarting the service or changing configuration. Get explicit approval before asking the agent to do any of these tasks.
Keep the task within Ghost-CLI's scope
Ghost-CLI handles server installation and maintenance. Editorial work such as creating or editing posts happens elsewhere. An agent can use Ghost-CLI to collect diagnostic output for an operator. This does not give the agent access to Ghost Admin or a content-management API.
Because Ghost-CLI manages the server, shell access sets the main boundary. An agent with shell access can run commands beyond read-only diagnostics. Keep the requested task narrow, and name permitted commands in the prompt. If a diagnostic points to a problem, ask the agent to report it before it runs a repair, update, backup, or restart.
Do not let an agent add the global --no-prompt flag to a command that changes the site. That flag runs a command without asking for any input. The docs say ghost uninstall --no-prompt removes the Ghost install and its content without a warning.