HYPHEN_DEV
: set totrue
if you wish to interact against the Hyphen dev environment. You can also use--dev
, but it would be required with each command.
Linux/MacOS
sh -c "$(curl -fsSL https://cdn.hyphen.ai/install/install.sh)"
Windows
powershell -c "irm https://cdn.hyphen.ai/install/install.ps1 | iex"
The root command for the Hyphen CLI.
Usage:
hyphen [command]
Global Flags:
--org
: Organization ID (e.g., org_123)--proj
: Project ID (e.g., proj_123)--env
: Environment ID (e.g., env_12345)--yes, -y
: Automatically answer yes for prompts--no
: Automatically answer no for prompts
Available Commands:
auth
: Authenticate with Hypheninit
: Initialize an appupdate
: Update the Hyphen CLIset-org
: Set the organization IDset-project
: Set the project IDversion
: Display the version of the Hyphen CLIpush
: Upload and encrypt environment variables for a specific environmentpull
: Retrieve and decrypt environment variables for a specific environmentlink
: Shorten a URL and optionally generate a QR codeapp
: Manage applicationsproject
: Manage projectsenv
: Manage environments
Authenticate with Hyphen.
Usage:
hyphen auth
This command starts the OAuth flow and saves the credentials.
If you are authenticating in a CI/CD environment and need to authenticate using an API key, you can do so in 2 ways:
This will look for the HYPHEN_API_KEY
environment variable first and if not found it will prompt for the key.
Usage:
hyphen auth --use-api-key
This will expect an inline value. The risk in using this method is just in exposing the secret in your terminal output, but it's provided for convenience.
Usage:
hyphen auth --set-api-key VALUE
Initialize an app.
Usage:
hyphen init <app name>
This command creates a new app and initializes the manifest file.
Upload and encrypt environment variables for a specific environment.
Usage:
hyphen push [flags]
Flags:
--environment, -e string
: Specify the environment to push to (e.g., dev, staging, prod)--org string
: Specify the organization ID (overrides the default from credentials)
This command reads the local .env file corresponding to the specified environment, encrypts the variables, and uploads them to the Hyphen platform.
Retrieve and decrypt environment variables for a specific environment.
Usage:
hyphen pull [flags]
Flags:
--environment, -e string
: Specify the environment to pull from (e.g., dev , staging, prod)--org string
: Specify the organization ID (overrides the default from credentials)
This command retrieves the encrypted environment variables from the specified environment, decrypts them, and saves them to a local .env file.
Update the Hyphen CLI.
Usage:
hyphen update
Set the organization ID in .hx.
Usage:
hyphen set-org <id>
Set the project ID in .hx.
Usage:
hyphen set-project <id>
Display the version of the Hyphen CLI.
Usage:
hyphen version
Shorten a URL and optionally generate a QR code.
Usage:
hyphen link <long_url> [flags]
Flags:
--qr
: Generate a QR code for the shortened URL--domain string
: Specify a custom domain for the short URL (default: organization's default domain)--tag strings
: Add tags to the shortened URL (can be used multiple times)--code string
: Set a custom short code for the URL (if available)--title string
: Add a title to the shortened URL
Manage applications.
Available Subcommands:
list
: List all applications associated with the organization and projectcreate
: Create a new appget
: Get an app
List all applications associated with the organization and project.
Usage:
hyphen app list
Create a new app within your organization.
Usage:
hyphen app create <app name> [flags]
Flags:
--id, -i
: Specify a custom app ID (optional)
Examples:
hyphen app create myapp
hyphen app create myapp --id custom-app-id
Retrieve details of an app within your organization.
Usage:
hyphen app get <id>
Examples:
hyphen app get custom-app-id
Manage projects.
Available Subcommands:
list
: List all projectscreate
: Create a new project with the provided nameget
: Get a project by ID
List all projects.
Usage:
hyphen project list
Create a new project with the provided name.
Usage:
hyphen project create [name]
Examples:
hyphen project create "project"
Get a project by ID.
Usage:
hyphen project get [project_id]
Examples:
hyphen project get proj_123
Manage environment .env secrets.
Available Subcommands:
pull
: Retrieve and decrypt .env secrets for a specific environmentpush
: Upload and encrypt .env secrets for a specific environment
Retrieve and decrypt .env secrets for a specific environment.
Usage:
hyphen env pull [flags]
Flags:
--environment, -e string
: Specify the environment to pull from (e.g., dev, staging, prod)--org string
: Specify the organization ID (overrides the default from credentials)--all
: Pull secrets for all environments
This command retrieves the encrypted environment variables from the specified environment, decrypts them, and saves them to a local .env file.
Upload and encrypt .env secrets for a specific environment.
Usage:
hyphen env push [flags]
Flags:
--environment, -e string
: Specify the environment to push to (e.g., dev, staging, prod)--org string
: Specify the organization ID (overrides the default from credentials)--all
: Push secrets for all environments
This command reads the local .env file corresponding to the specified environment, encrypts the variables, and uploads them to the Hyphen platform.
Run a sub-command with the specified environment set as environment variables, merging with defaults.
Usage:
hyphen env run [environment] -- [command]
environment
is optional. Skipping it will just use the default (.env
) environment.
When they exist, the files will be loaded and appended to the environment in this order:
.env
.env.local
.env.{environment}
So a variable defined in .env
that is also defined in .env.{environment}
will have the .env.{environment}
value take precedence.