Command Reference

Table of Contents

Environment Management

state activate

Activate a project

Usage

state activate [flags] <org/project>

Arguments

  • <org/project> (optional) The namespace of the project that you wish to activate

Flags

  • --path Where to install the project
  • --default Configures the project to be the global default project
  • --branch Defines the branch to be used

Example

state activate ActiveState/Python-3.9 --default

state exec

Intercept and run a script via a project runtime environment

Usage

state exec [flags]

Flags

  • --path The path of the project that you want to use the runtime environment of. If no path is given the current working directory is used.

Example

state exec python script.py

state projects

List your projects

Usage

state projects

state projects remote

List all projects, including ones you have not checked out locally

Usage

state projects remote

state run

Run your project scripts

Usage

state run  <script>

Arguments

  • <script> Name of script to run

Example

state run build

Package Management

state import

Import packages from a list of dependencies

Usage

state import [flags] <File>

Arguments

  • <File> The file to import

Flags

  • --force Run import operation without prompts

Example

state import requirements.txt

state install

Add a new package to your project

Usage

state install  <name[@version]>

Arguments

  • <name[@version]> Package name and optionally the desired version

state packages

Lists packages used in your project

Usage

state packages [flags]

Flags

  • --commit The commit that the listing should be based on
  • --package The filter for package names to include in the listing
  • --namespace The namespace packages should be listed from

state uninstall

Remove a package from your project

Usage

state uninstall  <name>

Arguments

  • <name> Package name

Platform

state auth

Authenticate against the ActiveState Platform

Usage

state auth [flags]

Flags

  • --token The API Token generated via the ActiveState Platform
  • --username The username to authenticate with
  • --password The password to authenticate with
  • --totp The TOTP code generated via two-factor authentication (must be used in conjunction with username and password flags)
  • --prompt Sign in via your terminal, rather than your web browser.

state auth logout

Logout

Usage

state auth logout

state auth signup

Signup a new account

Usage

state auth signup [flags]

Flags

  • --prompt Sign up via your terminal, rather than your web browser.

Version Control

state fork

Fork an existing ActiveState Platform project

Usage

state fork [flags] <org/project>

Arguments

  • <org/project> The namespace of the project to be forked

Flags

  • --org The organization to fork the project to
  • --name The name of the new project to be created
  • --private Denotes if the forked project will be private

Example

state fork ActiveState/Python-3.9 --org MyOrg --name Python

state history

View history of the active or given project

Usage

state history [flags]

Flags

  • --namespace The namespace to view the history for in the format of < org/project>

state pull

Pull in the latest version of your project from the ActiveState Platform

Usage

state pull [flags]

Flags

  • --set-project Pull from the specified project instead of the checked out one

state push

Push your latest changes to the platform

Usage

state push  <org/project>

Arguments

  • <org/project> (optional) The project to push to (uses project under current dir otherwise).

state reset

Reset local checkout to be equal to the project on the platform.

Usage

state reset

state revert

Revert a commit

Usage

state revert  <commit-id>

Arguments

  • <commit-id> The commit ID to revert to

Utilities

state clean cache

Removes cached Runtime Environments

Usage

state clean cache  <org/project>

Arguments

  • <org/project> (optional) The project to be removed from the local cache.

state clean config

Removes global State Tool configuration. Project configuration will not be affected.

Usage

state clean config [flags]

Flags

  • --force, -f Run clean config operation without prompts and ignoring any errors stopping running services

state clean uninstall

Remove the State Tool, installed languages, and any configuration files

Usage

state clean uninstall [flags]

Flags

  • --force, -f Run uninstall operation without prompts and ignoring any errors stopping running services

state config get

Print config values to the terminal

Usage

state config get  <key>

Arguments

  • <key> Config key

Example

state config get autoupdate

state config set

Set config values using the terminal

Usage

state config set  <key> <value>

Arguments

  • <key> Config key
  • <value> Config value

Example

state config set optin.unstable true

state export jwt

Print jwt credentials

Usage

state export jwt

state export new-api-key

Create and print new API key

Usage

state export new-api-key  <name>

Arguments

  • <name> API key name

state export private-key

Exports the private key, useful if you want to set it via environment variable ( ACTIVESTATE_PRIVATE_KEY)

Usage

state export private-key

state learn

Read the State Tool cheat sheet to learn about common commands

Usage

state learn

state update

Updates the State Tool to the latest available version

Usage

state update [flags]

Flags

  • --set-channel Switches to the given update channel, eg. ‘release’.
  • --set-version Switches to the given State Tool version.

state update lock

Lock the State Tool at the current version, this disables automatic updates.

Usage

state update lock [flags]

Flags

  • --set-channel Switches to the given update channel, eg. ‘release’.
  • --force Automatically confirm that you would like to update the State Tool version that your project is locked to.