Skip to content

CLI Commands

The package manager for infrastructure resources.

oclif Version Downloads/week

$ npm install -g hereya-cli
$ hereya COMMAND
running command...
$ hereya (--version)
hereya-cli/0.57.1 linux-x64 node-v20.19.4
$ hereya --help [COMMAND]
USAGE
$ hereya COMMAND
...

Add a package to the project.

USAGE
$ hereya add PACKAGE [--chdir <value>] [--debug] [-p <value>...] [-w <value>]
ARGUMENTS
PACKAGE The package to add, specified as a GitHub repository in the format owner/repository.
To change the registry URL, set the HEREYA_REGISTRY_URL environment variable, so that it points to
$HEREYA_REGISTRY_URL/owner/repository.
For local packages, use the format local/path/to/package where path/to/package is the path to the package on
your local machine.
FLAGS
-p, --parameter=<value>... [default: ] parameter for the package, in the form of 'key=value'. Can be specified
multiple times.
-w, --workspace=<value> name of the workspace to add the package to (defaults to current workspace)
--chdir=<value> Directory where the command will be executed.
If not specified, it defaults to the current working directory.
Alternatively, you can define the project root by setting the HEREYA_PROJECT_ROOT_DIR
environment variable.
--debug enable debug mode
DESCRIPTION
Add a package to the project.
EXAMPLES
$ hereya add cloudy/docker_postgres

Install necessary resources for hereya operations in an infrastructure.

USAGE
$ hereya bootstrap INFRASTRUCTURETYPE [-f]
ARGUMENTS
INFRASTRUCTURETYPE infrastructure to bootstrap. Options are local, aws
FLAGS
-f, --force redeploy hereya resources if already deployed
DESCRIPTION
Install necessary resources for hereya operations in an infrastructure.
EXAMPLES
$ hereya bootstrap aws
$ hereya bootstrap local

Export the cloud backend configuration to a file

USAGE
$ hereya config export-backend [FILE]
ARGUMENTS
FILE Path to save the export file. Defaults to cloud-backend.json in current directory
DESCRIPTION
Export the cloud backend configuration to a file
EXAMPLES
$ hereya config export-backend
$ hereya config export-backend ./path/to/export.json

get the current backend type

USAGE
$ hereya config get-backend
DESCRIPTION
get the current backend type
EXAMPLES
$ hereya config get-backend

Import a backend configuration from a file

USAGE
$ hereya config import-backend FILE
ARGUMENTS
FILE Path to the file containing the backend configuration to import
DESCRIPTION
Import a backend configuration from a file
EXAMPLES
$ hereya config import-backend ./path/to/cloud-backend.json

set the current backend type

USAGE
$ hereya config use-backend TYPE
ARGUMENTS
TYPE type of backend to use. Possible values: s3, local
DESCRIPTION
set the current backend type
EXAMPLES
$ hereya config use-backend s3
$ hereya config use-backend local

Delete the remote state of a project for a given workspace

USAGE
$ hereya delete-state -w <value> [--chdir <value>]
FLAGS
-w, --workspace=<value> (required) workspace name
--chdir=<value> Directory where the command will be executed.
If not specified, it defaults to the current working directory.
Alternatively, you can define the project root by setting the HEREYA_PROJECT_ROOT_DIR
environment variable.
DESCRIPTION
Delete the remote state of a project for a given workspace
EXAMPLES
$ hereya delete-state -w dev
$ hereya delete-state --workspace staging

Deploy a hereya project using the project deployment package

USAGE
$ hereya deploy -w <value> [--chdir <value>] [--debug]
FLAGS
-w, --workspace=<value> (required) name of the workspace to deploy the packages for
--chdir=<value> Directory where the command will be executed.
If not specified, it defaults to the current working directory.
Alternatively, you can define the project root by setting the HEREYA_PROJECT_ROOT_DIR
environment variable.
--debug enable debug mode
DESCRIPTION
Deploy a hereya project using the project deployment package
EXAMPLES
$ hereya deploy

Display documentation for a package from the registry

USAGE
$ hereya doc PACKAGE [-C <value>] [-j] [--no-doc]
ARGUMENTS
PACKAGE Package name with optional version (e.g., my-package or my-package@1.0.0)
FLAGS
-j, --json Output in JSON format
--no-doc Show only metadata without the full documentation
GLOBAL FLAGS
-C, --chdir=<value> [default: .] directory to run command in
DESCRIPTION
Display documentation for a package from the registry
EXAMPLES
$ hereya doc my-package
$ hereya doc my-package@1.0.0
$ hereya doc my-package --json
$ hereya doc my-package --no-doc

Destroy all packages in the project.

USAGE
$ hereya down [--chdir <value>] [--debug] [--deploy] [-s <value>...] [-w <value>]
FLAGS
-s, --select=<value>... [default: ] select the packages to destroy
-w, --workspace=<value> name of the workspace to destroy the packages for
--chdir=<value> Directory where the command will be executed.
If not specified, it defaults to the current working directory.
Alternatively, you can define the project root by setting the HEREYA_PROJECT_ROOT_DIR
environment variable.
--debug enable debug mode
--deploy destroy deployment companion packages
DESCRIPTION
Destroy all packages in the project.
EXAMPLES
$ hereya down

Print project environment variables.

USAGE
$ hereya env [NAME] [--chdir <value>] [-l] [-w <value>]
ARGUMENTS
NAME name of the env to display
FLAGS
-l, --list list only the env vars without values
-w, --workspace=<value> name of the workspace to print the env vars for
--chdir=<value> project root directory
DESCRIPTION
Print project environment variables.
EXAMPLES
$ hereya env
$ hereya env myEnv
$ hereya env -w dev
$ hereya env -w dev -l

Set an user-defined environment variable for the project

USAGE
$ hereya env set [NAME] -v <value> [--chdir <value>] [-w <value>]
ARGUMENTS
NAME name of the environment variable to set
FLAGS
-v, --value=<value> (required) value of the environment variable
-w, --workspace=<value> name of the workspace to print the env vars for
--chdir=<value> project root directory
DESCRIPTION
Set an user-defined environment variable for the project
EXAMPLES
$ hereya env set FOO -v bar
$ hereya env set FOO -v bar -w dev

Add a package to the project in a git branch-based workspace

USAGE
$ hereya flow add PACKAGE [--chdir <value>] [--debug] [-p <value>...] [--profile <value>]
ARGUMENTS
PACKAGE The package to add, specified as a GitHub repository in the format owner/repository.
To change the registry URL, set the HEREYA_REGISTRY_URL environment variable, so that it points to
$HEREYA_REGISTRY_URL/owner/repository.
For local packages, use the format local/path/to/package where path/to/package is the path to the package on
your local machine.
FLAGS
-p, --parameter=<value>... [default: ] parameter for the package, in the form of 'key=value'. Can be specified
multiple times.
--chdir=<value> Directory where the command will be executed.
If not specified, it defaults to the current working directory.
Alternatively, you can define the project root by setting the HEREYA_PROJECT_ROOT_DIR
environment variable.
--debug enable debug mode
--profile=<value> profile to use for the workspace (will be appended to workspace name)
DESCRIPTION
Add a package to the project in a git branch-based workspace
EXAMPLES
$ hereya flow add cloudy/docker_postgres
$ hereya flow add cloudy/docker_postgres --profile staging
$ hereya flow add cloudy/docker_postgres -p DB_NAME=mydb -p DB_USER=admin

Create a git branch-based workspace and destroy all packages

USAGE
$ hereya flow down [--chdir <value>] [--debug] [--deploy] [--pin] [--profile <value>] [-s <value>...]
FLAGS
-s, --select=<value>... [default: ] select the packages to destroy
--chdir=<value> Directory where the command will be executed.
If not specified, it defaults to the current working directory.
Alternatively, you can define the project root by setting the HEREYA_PROJECT_ROOT_DIR
environment variable.
--debug enable debug mode
--deploy destroy deployment companion packages
--pin append git commit SHA to workspace name for commit-specific isolation
--profile=<value> profile to use for the workspace (will be appended to workspace name)
DESCRIPTION
Create a git branch-based workspace and destroy all packages
EXAMPLES
$ hereya flow down
$ hereya flow down --debug
$ hereya flow down --profile staging
$ hereya flow down --pin

Print project environment variables for a git branch-based workspace

USAGE
$ hereya flow env [NAME] [--chdir <value>] [-l] [--pin] [--profile <value>]
ARGUMENTS
NAME name of the env to display
FLAGS
-l, --list list only the env vars without values
--chdir=<value> project root directory
--pin append git commit SHA to workspace name for commit-specific isolation
--profile=<value> profile to use for the workspace (will be appended to workspace name)
DESCRIPTION
Print project environment variables for a git branch-based workspace
EXAMPLES
$ hereya flow env
$ hereya flow env myEnv
$ hereya flow env --profile staging
$ hereya flow env --pin
$ hereya flow env -l

Remove a package from the project in a git branch-based workspace

USAGE
$ hereya flow remove PACKAGE [--chdir <value>] [--debug] [--profile <value>]
ARGUMENTS
PACKAGE Remove a previously added package.
FLAGS
--chdir=<value> Directory where the command will be executed.
If not specified, it defaults to the current working directory.
Alternatively, you can define the project root by setting the HEREYA_PROJECT_ROOT_DIR environment
variable.
--debug enable debug mode
--profile=<value> profile to use for the workspace (will be appended to workspace name)
DESCRIPTION
Remove a package from the project in a git branch-based workspace
EXAMPLES
$ hereya flow remove cloudy/docker_postgres
$ hereya flow remove cloudy/docker_postgres --profile staging

Run a command with hereya env vars in a git branch-based workspace

USAGE
$ hereya flow run CMD... [--chdir <value>] [--pin] [--profile <value>]
ARGUMENTS
CMD... command to run
FLAGS
--chdir=<value> directory to run command in
--pin append git commit SHA to workspace name for commit-specific isolation
--profile=<value> profile to use for the workspace (will be appended to workspace name)
DESCRIPTION
Run a command with hereya env vars in a git branch-based workspace
EXAMPLES
$ hereya flow run -- npm run dev
$ hereya flow run --profile staging -- node index.js
$ hereya flow run --pin -- npm test

Create a git branch-based workspace and provision all packages

USAGE
$ hereya flow up [--chdir <value>] [--debug] [--deploy] [--pin] [--profile <value>] [-s <value>...]
FLAGS
-s, --select=<value>... [default: ] select the packages to provision
--chdir=<value> Directory where the command will be executed.
If not specified, it defaults to the current working directory.
Alternatively, you can define the project root by setting the HEREYA_PROJECT_ROOT_DIR
environment variable.
--debug enable debug mode
--deploy provision deployment companion packages
--pin append git commit SHA to workspace name for commit-specific isolation
--profile=<value> profile to use for the workspace (will be appended to workspace name)
DESCRIPTION
Create a git branch-based workspace and provision all packages
EXAMPLES
$ hereya flow up
$ hereya flow up --debug
$ hereya flow up --profile staging
$ hereya flow up --pin

Display help for hereya.

USAGE
$ hereya help [COMMAND...] [-n]
ARGUMENTS
COMMAND... Command to show help for.
FLAGS
-n, --nested-commands Include all nested commands in the output.
DESCRIPTION
Display help for hereya.

Import a package resource into your project

USAGE
$ hereya import PACKAGE -f <value> [--chdir <value>] [--debug] [-p <value>...] [-w <value>]
ARGUMENTS
PACKAGE The package to import, specified as a GitHub repository in the format owner/repository.
To change the registry URL, set the HEREYA_REGISTRY_URL environment variable, so that it points to
$HEREYA_REGISTRY_URL/owner/repository.
For local packages, use the format local/path/to/package where path/to/package is the path to the package on
your local machine.
FLAGS
-f, --stateFile=<value> (required) state file to use
-p, --parameter=<value>... [default: ] parameters for the package, in the form of 'key=value'. Can be specified
multiple times.
-w, --workspace=<value> workspace to import into
--chdir=<value> Directory where the command will be executed.
If not specified, it defaults to the current working directory.
Alternatively, you can define the project root by setting the HEREYA_PROJECT_ROOT_DIR
environment variable.
--debug enable debug mode
DESCRIPTION
Import a package resource into your project
EXAMPLES
$ hereya import hereya/my-package -f state.tfstate
$ hereya import org/my-package -f state.tfstate -w my-workspace

Initialize hereya in a project directory.

USAGE
$ hereya init PROJECT -w <value> [--chdir <value>]
ARGUMENTS
PROJECT project name
FLAGS
-w, --workspace=<value> (required) workspace to set as default
--chdir=<value> directory to run command in
DESCRIPTION
Initialize hereya in a project directory.
EXAMPLES
$ hereya init myProject -w=defaultWorkspace
$ hereya init myProject -w=defaultWorkspace --chdir=./myProject

Login to Hereya Cloud

USAGE
$ hereya login [URL] [-t <value>]
ARGUMENTS
URL [default: https://cloud.hereya.dev] URL of the Hereya Cloud instance
FLAGS
-t, --token=<value> Token to use for login
DESCRIPTION
Login to Hereya Cloud
EXAMPLES
$ hereya login
$ hereya login https://cloud.hereya.dev
$ hereya login --token=your-token
$ hereya login --token=your-token https://cloud.hereya.dev

Logout from Hereya Cloud

USAGE
$ hereya logout
DESCRIPTION
Logout from Hereya Cloud
EXAMPLES
$ hereya logout

Publish a package to the Hereya registry

USAGE
$ hereya publish [--chdir <value>]
FLAGS
--chdir=<value> Directory where the command will be executed.
If not specified, it defaults to the current working directory.
DESCRIPTION
Publish a package to the Hereya registry
EXAMPLES
$ hereya publish
$ hereya publish --chdir=/path/to/package

Remove a package from the project.

USAGE
$ hereya remove PACKAGE [--chdir <value>] [--debug] [-w <value>]
ARGUMENTS
PACKAGE Remove a previously added package.
FLAGS
-w, --workspace=<value> name of the workspace to remove the package from (defaults to current workspace)
--chdir=<value> Directory where the command will be executed.
If not specified, it defaults to the current working directory.
Alternatively, you can define the project root by setting the HEREYA_PROJECT_ROOT_DIR
environment variable.
--debug enable debug mode
DESCRIPTION
Remove a package from the project.
EXAMPLES
$ hereya remove cloudy/docker_postgres

Run a command with hereya env vars.

USAGE
$ hereya run CMD... [--chdir <value>] [-w <value>]
ARGUMENTS
CMD... command to run
FLAGS
-w, --workspace=<value> name of the workspace to run the command in
--chdir=<value> directory to run command in
DESCRIPTION
Run a command with hereya env vars.
EXAMPLES
$ hereya run -- npm run dev
$ hereya run -w uat -- node index.js

Uninstall hereya resources deployed with bootstrap command.

USAGE
$ hereya unbootstrap INFRASTRUCTURETYPE [-f]
ARGUMENTS
INFRASTRUCTURETYPE infrastructure to unbootstrap. Options are local, aws
FLAGS
-f, --force try to delete hereya resources even if not deployed
DESCRIPTION
Uninstall hereya resources deployed with bootstrap command.
EXAMPLES
$ hereya unbootstrap aws
$ hereya unbootstrap local

Undeploy a hereya project by removing all resources.

USAGE
$ hereya undeploy -w <value> [--chdir <value>] [--debug]
FLAGS
-w, --workspace=<value> (required) name of the workspace to undeploy the packages for
--chdir=<value> Directory where the command will be executed.
If not specified, it defaults to the current working directory.
Alternatively, you can define the project root by setting the HEREYA_PROJECT_ROOT_DIR
environment variable.
--debug enable debug mode
DESCRIPTION
Undeploy a hereya project by removing all resources.
EXAMPLES
$ hereya undeploy

Provision all packages in the project.

USAGE
$ hereya up [--chdir <value>] [--debug] [--deploy] [-s <value>...] [-w <value>]
FLAGS
-s, --select=<value>... [default: ] select the packages to provision
-w, --workspace=<value> name of the workspace to install the packages for
--chdir=<value> Directory where the command will be executed.
If not specified, it defaults to the current working directory.
Alternatively, you can define the project root by setting the HEREYA_PROJECT_ROOT_DIR
environment variable.
--debug enable debug mode
--deploy provision deployment companion packages
DESCRIPTION
Provision all packages in the project.
EXAMPLES
$ hereya up

Create a new workspace if it does not exist.

USAGE
$ hereya workspace create NAME [-d] [--mirror <value>] [--profile <value>]
ARGUMENTS
NAME name of the workspace to create
FLAGS
-d, --deployment mark workspace as a deployment workspace
--mirror=<value> workspace to mirror
--profile=<value> workspace profile to set (cloud backend only)
DESCRIPTION
Create a new workspace if it does not exist.
EXAMPLES
$ hereya workspace create dev

Delete a workspace if it exists.

USAGE
$ hereya workspace delete NAME
ARGUMENTS
NAME name of the workspace to delete
DESCRIPTION
Delete a workspace if it exists.
EXAMPLES
$ hereya workspace delete dev

Print workspace env vars.

USAGE
$ hereya workspace env [NAME] -w <value> [-l]
ARGUMENTS
NAME name of the env to display
FLAGS
-l, --list list only the env vars without values
-w, --workspace=<value> (required) name of the workspace to print env vars for
DESCRIPTION
Print workspace env vars.
EXAMPLES
$ hereya workspace env -w dev
$ hereya workspace env myEnv -w dev

set an env var for a workspace

USAGE
$ hereya workspace env set -i <value> -n <value> -v <value> -w <value> [-s]
FLAGS
-i, --infra=<value> (required) the infrastructure to store the env var in
-n, --name=<value> (required) name of the env var to set
-s, --sensitive whether the env var is sensitive
-v, --value=<value> (required) value of the env var to set
-w, --workspace=<value> (required) name of the workspace to set an env var for
DESCRIPTION
set an env var for a workspace
EXAMPLES
$ hereya workspace env set -w my-workspace -n myVar -v my-value -i aws -s

unset an env var for a workspace

USAGE
$ hereya workspace env unset -n <value> -w <value>
FLAGS
-n, --name=<value> (required) name of the env var to unset
-w, --workspace=<value> (required) name of the workspace to unset an env var for
DESCRIPTION
unset an env var for a workspace
EXAMPLES
$ hereya workspace env unset -w my-workspace -n myVar

Add a package to the workspace.

USAGE
$ hereya workspace install PACKAGE -w <value> [--debug] [-p <value>...] [-f <value>]
ARGUMENTS
PACKAGE The package to add. Packages are gitHub repositories. Use the format owner/repository
FLAGS
-f, --parameter-file=<value> path to a file containing parameters for the package
-p, --parameter=<value>... [default: ] parameter for the package, in the form of 'key=value'. Can be specified
multiple times.
-w, --workspace=<value> (required) name of the workspace to add the package to
--debug enable debug mode
DESCRIPTION
Add a package to the workspace.
EXAMPLES
$ hereya workspace install hereya/aws-cognito

List workspaces.

USAGE
$ hereya workspace list
DESCRIPTION
List workspaces.
EXAMPLES
$ hereya workspace list

Set AWS profile and deployment status for a workspace (cloud backend only).

USAGE
$ hereya workspace set-profile PROFILE -w <value> [-d]
ARGUMENTS
PROFILE AWS profile name to set for the workspace
FLAGS
-d, --[no-]deployment mark workspace as a deployment workspace (use --no-deployment to unset)
-w, --workspace=<value> (required) workspace name
DESCRIPTION
Set AWS profile and deployment status for a workspace (cloud backend only).
EXAMPLES
$ hereya workspace set-profile prod-profile -w production

Remove a package from a workspace.

USAGE
$ hereya workspace uninstall PACKAGE -w <value> [--debug] [-p <value>...] [-f <value>]
ARGUMENTS
PACKAGE The package to remove. Packages are gitHub repositories. Use the format owner/repository
FLAGS
-f, --parameter-file=<value> path to a file containing parameters for the package
-p, --parameter=<value>... [default: ] parameter for the package, in the form of 'key=value'. Can be specified
multiple times.
-w, --workspace=<value> (required) name of the workspace to remove the package from
--debug enable debug mode
DESCRIPTION
Remove a package from a workspace.
EXAMPLES
$ hereya workspace uninstall hereya/aws-cognito