Berryjam Command Line Interface
General
Options
When running Berryjam CLI at the top level, there are two options, namely --version
and --help
.
-V
, --version
gets the current version of your Berryjam CLI in your local machine.
npx berryjam-cli@latest -V
-h
, --help
lists possible commands in Berryjam CLI.
npx berryjam-cli@latest -h
Commands
Currently, there are 4 commands, namely login
, logout
, workspaces
and scan
.
login
will prompt you to login with email and password.
npx berryjam-cli@latest login
logout
will log you out of your Berryjam account.
npx berryjam-cli@latest logout
workspaces
will list the workspace(s) you can access with respective user role(s). You need to login before using this command.
npx berryjam-cli@latest workspaces
scan
is for scanning your project to analyze your components. We will be explaining in more details in the next section.
Scan Overview
Scan command always requires <your-vue-project-path>
as a directory of your vue project to scan. Since the scan command will scan to a specific workspace (Berryjam Cloud), the CLI will prompt for a login if you have not already done so.
-h
, --help
lists out existing options for Berryjam CLI’s scan command.
npx berryjam-cli@latest scan -h
--ignore
will exclude file path(s) or directories from scan. By default, Berryjam ignores ["node_module", "dist", "build", "cache", ".spec.", ".test."] from scan.
npx berryjam-cli@latest scan vue-project-path --ignore <target>
Note: <target>
could be .service or .json or others.
--verbose
will provide a detailed log output via the CLI.
npx berryjam-cli@latest scan vue-project-path --verbose
Note: If you are at the root directory of your vue project and wish to run the scan command you can replace <your-vue-project-path>
with .
too.
Scan to workspace
You may specify a workspace for Berryjam to scan to if you have multiple workspaces. If you do not specify, Berryjam CLI will prompt you to confirm or choose.
-w, --workspace
, together with your workspace name, will direct the CLI to scan to that particular workspace.
npx berryjam-cli@latest scan vue-project-path -w workspace-name
Raw Result
After the scan is complete, the data is stored in the Berryjam application folder in JSON format. The file name is components.json
. You can get to the JSON file by running two consecutive commands in your preferred terminal.
Find the Berryjam application folder and open the file:
open $HOME/.berryjam/components.json
Note: For Windows users, please replace open $HOME
with start %userprofile%
.