Skip to main content

CLI Reference

In this document, you can find the full list of Raftt CLI commands and usage information.

Help information is also available by running raftt --help, or raftt -h.

raftt

Manage your development environment with ease

Usage:
raftt
raftt [command]

Available Commands:
cleanup Clean a Kubernetes namespace from the changes performed on and after 'raftt connect' by Raftt.
cluster Manage global cluster properties
config Get and set global Raftt options
connect Connect to an existing Kubernetes namespace
cp Copy files to and from a workload
data Reset or persist the data of a workload
dev Transform one or more resources into development mode
disconnect Disconnect from current active session
doctor Send local diagnostics to Raftt
down Delete environment
envlogs Show the output of all commands that control the env.
expose Share access to one or more workloads
init Initialize Raftt for the current git repository
list List connected environments
logs Get the logs of a workload or hooks
port Control port forwarding to remote environment
rebuild Rebuild and deploy one or more workloads
restart Restart a workload
setup Create the first raftt.yml file
sh Connect or run a command on a workload
share Generate access token for environment sharing
status Show the status of the current Raftt environment
stop Stop one or more workloads
sync Synchronize local auxiliary repositories
up Spawn or reconnect to a Raftt environment
version Show the Raftt version information

Use "raftt [command] --help" for more information about a command.

Command List

raftt cleanup

Clean a Kubernetes namespace from the changes performed on and after 'raftt connect' by Raftt. If no namespace is provided, the namespace connected to the current context is used.

Usage:
raftt cleanup

Flags:
--context string Specify alternate kube context to cleanup
--direct Cleanup Raftt environment controller created directly over kubernetes context
--force Force cleanup Raftt environment controller and all dev-mode resources

raftt cluster

Manage global cluster properties (secrets, envs, ...)

Usage:
raftt cluster [command]

Available Commands:
envs Lists all the environments in the cluster
secrets Perform actions on cluster secrets

Use "raftt cluster [command] --help" for more information about a command.

raftt cluster envs

Lists all the environments in the cluster. Only available for users with the required permissions.

Usage:
raftt cluster envs

raftt cluster secrets

Set, delete or list global cluster secrets

Usage:
raftt cluster secrets [command]

Available Commands:
delete Delete a global cluster secret
list List global cluster secrets
set Set a global cluster secret

Use "raftt cluster secrets [command] --help" for more information about a command.

raftt cluster secrets delete

Delete a global cluster secret

Usage:
raftt cluster secrets delete SECRET_NAME

Flags:
--force force deletion

raftt cluster secrets list

List all secrets defined in the cluster

Usage:
raftt cluster secrets list

raftt cluster secrets set

Set a global cluster secret

Usage:
raftt cluster secrets set SECRET_NAME

Flags:
-f, --file string file from which to read secret

raftt config

Usage:
raftt config [command]

Available Commands:
debug Debug raftt starlark configuration
get Get a global Raftt configuration
list List global Raftt configurations
set Set a global Raftt configuration

Use "raftt config [command] --help" for more information about a command.

raftt config debug

Debug raftt starlark configuration

Usage:
raftt config debug

Flags:
--config-args string A string that is passed to the env config file. Only relevant when using envDefinition in raftt.yml.
--config-args-file string Path to file to use as the input string passed to the env config file. Only relevant when using envDefinition in raftt.yml.
--to-be-deployed print the list of resources to be deployed

raftt config get

Usage:
raftt config get KEY

raftt config list

Usage:
raftt config list

raftt config set

Usage:
raftt config set KEY VALUE

Flags:
-f, --force Don't prompt for confirmation when modifying configuration

raftt connect

Connect to an existing Kubernetes namespace

Usage:
raftt connect [NAMESPACE]

Flags:
--context string Specify alternate kube context to connect with
--direct Create Raftt Environment Controller directly over kubernetes context
-d, --disconnect Disconnect from the current environment, without releasing any resources

raftt cp

Copy files to and from a workload. Omitting the workload name means referring to the local machine.

Usage:
raftt cp [WORKLOAD:]source ... [WORKLOAD:]target

Flags:
-c, --container string Copy files to a specific container within a workload

raftt data

Reset or persist the state of one or more databases to / from git or the cloud

Usage:
raftt data [command]

Available Commands:
dump Dump the state of a database to a file in the git repository
load Load a previously saved DB state according to a tag
save Commit the state of one or more databases to the cloud according to a tag
seed Seeds the state of one or more databases from git or the cloud

Use "raftt data [command] --help" for more information about a command.

raftt data dump

Dump the state of one or more databases to a file in the git repository

Usage:
raftt data dump WORKLOAD [...]

raftt data load

Load a previously saved DB state according to a tag of one or more databases from the cloud

Usage:
raftt data load WORKLOAD -t TAG

Flags:
-s, --shared Load the tag from the shared tag pool
-t, --tag string Reset to a specific tag, applies to all services being seeded

raftt data save

Commit the state of one or more databases to the cloud according to a supplied tag

Usage:
raftt data save WORKLOAD -t TAG

Flags:
-s, --shared Save this tag to the shared tag pool to allow others to access it
-t, --tag string Commit to a specific tag, applies to all services being seeded

raftt data seed

Seeds the state of one or more databases according to git or the cloud

Usage:
raftt data seed WORKLOAD [...]

raftt dev

Transform one or more resources into development mode

Usage:
raftt dev [RESOURCES...]

Flags:
-u, --undev Leave dev-mode and return the resource(s) to their original state

raftt disconnect

Disconnect from current active session

Usage:
raftt disconnect

raftt doctor

Send local diagnostics to Raftt

Usage:
raftt doctor

Aliases:
doctor, diagnostics

Flags:
-m, --message string Add a message to explain to Raftt what happened

raftt down

Delete environment that is currently connected or exists for this branch.

Usage:
raftt down

Flags:
-a, --all all envs
-d, --delete delete env (no longer required, as this is the default behavior)
-f, --force Don’t prompt when using the --all flag
--hibernate hibernate env instead of deleting
-w, --wait wait for logs

raftt envlogs

Show the output of all commands that control the env. These commands are up, down, connect, disconnect, cleanup, rebuild and `dev.

Usage:
raftt envlogs

Flags:
-f, --follow Follow log output
--since string Show logs since timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes)
-n, --tail string Number of lines to show from the end of the logs (default "all")
-t, --timestamps Show timestamps
--until string Show logs before a timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes)

raftt expose

Share access to one or more workloads through a publicly accessible URL

Usage:
raftt expose WORKLOAD_NAME [...]

Flags:
-d, --delete Stop exposing a workload
--password-fd string File to read password for authentication
-p, --port uint16 The port to expose. If the workload has exactly one port, defaults to it. Otherwise, must be specified.
-u, --user string Username for authentication

raftt init

Initialize Raftt for the current git repository. Run once per git repository.

Usage:
raftt init

Flags:
-F, --force force overwrite current user token

raftt list

List connected environments

Usage:
raftt list

raftt logs

Get the logs of a workload or hooks

Usage:
raftt logs WORKLOAD

Flags:
-c, --container string Show logs for specific container within a workload
-f, --follow Follow log output
--hooks Show the logs for the event hooking mechanism. Can be used with or without specifying a workload.
--since string Show logs since timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes)
-n, --tail string Number of lines to show from the end of the logs (default "all")
-t, --timestamps Show timestamps
--until string Show logs before a timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes)

raftt port

Control port forwarding to remote environment

Usage:
raftt port [command]

Available Commands:
map Forward local port(s) to remote env
unmap Unmap local ports from remote env

Use "raftt port [command] --help" for more information about a command.

raftt port map

Map local port(s) to remote env

Usage:
raftt port map [-r|SERVICE] [LOCAL_PORT:]REMOTE_PORT

Flags:
-r, --reverse Forward from remote service to local machine instead (reverse tunnel), accessible from the dev env by "localmachine"

raftt port unmap

Unmap local ports from remote env

Usage:
raftt port unmap LOCAL_PORT

Flags:
-r, --reverse unmap reverse tunnel

raftt rebuild

Rebuild and deploy one or more workloads. If no workloads specified, the entire environment is rebuilt and deployed.

Usage:
raftt rebuild [SERVICES...]

Flags:
--add-remove Only start resources added to the env definition and delete resources that were removed
--compose-profile stringArray Stating which docker-compose profile to use. Use multiple times to start multiple profiles. Not relevant when using envDefinition in raftt.yml.
--config-args string A string that is passed to the env config file. Only relevant when using envDefinition in raftt.yml.
--config-args-file string Path to file to use as the input string passed to the env config file. Only relevant when using envDefinition in raftt.yml.
-r, --reseed re-seed DBs
--setup Run initial setup before creating the environment

raftt restart

Restart the main process of a workload. NOTE: The container itself isn't restarted and any changes made to it will remain.

Usage:
raftt restart WORKLOAD [OPTIONS] -- [ALTERNATIVE_ARGUMENTS]

Flags:
-c, --container string Specify specific container within a workload
-e, --env stringArray Specify environment variables to set for the process
--env-file string Specify a file to read environment variables from
-n, --no-interrupt-interactive Restart only if a non-interactive process (i.e. not through execute / debug) is currently running
-w, --workdir string Specify workdir to set for the process

raftt setup

Help with the setup of the Raftt environment

Usage:
raftt setup

Flags:
-d, --dev-container-folder string Folder under the git root to put the dev-container dockerfile at (default "dev")
--direct Generate default configuration for direct connection flow

raftt sh

Connect or run a command on a workload using the SSH protocol

Usage:
raftt sh SERVICE [flags] [-- COMMAND]

Flags:
-c, --container string connect to a specific container within a workload
--share-token string Connect to another env using a share token
-t, --tty Allocate a pseudo-TTY. Use with caution, forcing interactive might cause unexpected behavior

raftt share

Generate access token for environment sharing

Usage:
raftt share

raftt status

Show the status of the current Raftt environment. If one or more workloads are stated, only show their status.

Usage:
raftt status [WORKLOADS ...]

Flags:
-d, --debug show debug information
-w, --wait wait for environment to spawn

raftt stop

Stop the main process and its children of one or more workloads

Usage:
raftt stop WORKLOAD

Flags:
-c, --container string Specify specific container within a workload

raftt sync

Synchronize local auxiliary repositories to an existing raftt environment

Usage:
raftt sync

Flags:
-d, --unsync unsync currently synced repository

raftt up

Spawn a new Raftt environment or reconnect to an existing one

Usage:
raftt up

Flags:
--compose-profile stringArray Stating which docker-compose profile to use. Use multiple times to start multiple profiles. Not relevant when using envDefinition in raftt.yml.
--config-args string A string that is passed to the env config file. Only relevant when using envDefinition in raftt.yml.
--config-args-file string Path to file to use as the input string passed to the env config file. Only relevant when using envDefinition in raftt.yml.
--non-interactive Execute this command without UI (used for plugins)
--setup Run initial setup before creating the environment

raftt version

Shows the version information of the Raftt executable

Usage:
raftt version

Flags:
-s, --silent Show version only