Plasmic CLI Usage
The Plasmic CLI makes it easy to invoke code generation of Plasmic components as you develop your application.
plasmic -h for the up-to-date reference!
Here are all the commands and high-level descriptions of what they do.
Just login to Plasmic. Generate a ~/.plasmic.auth that is connected to a personal API token for your user.
This command will generate a plasmic.json file and .plasmic.auth (if one doesn’t already exist).
This command will sync designs to local files—this is what powers codegen.
Files in the presentational component library (e.g. PlasmicButton.tsx in
plasmic/) should not be edited, as those changes will be lost next time you run
plasmic sync. Your changes in developer-owned wrapper components (e.g. Button.tsx in
src/) will be unaffected. For these files, we only update imports to reflect any new Plasmic-managed files.
For new projects, you will need to manually specify them on the first sync. Your plasmic.json file will be automatically updated to include them.
$ plasmic sync --projects PROJECT_ID
plasmic watch will listen for new changes from the Studio and automatically sync when any change is detected.
Note: This will only work for projects where
When using codegen, you can freely move files around the filesystem (e.g. using
git mv). Use this command to fix import paths and your plasmic.json file.
Note: this is run automatically as part of
Query for information about a project, optionally in JSON format. Useful for automation to dump out latest version, version history, etc.