This guide is aimed at our Enterprise Customers who are getting familiar with the ActiveState Platform and want to learn about how to incorporate the State Tool CLI tool into their workflow.
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 Package Manager that can be used to install packages from our Trusted Artifacts package repository.
You can install the State Tool by running the command below, but it will also be automatically installed when you follow the CLI install instructions for any runtime that are displayed on the Platform Web UI.
Run this in your Command Prompt (cmd.exe)
powershell -Command "& $([scriptblock]::Create((New-Object Net.WebClient).DownloadString('https://platform.activestate.com/dl/cli/pdli01/install-latest.ps1')))"
sh <(curl -q https://platform.activestate.com/dl/cli/install.sh)
Make sure you shut down all runing instances of the State Tool and then run…
state clean uninstall
If you run into any issues uninstalling, you can also follow the manual instructions.
As an Enterprise customers, you’ll most likely be working with private projects, meaning that you have to be a member of the organization on the Platform in which they were created. You’ll need to sign in from the CLI.
If you don’t have a Platform account yet, let one of the members of our Customer Success team know and they’ll help you out.
Run the following command and follow the prompts.
To install a runtime, you can either find the installation command on the Platform site when you navigate to your project or directly from the command line if you know the project’s name and parent organization.
Working with a private project? Make sure you authenticate with the State Tool before installing, follow instructions above!
For all projects on the the Platform Web UI, you’ll notice command line instructions like the ones below. Run them in your command line terminal to install the corresponding runtime.
To find a project, first navigate to your organization from platform.activesate.com/organizations, then click on the desired project name. On the next, page, click the Install button to display the instructions.
If you already have the State Tool installed and you know the project you want to download & install, you can run the command below, replacing the
<project-name> with the ones the correspond to the Platform project you are installing. For personal projects that are not in an organization, use your username where the organization name goes.
state activate <organization-name>/<project-name>
The State Tool is designed to help you manage multiple Platform runtimes on the same machine. You can switch between runtimes by “activating” them, which starts up a virtual environment for that runtime.
A virtual environment creates an isolated shell that gives you access to the language & packages in your runtime, but does not affect your system as a whole.
state list projects
You’ll need to include both the orgnization name and the project name in the command.
state activate orgname/projectname
When you exit a virtual environment that was activated with
-default flag, the installed runtime will still be available to your system.
state activate -default orgname/projectname
The State Tool is also a package manager that you can use to install, remove and change versions of packages in your runtime.
state search <package-name>
state install <package-name[@version]>
The version specification is optional.
When you install or remove packages, your local runtime gets updated but the changes will not be available for other to use until you sync your runtime with the Platform. See the section below on how to do that.
All packages installed with the State Tool or Platform Web UI come from our own package ecosystem. They have been ingested from various public package repositories and are built from source. If you can’t find a package you are looking for, let us know.
When working with a team, you might want to make the changes you are making to your runtime (like when you install new packages) to be availble to the rest of your team. Conversely, if someone else on your team has made a change, you’ll wan to bring your local environment up to date.
The Platform keeps a history of all the changes made to your Project, and you can restore your runtime to any previous configuration.
In the Web UI, navigate to the History tab when browsing your project for more information.
state --helpin the terminal.
state COMMAND --help. For example,
state install --help.