Skip to content

CLI Commands

These work on every command:

FlagDefaultDescription
--output table|json|plaintableOutput format for list commands
--server URLhttps://api.envsh.devOverride the API server URL
--config PATHCustom config file path

Authenticate with email and a 6-digit code.

envsh login [--email EMAIL]
FlagDescription
--emailEmail address (prompted if not provided)

On first login, creates your workspace and registers your SSH key automatically.


Revoke your refresh token and clear local credentials.

envsh logout

Encrypt a .env file and upload it.

envsh push FILE --project SLUG --env ENV [--message MSG]
Argument/FlagDescription
FILEPath to the .env file
--projectProject slug (required)
--envEnvironment name (required)
--messageDescribe what changed

Download and decrypt secrets.

envsh pull ENV --project SLUG [options]
Argument/FlagDescription
ENVEnvironment name
--projectProject slug (required)
--output FILEOutput file (default: .env)
--formatenv (default), export, json
--stdoutPrint to stdout instead of file
--key PATHSSH private key (default: ~/.ssh/id_ed25519)

Pull secrets, inject as env vars, run a command.

envsh run --project SLUG [--key PATH] ENV -- COMMAND [ARGS...]
Argument/FlagDescription
ENVEnvironment name
--projectProject slug (required)
--key PATHSSH private key
-- COMMANDCommand to run (after -- separator)

Manage projects.

envsh project list
envsh project create NAME SLUG
envsh project delete PROJECT_ID

Manage SSH keys.

envsh keys list
envsh keys add [--file PATH] [--name LABEL]
envsh keys revoke FINGERPRINT_OR_ID
FlagDescription
--filePath to SSH public key (default: ~/.ssh/id_ed25519.pub)
--nameDisplay label

Show current workspace details.

envsh workspace

List all workspaces you belong to.

envsh workspace list

Switch to a different workspace. All subsequent commands operate in that workspace.

envsh workspace switch WORKSPACE_ID

Invite a member to your workspace (admin only).

envsh invite EMAIL [--role admin|member]

Default role is member.


List workspace members.

envsh members

Remove a member from the workspace (admin only). Access is revoked instantly — the member is blocked from all workspace operations immediately.

envsh remove EMAIL

Manage machine identities.

envsh machine list
envsh machine create NAME --project SLUG --env ENV
envsh machine revoke NAME_OR_ID

View the audit log (admin only).

envsh audit [--limit N]

Default limit: 50. Maximum: 200.


View secret version history.

envsh versions ENV --project SLUG [--limit N]

Run diagnostic checks.

envsh doctor

Checks: SSH key exists, credentials file, session token, server reachable, key registered.


Print the CLI version.

envsh version