Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@animaapp/anima-cli

Package Overview
Dependencies
Maintainers
7
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@animaapp/anima-cli

Anima CLI for storybook

  • 1.1.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
7
Weekly downloads
 
Created
Source
Anima CLI

Anima CLI npm

Anima CLI is a command line tool that works in conjunction with the Anima Figma Plugin to transform Storybook stories into Figma components and your design tokens into Figma styles.

You can learn more about the whole Design System workflow in our Anima Design System Automation guide.

Quick start

Run the following command in the folder you have Storybook installed:

npx @animaapp/anima-cli sync -t <anima-team-token> --storybook

Warning Heads up! You'll need an Anima team token to use the CLI. You can get one from the Anima Plugin ↗️ under the Manage Design System screen.

Setup

1. Installation

Run the following command (with your preferred package manager) in the repo with your Storybook:

npm add -D @animaapp/anima-cli
yarn add -D @animaapp/anima-cli
pnpm add -D @animaapp/anima-cli

2. Add your unique Anima team token

After installing the anima-cli, we recommend adding the Anima team token as an environment variable. This way, you won't need to pass it as an argument when you run the CLI.

Create a .env file in the root of your Storybook project with the following contents:

#.env
ANIMA_TEAM_TOKEN="paste-your-token-here"

3. Specify the path to your design tokens

If you want to sync your design tokens, you can also specify the path to your tokens in the CLI command.

npx @animaapp/anima-cli sync --storybook --design-tokens <path-to-design-tokens-JSON-file>

Warning Heads up! You can also specify the path to your design tokens in a anima.config.js file, you can learn more about other configuration options

Usage

Sync Storybook to Anima

To sync your Storybook with Anima, run the following command:

anima sync --storybook

If you are not using the default Storybook build folder storybook-static, you'll need to specify the path to your custom Storybook build folder. For example:

anima sync --storybook ./custom-bulid-folder

Sync your Storybook and design tokens to Anima

To sync both your design tokens and Storybook, run the following command:

anima sync --storybook --design-tokens ./design-tokens.json

Sync your design tokens only

anima sync --design-tokens ./design-tokens.json

Command API

anima generate-storybook (experimental)

Initialize and generate storybook config for your project (only needed if you do not already have storybook).

anima generate-storybook [option]
Options
OptionsDescriptionType
--token, -tProvide an Anima team token if it was not set as environment variablestring
--components, -dTo specify the components folder of your projectstring
--component, -cTo specify a single component to generate config forstring
--buildDir, -bTo specify the build directory of your projectstring
--skipInstallTo skip storybook installboolean

anima sync

Syncs your Storybook and/or design tokens to your Anima team so that it cant then be generated in Figma.

Usage

anima sync [options]

Options

OptionDescriptionType
--token, -tProvide an Anima team token if it was not set as environment variablestring
--storybook, -sTo specify the Storybook build folder, otherwise it uses Storybook's default storybook-static boolean | string                     
--design-tokens, -d              Provide a path to your design tokens file, e.g., ./design-tokens.jsonstring
--basePath, -bIf your project uses Vite, you can provide a base pathstring

anima generate-tokens

Generates design tokens from your framework config file. Learn more about these work in Design token transformers.

Usage

anima generate-tokens [options]
Options
OptionDescriptionType
--framework, -f       Provide your framework name i.e. tailwindstring
--config , -cProvide your framework config file i.e. ./tailwind.config.cjsstring
--output , -oProvide an output path of your Design Tokens file, i.e. ./design-tokens.jsonstring

Configuration file API

You can specify a number of variables in an anima.config.js file.

OptionDescriptionType
design_tokensProvide the path to your design tokens filestring
build_commandProvide the command used to build your storybookstring
Example
// anima.config.js
module.exports = {
  design_tokens: '<path to design tokens JSON file>', // e.g. "./design-tokens.json"
};

Keywords

FAQs

Package last updated on 27 Jun 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc