Listing Environments
Theenv list command displays all environments associated with the current project as defined in
your .ghostable/ghostable.yaml manifest.
Note: You must be logged in and have an initialized project (ghostable init) before using this
command.
Creating Environments
To create a new environment, run theenv create command:
- Select an environment type (e.g., Production, Staging)
- If
--nameisn’t provided, choose a suggested name or enter a custom slug-formatted name
Environment name (slug)
Pushing Variables
To upload your local.env file to Ghostable, use the push command:
Specify which environment to push (e.g.
If omitted, Ghostable will prompt you to choose.
production, staging).If omitted, Ghostable will prompt you to choose.
Path to the
Defaults to
.env file to read from.Defaults to
.env.<env> or .env if unspecified.Skip confirmation prompts and proceed automatically.
Merge remote-only keys before pushing so you don’t clobber teammates’ latest values. Local changes still win on conflicts.
Replace all existing variables on the server with your local
.env contents.Delete remote variables that no longer exist in your local
.env file.Ignoring Variables
Some secrets (deployment tokens, platform-specific values, etc.) should never leave your machine. List them under theignore key for an environment inside .ghostable/ghostable.yaml and the CLI
will skip them during env push, env sync, var push, and var pull.
--show-ignored to commands like env pull or env diff, so you know they were intentionally
skipped.
Syncing Variables
Theenv sync command provides a one-way synchronization between your local .env file and the remote environment in Ghostable.
Specify which environment to sync (e.g.
If omitted, Ghostable will prompt you to select one.
production, staging).If omitted, Ghostable will prompt you to select one.
Path to the local
Defaults to
.env file to read from.Defaults to
.env.<env> or .env if unspecified.Skip confirmation prompts and proceed automatically.
Command comparison
| Command | Behavior | Remote effect | Prunes missing keys? | When to use |
|---|---|---|---|---|
ghostable env push | Upload only the keys in your current file | Updates/creates provided keys; untouched keys remain | No | Routine updates when you only changed a handful of values |
ghostable env push --sync | Pull remote-only keys before pushing | Same as env push, but merges remote keys first to avoid accidental overwrites | No | Collaborative edits where teammates may have added keys in Ghostable |
ghostable env push --replace | Force remote to match your file | Rewrites all keys with your local values | No | Emergency resets when you know your local file is authoritative |
ghostable env push --prune-server | Remove keys absent locally | Deletes any remote key not found in your file | Yes (only for missing keys) | Cleaning up deprecated variables without a full sync |
ghostable env sync | Treat local file as source of truth | Remote variables replaced wholesale with local copy | Yes | Rebuild environments from scratch or enforce a golden .env |
Validating Variables
Run schema validation before pushing or deploying to catch bad values early. The command pullsschema.yaml plus any per-environment overrides and validates your local .env:
Environment whose
If omitted, the CLI prompts you to choose.
.env should be validated.If omitted, the CLI prompts you to choose.
Optional path to a non-standard
.env file. Defaults to .env.<env> or .env.Pushing a Single Variable
var push encrypts one environment variable from your local .env file and uploads it to Ghostable.
It reads project + environment info from .ghostable/ghostable.yaml, respects your ignore rules, and uses your local CLI keys to encrypt before upload.
This command only sends the one variable you select. It won’t touch other keys locally or remotely.
Environment to push to (e.g.
If omitted, you’ll be prompted to choose from your manifest.
production, staging).If omitted, you’ll be prompted to choose from your manifest.
The environment variable name to push (e.g.
If omitted, the CLI lists variables from the resolved .env and prompts you to choose.
APP_URL).If omitted, the CLI lists variables from the resolved .env and prompts you to choose.
Path to the .env file to read from.
Defaults to
Defaults to
.env.<env> when --env is provided, otherwise .env.Pulling Variables
To fetch a remote environment and write it to your local.env file, use the pull command:
Specify which environment to pull (e.g.
If omitted, Ghostable will prompt you to select one.
production, staging).If omitted, Ghostable will prompt you to select one.
Path to the
Defaults to
.env file where variables will be written.Defaults to
.env.<env> or .env if unspecified.Output format for the generated file.
Accepts
If omitted, the CLI prompts you to choose interactively.
Accepts
alphabetical, grouped, or grouped:comments.If omitted, the CLI prompts you to choose interactively.
Pull only specific variable keys.
Can be repeated, e.g.
Can be repeated, e.g.
--only APP_KEY --only DB_PASSWORD.Preview which variables would be pulled without writing any files.
Show variables that were skipped (ignored) during pull due to local configuration or filters.
Replace the entire local
.env file instead of merging values.Remove local variables that no longer exist on the server.
Skip automatic backup creation.
Pulling a Single Variable
var pull fetches one environment variable from Ghostable, decrypts it locally using your CLI keys, and upserts it into your target .env file (creates the file if missing, replaces the line if it exists, or appends a new line). If the variable’s metadata marks it as commented, the line is written as a comment.
This command only touches the one variable you request. It won’t prune or rewrite other keys.
Environment to pull from (e.g.
If omitted, you’ll be prompted to choose from your manifest.
production, staging).If omitted, you’ll be prompted to choose from your manifest.
The environment variable name to pull (e.g.
If omitted, you’ll be shown a selectable list from the remote environment.
APP_KEY).If omitted, you’ll be shown a selectable list from the remote environment.
Destination file to update.
Defaults to
Defaults to
.env.<env> when --env is provided, otherwise .env.Comparing Environments
Theenv diff command helps you see what’s changed between your local .env file and the version
stored in Ghostable.
- The command pulls the latest encrypted environment bundle from Ghostable for the selected project and environment.
- It then decrypts that bundle locally using your master seed (stored in the OS keychain).
- It reads your local
.envfile, parses each variable, and compares the two sets of values.
Because Ghostable is zero-knowledge, the diff is performed entirely on your machine — no plaintext values are ever sent to Ghostable’s servers.
What’s Compared
For each environment variable, Ghostable compares:
| Field | Description |
|---|---|
| Name | The variable key (for example, APP_KEY, DB_HOST). |
| Value | The decrypted plaintext value from Ghostable compared against the value in your local .env. |
| Commented State | Indicates whether the variable is commented or active, based on Ghostable’s stored metadata. |
Possible Outcomes
The diff output highlights three types of changes:
If there are no differences, you’ll see:
| Symbol | Meaning | Example Output |
|---|---|---|
+ | Added locally – exists in your .env but not in Ghostable | + NEW_FEATURE_FLAG=true |
~ | Updated – exists in both but values differ | ~ APP_URL: https://old -> https://new |
- | Removed locally – exists in Ghostable but not in your .env | - LEGACY_SETTING=on |
No differences detected.Specify which environment to compare (e.g.
production, staging) and skip the interactive picker.Path to the local
Alias for
.env file to diff against (default: .env.<env> or .env).Alias for
--local.Explicit local
.env path. Same as --file; provided for compatibility with older scripts.API token to use for the remote pull.
If omitted, the CLI uses your logged-in session or
If omitted, the CLI uses your logged-in session or
GHOSTABLE_TOKEN.Diff only specific variable keys.
Repeatable, e.g.
Repeatable, e.g.
--only APP_KEY --only DB_PASSWORD.Show variables that were skipped (ignored) during comparison due to local configuration or filters.
Viewing Change History
Audit every change to an environment with theenv history command (legacy alias: env audit). It
summarizes recent activity and prints a table of individual operations.
| When | Actor | Operation | Key | Version | Notes |
|---|---|---|---|---|---|
| 2 hours ago (2024-06-05 10:17) | [email protected] | update | APP_URL | v12 | URL changed to prod host |
| 1 day ago (2024-06-04 09:02) | [email protected] | comment | DEBUG | v11 | Flag commented out |
| 3 days ago (2024-06-02 18:45) | [email protected] | create | API_KEY | v1 | New key provisioned |
Environment to inspect.
Defaults to an interactive picker.
Defaults to an interactive picker.