State Tool CLI

The State Tool is the CLI client that interfaces with the ActiveState Platform. It can be used to install and manage ActiveState runtimes as well as act as a package manager to install packages from our trusted artifacts package repository.

Topics

Install the State Tool

Open a command prompt and run the following command:

sh <(curl -q https://platform.activestate.com/dl/cli/install.sh)

Open a command prompt and run the following command:

powershell -Command "& $([scriptblock]::Create((New-Object Net.WebClient).DownloadString('https://platform.activestate.com/dl/cli/install.ps1')))"

Once installed it is recommended that you close your command prompt and start a new one to ensure your environment is properly updated. While our install process uses PowerShell under the hood the State Tool does not yet officially support PowerShell, though its been known to work for various PowerShell use cases.

Sign in to the ActiveState Platform

If you don’t have a Platform account yet, you need to sign up:

state auth signup 

Enter the requested information at the prompt to register your account. You will receive an email to verify your account. You have limited permissions to the Platform before you verify it. After registering your account you can sign in.

If you already have an ActiveState Platform account, or you just created an account you need to sign in:

state auth

Enter your username and password for the Platform at the prompts.

Create a new project locally

state init <username_or_org_name>/<project_name> language@version

For example:

state init jsmith/python-3-6 python3@3.6.6

Change directories into your project folder

cd <username_or_org_name>/<project_name>
cd <username_or_org_name>\<project_name>

Push your project to the ActiveState Platform

state push

Add required packages for your project

state packages add requests@2.21.0
state packages add pandas

For Python projects, if you have a requirements.txt file, you can alternatively import all your packages using the file.

state packages import --file requirements.txt

For Perl projects, if you have a cpanfile or META.json file, you can import all your packages using the file.

state packages import --file cpanfile
state packages import --file META.json

Synchronize your local project with the Platform project

state pull

Activate your project

state activate

Access documentation for CLI commands

To learn more about the State Tool commands, run state --help in the terminal.

For help on individual commands, run state COMMAND --help. For example, state packages --help.

For more information on the State Tool and the available commands see the State Tool section of the docs.