Get Started
Quickstart
Stylebit CLI tool is designed to analyze design system adoption in codebase. It will crawl the codebase and will try to find all the places where the design system is used and calculate adoption rate.
- Supports
React/Typescript
for components as well asscss/css
for design tokens. - Support
React Native
. - Supports
WebComponents
(alpha).
installation
Get access token
Run locally
NOTE: --config
option is required
Manual
usage: stylebit [options] [command]
usage: stylebit [options] [command]
usage: stylebit run [options]
usage: stylebit run [options]
config file options
config file options
- crawlFrom: string - path to the directory to start crawling from (required). The directory there the UI components are located, FE code is located, etc.
- componentRoot: string - path to the directory where the you UI library components are located (use either this or
packageName
) - packageName: string - name of the package where the you UI library components are located (use either this or
componentRoot
) - outputFile: string - path to the output file. Only available for —dry-run mode, if not provided, the tool will log to the console
- projectId: string - You can get
projectId
by creating a project in http://app.stylebit.io. For--dry-run
modeprojectId
in NOT required. - tag: string - You can optionally tag your scan or series of scans.
- ignore Array[string] - You can optionally specify glob pattern to ignore paths for files from being scanned. If the field is not specified the it results to the following default:
- scss: boolean - specifying the field
true
will track design tokens inscss
andcss
files. - css: boolean - specifying the field
true
will track design tokens incss
files.
sample configs
sample configs
sample 1
sample 2
Troubleshooting
It’s recommended to install stylebit cli globally. Make sure you have it installed globally before moving forward.
- If you select technology but nothing happens make sure you provide correct config.json path. To see exact message run in
--verbose
mode - If you see an error make sure you are logged in.ENOENT: no such file or directory, open ‘$Home/.stylebit/credentials’
stylebit login
will navigate you to the browser. Log in there and you will get your credentials for the cli. If you were logged in, probably your token has expired. Try to login again.