Using the State Tool – Quickstart

Table of Contents

Creating a new project

You can create a new ActiveState project directly from your command line by entering:

state init <orgname>/<projectname> --language <language@version>

For example: state init jsmith/python-3.10 --language python@3.10

Your project will be automatically synced with your Platform account.

Downloading your runtime

To download your runtime from the ActiveState Platform to a location on your local machine, enter the following command:

state checkout <orgname>/<projectname> --runtime-path <location of folder>

For example: state checkout jsmith/python-3.10 --runtime-path C:\python

If you are already in the directory you want to use as the location of the runtime, you can simply run:

state checkout <orgname>/<projectname> 

More information on how to download your runtime to your local machine can be found here.

Using your runtime

After checking out your project from the Platform to your local machine, you have two options for activating and using your runtime:

Option 1: Set as user default

To set your runtime as your user default, enter:

state use <orgname>/<projectname>

Option 2: Create a virtual environment

To create a virtual environment for your project, enter:

state shell <orgname>/<projectname>

Managing packages

You can add packages to your project using either the Platform UI or directly from the command line.

Installing packages

To add packages to your project from the command line:

state install <package-name[@version]>

For example: state install requests@2.31.0

Note that the version information is optional. Entering only the package name will default to installing the most recent stable version.

Uninstalling packages

To uninstall a package from your project (no version number is needed):

state uninstall <package-name>

Synchronizing your project

Push local changes to the Platform

To push local changes to your project to the Platform:

state push

Pull Platform changes locally

To sync your local project by pulling in changes made via the Platform:

state pull

Managing local projects

View all local projects

To see the location of all locally checked out projects:

state projects

The output returned will show the name of each project and the location of the folders for that project on the local machine.

Remove a local project

To remove one project at a time, manually remove the folder shown after Executables. Then clean up the Local Checkout by either:

  • Removing the activestate.yaml file from the directory, or
  • In the case of a project folder that contains only your ActiveState project, deleting the project folder.

Additional resources

For more information on package management, see the Package Management documentation.