rebase environment

Inspect and manage workspace deployment environment policies.

Synopsis

rebase environment list [--json]
rebase environment show <environment> [--json]
rebase environment use <environment>
rebase environment create <environment> [--protected | --direct] [--json]
rebase environment delete <environment>
rebase environment protect prod --allowed-branch main
rebase environment unprotect dev
rebase environment grants <environment> [--json]
rebase environment grant <environment> (--profile-id <uuid> | --api-key-id <uuid>) [--access read|write|admin] [--json]
rebase environment revoke-grant <environment> <grant-id>
rebase environment track-project <environment> <project> --connection <id> --ref <ref> --entrypoint <file> [--repo-path <path>] [--json]

Subcommands

SubcommandDescription
createCreate an environment in the active workspace. Direct by default; --protected makes it GitOps-protected.
deleteDelete an empty, unprotected environment.
grantGrant one profile or API key access to an environment.
grantsList explicit profile and API-key access grants for an environment.
listList environment policies for the active workspace.
protectRequire GitOps deployment requests for an environment.
revoke-grantRemove one explicit environment access grant by its UUID.
showShow one environment.
track-projectBind a project in an environment to a GitHub ref and Python entrypoint.
unprotectAllow direct deploys for an environment.
useSelect the environment for this workspace on this machine. It becomes the default for rebase deploy --env.

Defaults

New workspaces use these policies:

EnvironmentDeploy modeProtected
devdirectNo
staginggitopsYes
prodgitopsYes

Protected environments reject direct deploy mutations in the Rebase API. Use rebase deploy <file> --env <environment> from the connected GitHub repository to create a GitOps deployment request.

Options

create

OptionTypeDescription
--protected, -p / --direct, -dboolCreate a GitOps-protected environment, or a direct one. Defaults to --direct.
--json, -jboolPrint the created environment as JSON.

grant

OptionTypeDescription
--profile-id, -pstrWorkspace profile UUID to grant.
--api-key-idstrWorkspace API key UUID to grant.
--access, -aread, write, or adminAccess level. Defaults to read.
--json, -jboolPrint the grant as JSON.

protect

OptionTypeDescription
--allowed-branch, -astrBranch allowed for GitOps reconciliation. Can be passed more than once. Defaults to main and master.
--jsonboolPrint the updated policy as JSON.

unprotect

OptionTypeDescription
--jsonboolPrint the updated policy as JSON.

track-project

OptionTypeDescription
--connection, -cstrGitHub repository connection ID. Required.
--ref, -rstrTracked branch or tag ref. Required.
--entrypoint, -estrPython declaration file. Required.
--repo-pathstrPath inside the repository.
--json, -jboolPrint the tracking binding as JSON.

show and grants also accept --json, -j.

CommandPurpose
rebase deployDeploy directly or create a GitOps deployment request based on environment policy.
rebase connect githubConnect the workspace repository required for protected deploys.

On this page