Tokens Studio CLI
Tokens Studio offers an NPM package that you can integrate with your systems. This package allows you to connect directly to the Tokens Studio platform and pull tokens directly into your project.
You may find this useful if you use build pipelines and want to ensure that you have the latest token data in your projects during deployments.
Prerequisites:
Key Features of the CLI
Current Features:
Pull token sets into local files.
Simplify organization and project selection.
Planned Features:
Watch Mode: Automatically sync changes from Studio to local files.
Release Artifacts: Pull releases directly instead of token sets.
System Requirements
Node v22 or greater is installed https://nodejs.org/en/download
Installing the CLI
Using the CLI
Once installed, you can run commands using npx tokensstudio
Available Commands
You can run npx tokensstudio --help to view all available commands from the CLI.
Setting up your project with the CLI
You will need an API key generated from the Tokens Studio platform. If you don't have this available, you can follow these instructions to generate one.
Once installed, you will need to configure the CLI to use your Tokens Studio account.
Pull Tokens into your project
In the .tokensstudio.json file, edit the output property value to be the local project directory where you'd like the tokens to be stored. For example, if your project uses a src directory, you would want to change that to "output": "src/tokens"
Use the pull command to download the tokens from Tokens Studio to your project.
Last updated