Ghostwriter CLI reads and writes to the
.env file and tries to establish an outbound network connection when you run
the update and version commands. The CLI only writes to Ghostwriter’s .env file and only reads Ghostwriter’s
.env and VERSION files. For network connectivity, it only connects to GitHub’s REST API to pull the version information
for Ghostwriter and Ghostwriter CLI’s latest tagged releases. However, these actions taken by a downloaded binary
will cause some anti-malware and EDR solutions to flag Ghostwriter CLI as malware. If you encounter an issue with
such a solution blocking Ghostwriter CLI from executing, please add the binary to your allowlist or exclusions list.We are working to try to get Ghostwriter CLI to be trusted, as it once was, but these issues come and go.If you have concerns about this behavior, you can build Ghostwriter CLI from source. See the GitHub repository.
Further, you can inspect the source code to verify its behavior and check the build hashes against the releases page.Using Ghostwriter CLI to Manage the Server
Ghostwriter CLI can handle just about anything you might need or want to do with your Ghostwriter installation. Running the tool with thehelp command–or no command–will print the latest usage information.
The following sections explain some of the core functionality.
By default, all commands target a production environment. Provide the
--dev if you’re interacting with a development environment. Every command can accept the --dev flag.Managing the Server Configuration
Theconfig command is your Swiss Army knife when managing your server configuration. If you don’t provide any subcommands or arguments, the command prints your current configuration values (the contents of your server’s DotEnv file).
You can pull and set configuration values with config. Use config get to fetch a specific value or set of values. Use config set to change a value.
There are also several subcommands to help you manage hostnames and origins you trust: allowhost, disallowhost, trustorigin, and distrustorigin. Use these subcommands to adjust those values, as the Quick Start guide describes.
Managing Docker Containers
Ghostwriter CLI’scontainers command contains the following subcommands:
-
build: Rebuild the containers (not the data volumes) -
up: Bring up Ghostwriter containers -
down: Bring down Ghostwriter containers -
start: Start all stopped services and restart any running services -
stop: Stop all running services -
restart: Stop and restart all services
running command. This command lists all running containers related to Ghostwriter. The output will look something like this (edited for easier display):
Running Containers
The
Status column shows the uptime and health of the service. If you see an unhealthy status that the service failed a health check and may not work properly. Learn more about health checks here: Health Monitoringlogs command to view a particular container’s recent log events. The command requires the name of a running container. Valid container names are:
- all
- django
- graphql
- nginx
- postgres
- redis
all, logs from all running containers will be returned. By default, logs will return up to 500 lines. You can use the --lines flag to adjust how many lines you want to retrieve.
Viewing Django Logs