Skip to main content
Ghostable v2 introduces a new, faster CLI built with TypeScript and npm, replacing the older PHP-based Composer package. This guide will help you safely migrate your existing environments to the new CLI while maintaining all your encrypted data.

1. Overview

In this version, the CLI is now distributed via npm (ghostable/cli), and supports a zero-knowledge architecture — meaning encryption happens entirely on your machine before any data reaches Ghostable.
You’ll still use your same Ghostable account and environments; this process simply re-establishes your workspace under the new CLI.

2. Pull Existing Environments (from v1)

Before migrating, download your current .env files locally using the legacy PHP CLI.
php vendor/bin/ghostable env:pull
Repeat this for each environment. You’ll now have a set of .env files representing your current data — keep these safe while setting up your new CLI project.

3. Install the New CLI

Install the new Ghostable CLI using npm:
npm install -g @ghostable/cli
For full installation details, see the v2 Installation Guide.

4. Initialize Your Project

Run the new CLI initialization command:
ghostable init
Choose Create a new project, give it a name, and confirm. This will generate a fresh ghostable.yaml manifest in your repository, configured for the new zero-knowledge encryption model. You can safely commit this manifest file to version control.

5. Recreate and Push Environments

Next, create new environments and push your previously pulled data.
ghostable env:init
ghostable env:push
Repeat for each environment. Your variables will now be encrypted locally and only ciphertext and metadata will be uploaded to Ghostable.

6. Export Keys for Team Vaults

Once your new environments are synced, export the keys for safekeeping or sharing with your team.
ghostable keys:export
We recommend storing these keys in your organization’s vault (e.g., 1Password, Vaultwarden, or Bitwarden).

7. Clean Up

Finally, log in to the Ghostable Dashboard and remove your old (v1) project to prevent confusion or duplicate configurations. You are then free to remove the v1 composer package.
composer remove ghostable-dev/cli