Skip to main content

CLI Reference

Commands that are marked as workspace only must be executed inside a workspace. Commands that are marked as not workspace only, can be executed from anywhere and will run on a remote server.

add#

Alias: a
Workspace only: yes
Description: add any subset of files to be tracked as a component(s)
all flags support glob patterns and {PARENT} {FILE_NAME} annotations
https://docs.bit.dev/docs/add-and-isolate-components

bit add [path...]

OptionOption aliasDescription
--id <name>-imanually set component id
--main <file>-mdefine entry point for the components
--tests <file>/"<file>,<file>"-tspecify test files to track. use quotation marks to list files or use a glob pattern
--namespace <namespace>-norganize component in a namespace
--exclude <file>/"<file>,<file>"-eexclude file from being tracked. use quotation marks to list files or use a glob pattern
--override <boolean>-ooverride existing component if exists (default = false)

app-list#

Workspace only: yes
Description: list all registered applications

bit app-list

OptionOption aliasDescription
--json-jreturn the component data in json format

build#

Workspace only: yes
Description: run set of tasks for build

bit build [pattern]

OptionOption aliasDescription
--installinstall core aspects in capsules
--reuse-capsulesavoid deleting the capsules root-dir before starting the build
--tasks <string>build the specified task(s) only. for multiple tasks, separate by a comma and wrap with quotes.
specify the task-name (e.g. "TypescriptCompiler") or the task-aspect-id (e.g. teambit.compilation/compiler)
--cache-packages-on-capsule-rootset the package-manager cache on the capsule root
--list-tasks <string>list tasks of an env or a component-id for each one of the pipelines: build, tag and snap

capsule-create#

Workspace only: yes
Description: create capsules

bit capsule-create [componentIds...]

OptionOption aliasDescription
--base-dir <name>-bset base dir of all capsules
--always-new-acreate new environment for capsule
--seeders-only-screate capsules for the seeders only (not for the entire graph)
--id <name>-ireuse capsule of certain name
--json-jjson format
--install-packages-dinstall packages by the package-manager
--package-manager <name>-pnpm, yarn or pnpm, default to npm

capsule-list#

Workspace only: yes
Description: list all capsules

bit capsule-list

OptionOption aliasDescription
--json-jjson format

checkout#

Alias: U
Workspace only: yes
Description: switch between component versions or remove local changes
bit checkout <version> [ids...] => checkout the specified ids (or all components when --all is used) to the specified version
bit checkout latest [ids...] => checkout the specified ids (or all components when --all is used) to their latest versions
bit checkout [ids...] --reset => remove local modifications from the specified ids (or all components when --all is used)
you can use a pattern for multiple ids, such as bit checkout 0.0.1 "utils/*". (wrap the pattern with quotes to avoid collision with shell commands)

bit checkout [values...]

OptionOption aliasDescription
--interactive-merge-iwhen a component is modified and the merge process found conflicts, display options to resolve them
--ours-oin case of a conflict, override the used version with the current modification
--theirs-tin case of a conflict, override the current modification with the specified version
--manual-min case of a conflict, leave the files with a conflict state to resolve them manually later
--reset-rremove local changes
--all-aall components
--verbose-vshowing verbose output for inspection
--skip-npm-installdo not install packages of the imported components
--ignore-package-jsondo not generate package.json for the imported component(s). (it automatically enables skip-npm-install and save-dependencies-as-components flags)
--conf [path]write the configuration file (bit.json) and the envs configuration files (use --conf without path to write to the default dir)
--ignore-distdo not write dist files (when exist)

clear-cache#

Alias: cc
Workspace only: no
Description: clears bit's cache from current working machine
https://docs.bit.dev/docs/workspace#cache

bit clear-cache


cli#

Workspace only: yes
Description: EXPERIMENTAL. enters bit cli program and generate commands list

bit cli

generate#

Usage: generate

Description: EXPERIMENTAL. generate an .md file with all commands details

OptionOption aliasDescription
--metadatametadata/front-matter to place at the top of the .md file, enter as an object e.g. --metadata.id=cli --metadata.title=commands

compile#

Workspace only: yes
Description: compile components in the development workspace

bit compile [component...]

OptionOption aliasDescription
--changed-ccompile only new and modified components
--verbose-vshow more data, such as, dist paths
--json-jreturn the compile results in json format

completion#

Workspace only: yes
Description: enable bash/zsh-completion shortcuts for commands and options

bit completion


config#

Workspace only: yes
Description: global config management.
https://docs.bit.dev/docs/conf-config

bit config

set#

Usage: set <key> <val>

Description: set a global configuration

del#

Usage: del <key>

Description: delete given key from global configuration

get#

Usage: get <key>

Description: get a global configuration

list#

Usage: list

Description: list all configuration(s)


create#

Workspace only: yes
Description: create a new component from a template

bit create <templateName> <componentNames...>

OptionOption aliasDescription
--namespace <string>-nsets the component's namespace and nested dirs inside the scope
--scope <string>-ssets the component's scope-name. if not entered, the default-scope will be used
--aspect <string>-aaspect-id of the template. helpful when multiple aspects use the same template name
--path <string>-prelative path in the workspace. by default the path is <scope>/<namespace>/<name>

dependencies#

Workspace only: yes
Description: EXPERIMENTAL. show dependencies (direct and indirect) of the given component

bit dependencies <id>

OptionOption aliasDescription
--debug-dshow the immediate dependencies and how their version was determined

dependents#

Workspace only: yes
Description: EXPERIMENTAL. show dependents of the given component

bit dependents <id>


deprecate#

Alias: d
Workspace only: no
Description: deprecate a component (local/remote)

bit deprecate <ids...>

OptionOption aliasDescription
--remote-rdeprecate a component from a remote scope

diff#

Workspace only: yes
Description: show diff between components files
bit diff => compare all modified components to their model version
bit diff [ids...] => compare the specified components against their modified states
bit diff [id][version] => compare the specified version to used or modified files
bit diff [id][version] [to_version] => compare the specified version files to to_version files
you can use a pattern for multiple ids, such as bit diff "utils/*". (wrap the pattern with quotes to avoid collision with shell commands)

bit diff [values...]

OptionOption aliasDescription
--verbose-vshow a more verbose output when possible
--table-tshow tables instead of plain text for dependencies diff

doctor#

Workspace only: yes
Description: diagnose a bit workspace

bit doctor [diagnosis-name]

OptionOption aliasDescription
--json-jreturn diagnoses in json format
--listlist all available diagnoses
--save [filePath]-ssave diagnoses to a file

eject#

Alias: E
Workspace only: yes
Description: replaces the components from the local scope with the corresponding packages

bit eject <id...>

OptionOption aliasDescription
--force-fignore local version. remove the components even when they are staged or modified
--json-jprint the results in JSON format
--keep-fileskeep the component files in the workspace intact

eject-conf#

Workspace only: yes
Description: ejecting components configuration

bit eject-conf [id]

OptionOption aliasDescription
--propagate-pmark propagate true in the config file
--override-ooverride file if exist

envs#

Alias: env
Workspace only: yes
Description: show all components envs

bit envs [name]


export#

Alias: e
Workspace only: yes
Description: export components to a remote scope.
bit export => export all staged components to their current scope
Legacy:
bit export <remote> [id...] => export (optionally given ids) to the specified remote
bit export current [id...] => export (optionally given ids) to their current scope
Harmony:
bit export [id...] => export (optionally given ids) to their current scope
bit export <remote> <lane...> => export the specified lanes to the specified remote

https://docs.bit.dev/docs/export
you can use a pattern for multiple ids, such as bit export remote-scope "utils/*". (wrap the pattern with quotes to avoid collision with shell commands)

bit export [remote] [id...]

OptionOption aliasDescription
--eject-ereplaces the exported components from the local scope with the corresponding packages
--all-aexport all components include non-staged
--include-dependencies-dLEGACY ONLY. include the component's dependencies as part of the export to the remote scope
--set-current-scope-sLEGACY ONLY. ensure the component's remote scope is set according to the target location
--rewire-rLEGACY ONLY. when exporting to a different or new scope, replace import/require statements in the source code to match the new scope
--force-fforce changing a component remote without asking for a confirmation
--lanes-lHARMONY ONLY. export lanes
--all-versionsexport not only staged versions but all of them
--origin-directlyHARMONY ONLY. avoid export to the central hub, instead, export directly to the original scopes. not recommended!
--resume <string>in case the previous export failed and suggested to resume with an export-id, enter the id

graph#

Workspace only: yes
Description: EXPERIMENTAL. generate an image file with the dependencies graph

bit graph [id]

OptionOption aliasDescription
--image <image>-iimage path. use one of the following extensions: [gif, png, svg, pdf]
--remote [remoteName]-rremote name (name is optional, leave empty when id is specified)
--all-versionsenter all components versions into the graph, not only latest
--layout <name>GraphVis layout. default to "dot". options are [circo, dot, fdp, neato, osage, patchwork, sfdp, twopi]

help#

Alias: $0
Workspace only: yes
Description: shows help

bit help


import#

Workspace only: yes
Description: import components into your current workspace.
https://docs.bit.dev/docs/sourcing-components
you can use a pattern for multiple ids, such as bit import "utils/*". (wrap the pattern with quotes to avoid collision with shell commands)

bit import [ids...]

OptionOption aliasDescription
--tester-timport a tester environment component
--compiler-cimport a compiler environment component
--environment-einstall development environment dependencies (compiler and tester)
--path <path>-pimport components into a specific directory
--objects-oimport components objects only, don't write the components to the file system. This is a default behavior for import with no id
--display-dependencies-ddisplay the imported dependencies
--override-Ooverride local changes
--verbose-vshowing verbose output for inspection
--json-jreturn the output as JSON
--ignore-distskip writing the component's build files during import
--confwrite the configuration file (component.json) of the component (harmony components only)
--skip-npm-installdo not install packages of the imported components. (it automatically enables save-dependencies-as-components flag)
--ignore-package-jsondo not generate package.json for the imported component(s). (it automatically enables skip-npm-install and save-dependencies-as-components flags)
--merge [strategy]-mmerge local changes with the imported version. strategy should be "theirs", "ours" or "manual"
--dependenciesEXPERIMENTAL. import all dependencies and write them to the workspace
--dependentsEXPERIMENTAL. import component dependents to allow auto-tag updating them upon tag
--skip-laneEXPERIMENTAL. when checked out to a lane, do not import the component into the lane, save it on master

init#

Workspace only: no
Description: initialize an empty bit scope
https://docs.bit.dev/docs/workspace

bit init [path]

OptionOption aliasDescription
--bare [name]-binitialize an empty bit bare scope
--shared <groupname>-sadd group write permissions to a scope properly
--standalone-Tdo not nest component store within .git directory and do not write config data inside package.json
--reset-rwrite missing or damaged Bit files
--reset-newreset .bitmap file as if the components were newly added and remove all model data (objects)
--reset-harddelete all Bit files and directories, including Bit configuration, tracking and model data. Useful for re-start using Bit from scratch
--default-directory <default-directory>-dset up default directory to import components into
--package-manager <package-manager>-pset up package manager (npm or yarn)
--force-fforce workspace initialization without clearing local objects
--harmonyDEPRECATED. no need for this flag. Harmony is the default now
--interactive-IEXPERIMENTAL. start an interactive process

install#

Alias: in
Workspace only: yes
Description: install development workspace dependencies

bit install [packages...]

OptionOption aliasDescription
--variants <variants>-vadd packages to specific variants
--type [lifecycleType]-truntime (default), dev or peer dependency
--update-existing [updateExisting]-uupdate existing dependencies version and types
--save-prefix [savePrefix]set the prefix to use when adding dependency to workspace.jsonc
--skip-dedupe [skipDedupe]do not dedupe dependencies on installation
--skip-import [skipImport]do not import bit objects post installation

link#

Workspace only: yes
Description: generate symlinks to resolve module paths for imported components.
https://docs.bit.dev/docs/dependencies#missing-links

bit link [ids...]

OptionOption aliasDescription
--json-jreturn the output as JSON
--verboseverbose output
--rewire-rReplace relative paths with module paths in code (e.g. "../foo" => "@bit/foo")
--target <dir>EXPERIMENTAL. link to an external directory (similar to npm-link) so other projects could use these components

lint#

Workspace only: yes
Description: lint components in the development workspace

bit lint [component...]

OptionOption aliasDescription
--changed-clint only new and modified components

list#

Alias: ls
Workspace only: no
Description: list components on a local or a remote scope.
https://docs.bit.dev/docs/view#list

bit list [remote-scope]

OptionOption aliasDescription
--ids-idsshow only component ids unformatted
--scope-sshow all components of the scope, including indirect dependencies
--bare-bDEPRECATED. use --raw instead
--raw-rshow raw output (only components ids, no styling)
--outdated-oshow latest versions from remotes
--json-jshow the output in JSON format
--namespace <string>-nshow only specified namespace by using wildcards

log#

Workspace only: no
Description: show components(s) tag history.
https://docs.bit.dev/docs/view#log

bit log <id>

OptionOption aliasDescription
--remote-rshow log of a remote component

login#

Workspace only: no
Description: log the CLI into Bit

bit login

OptionOption aliasDescription
--port <port>-pport number to open for localhost server (default 8085)
--suppress-browser-launchdo not open a browser for authentication
--npmrc-path <path>path to npmrc file to configure bit.dev registry
--skip-registry-configdon't configure bit.dev registry
--machine-name <string>specify machine-name to pair with the token (useful for CI to avoid accidentally revoke the token)

logout#

Workspace only: yes
Description: log the CLI out of Bit

bit logout


merge#

Workspace only: yes
Description: merge changes of different component versions
bit merge <version> [ids...] => merge changes of the given version into the checked out version
bit merge [ids...] => EXPERIMENTAL. merge changes of the remote head into local, optionally use '--abort' or '--resolve'
bit merge <lane> --lane => EXPERIMENTAL. merge given lane into current lane
bit merge <remote> <lane> --lane => EXPERIMENTAL. merge given remote-lane into current lane
you can use a pattern for multiple ids, such as bit merge 0.0.1 "utils/*". (wrap the pattern with quotes to avoid collision with shell commands)

bit merge [values...]

OptionOption aliasDescription
--oursin case of a conflict, override the used version with the current modification
--theirsin case of a conflict, override the current modification with the specified version
--manualin case of a conflict, leave the files with a conflict state to resolve them manually later
--abortEXPERIMENTAL. in case of an unresolved merge, revert to the state before the merge began
--resolveEXPERIMENTAL. mark an unresolved merge as resolved and create a new snap with the changes
--lane-lEXPERIMENTAL. merge lanes
--existingEXPERIMENTAL. relevant for lanes. checkout only components in a lane that exist in the workspace
--no-snapEXPERIMENTAL. do not auto snap in case the merge completed without conflicts
--buildin case of snap during the merge, run the build-pipeline (similar to bit snap --build)
--message <message>-mEXPERIMENTAL. override the default message for the auto snap

move#

Alias: mv
Workspace only: yes
Description: move files or directories of component(s)
https://docs.bit.dev/docs/add-and-isolate-components#moving-and-renaming-files

bit move <from> <to>

OptionOption aliasDescription
--component-cmove component files that are spread over multiple directories to one directory. synopsis: move <component-id> <directory>

new#

Workspace only: yes
Description: EXPERIMENTAL. create a new workspace from a template

bit new <templateName> <workspaceName>

OptionOption aliasDescription
--aspect <string>-aaspect-id of the template. helpful when multiple aspects use the same template name
--default-scope <string>-dset defaultScope in the new workspace.jsonc
--standalone <string>-sskip generation of Git repository

pack#

Workspace only: yes
Description: create tar for npm publish

bit pack <componentId> [scopePath]

OptionOption aliasDescription
--out-dir <out-dir>-ddirectory to put the result tar file
--override-ooverride existing pack file
--keep-kshould keep isolated environment [default = false]
--prefix-pkeep custom (binding) prefix
--json-jreturn the output as JSON

remote#

Workspace only: yes
Description: manage set of tracked bit scope(s)
https://docs.bit.dev/docs/bit-server#working-with-remote-scopes

bit remote

add#

Usage: add <url>

Description: add a tracked bit remote

OptionOption aliasDescription
--global-gconfigure a remote bit scope

del#

Usage: del <name>

Description: remove a tracked bit remote

OptionOption aliasDescription
--global-gremove a global configured remote scope
OptionOption aliasDescription
--global-gsee globally configured remotes

remove#

Alias: rm
Workspace only: no
Description: remove a component (local/remote)
https://docs.bit.dev/docs/removing-components
you can use a pattern for multiple ids, such as bit remove "utils/*". (wrap the pattern with quotes to avoid collision with shell commands)

bit remove <ids...>

OptionOption aliasDescription
--remote-rremove a component from a remote scope
--track-tkeep tracking component (default = false)
--delete-files-ddelete local component files (authored components only. for imported components the files are always deleted)
--force-fremoves the component from the scope, even if used as a dependency. WARNING: components that depend on this component will corrupt
--silent-sskip confirmation
--laneEXPERIMENTAL. remove a lane

resume-export#

Workspace only: yes
Description: resume failed export to persist the pending objects on the given remotes.
the export-id is the id the client got in the error message during the failure.
alternatively, exporting to any one of the failed scopes, throws server-is-busy error with the export-id

bit resume-export <export-id> <remotes...>


run#

Alias: c
Workspace only: yes
Description: run an application

bit run <app>

OptionOption aliasDescription
--dev-dstart the application in dev mode.
--verbose-vshowing verbose output for inspection and prints stack trace

scope-config#

Workspace only: yes
Description: scope config management

bit scope-config

set#

Usage: set <key> <val>

Description: set a scope configuration

del#

Usage: del <key>

Description: delete given key from global configuration

get#

Usage: get <key>

Description: get a scope configuration

list#

Usage: list

Description: list all scope configuration(s)


show#

Workspace only: yes
Description: show a component

bit show <id>

OptionOption aliasDescription
--json-jreturn the component data in json format
--legacy-luse the legacy bit show.
--remote-rshow a remote component
--compare-ccompare current file system component to latest tagged component [default=latest]. only works in legacy.

start#

Alias: c
Workspace only: yes
Description: Start a dev environment for a workspace or a specific component

bit start [type] [pattern]

OptionOption aliasDescription
--dev-dstart UI server in dev mode.
--port [number]-pport of the UI server.
--rebuild-rrebuild the UI
--verbose-vshowing verbose output for inspection and prints stack trace
--suppress-browser-launchdo not automatically open browser when ready

status#

Alias: s
Workspace only: yes
Description: show the working area component(s) status.
https://docs.bit.dev/docs/view#status

bit status

OptionOption aliasDescription
--json-jreturn a json version of the component

tag#

Alias: t
Workspace only: yes
Description: record component changes and lock versions.
https://docs.bit.dev/docs/tag-component-version
you can use a pattern for multiple ids, such as bit tag "utils/*". (wrap the pattern with quotes to avoid collision with shell commands)

bit tag [id] [version]

OptionOption aliasDescription
--message <message>-mlog message describing the user changes
--all [version]-atag all new and modified components
--scope [version]-stag all components of the current scope
--patch-pincrement the patch version number
--minorincrement the minor version number
--majorincrement the major version number
--pre-release [identifier]EXPERIMENTAL. increment a pre-release version (e.g. 1.0.0-dev.1)
--force-fforce-tag even if tests are failing and even when component has not changed
--verbose-vshow specs output on failure
--ignore-missing-dependenciesDEPRECATED. use --ignore-unresolved-dependencies instead
--ignore-unresolved-dependencies-iignore missing dependencies (default = false)
--ignore-newest-version-Iignore existing of newer versions (default = false)
--skip-testsskip running component tests during tag process
--skip-auto-tagEXPERIMENTAL. skip auto tagging dependents
--buildHarmony only. run the pipeline build and complete the tag
--softHarmony only. do not persist. only keep note of the changes to be made
--persistHarmony only. persist the changes generated by --soft tag
--disable-deploy-pipelineDEPRECATED. use --disable-tag-pipeline instead
--disable-tag-pipelineHarmony only. skip the tag pipeline to avoid publishing the components
--force-deployHarmony only. run the tag pipeline although the build failed
--increment-by <number>(default to 1) increment semver flag (patch/minor/major) by. e.g. incrementing patch by 2: 0.0.1 -> 0.0.3.

templates#

Workspace only: yes
Description: list components templates when inside bit-workspace (for bit-create), otherwise, list workspace templates (for bit-new)

bit templates

OptionOption aliasDescription
--show-all-sshow hidden templates

test#

Alias: at
Workspace only: yes
Description: test set of components in your workspace

bit test [pattern]

OptionOption aliasDescription
--watch-wstart the tester in watch mode.
--debug-dstart the tester in debug mode.
--env <id>-etest only the given env
--scope <scope>-sname of the scope to test

ui-build#

Alias: c
Workspace only: yes
Description: build production assets for deployment.

bit ui-build [type]


undeprecate#

Workspace only: no
Description: undeprecate a deprecated component (local/remote)

bit undeprecate <ids...>

OptionOption aliasDescription
--remote-rundeprecate a component from a remote scope

untag#

Workspace only: yes
Description: revert version(s) tagged for component(s)
https://docs.bit.dev/docs/tag-component-version#untagging-components
you can use a pattern for multiple ids, such as bit untag "utils/*". (wrap the pattern with quotes to avoid collision with shell commands)

bit untag [id] [version]

OptionOption aliasDescription
--all-arevert tag for all tagged components
--softharmony - revert only soft-tags (components tagged with --soft flag)
--force-frevert the tag even if used as a dependency. WARNING: components that depend on this tag will corrupt

watch#

Workspace only: yes
Description: watch a set of components

bit watch

OptionOption aliasDescription
--verbose-vshowing npm verbose output for inspection and prints stack trace