Docs

Docs

  • Try Bit next-gen (beta) ⮕
  • Docs
  • Tutorials
  • Guides
  • Github

›Reference

Introduction

  • Quick Start
  • Installation
  • How bit Works?
  • Bit Workspace
  • FAQ

Components

  • Tracking
  • Compiling
  • Testing
  • Versioning
  • Documenting
  • Exporting
  • Removing & Deprecating
  • Installing
  • Importing
  • Viewing

Advanced

  • Dependencies
  • Overrides
  • CI & Deployment
  • Bit Server

bit.dev

  • Functionality
  • Account
  • Authentication

Reference

  • Bit Client Configuration
  • Workspace Configuration
  • CLI Commands
  • Usage Analytics

Extending Bit

  • Extending Bit
  • Using Extensions
  • Developing Extensions
  • Build a compiler
  • Build a tester
Edit

CLI Commands

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>-norginize 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)

build

Workspace only: yes
Description: build any set of components with a configured compiler (as defined in bit.json)
https://docs.bit.dev/docs/building-components

bit build [id]

OptionOption aliasDescription
--verbose [boolean]-vshowing npm verbose output for inspection
--no-cache-cignore component cache when creating dist file

checkout

Alias: U
Workspace only: yes
Description: switch between component versions or remove local changes
bit checkout [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


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)


deprecate

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

bit deprecate <ids...>

OptionOption aliasDescription
--remote [boolean]-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

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

Workspace only: yes
Description: ejecting components configuration

bit eject-conf [id]

OptionOption aliasDescription
--path <path>-pejecting configuration into a specific directory

export

Alias: e
Workspace only: yes
Description: export components to a remote scope.
bit export [id...] => export (optionally given ids) to the specified remote
bit export current [id...] => export (optionally given ids) to their current scope
bit export => export all staged components to their current scope
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-dEXPERIMENTAL. include the component's dependencies as part of the export to the remote scope
--set-current-scope-sEXPERIMENTAL. ensure the component's remote scope is set according to the target location
--rewire-rEXPERIMENTAL. when exporting to a different scope, replace import/require statements in the source code to the new scope
--all-versionsexport not only staged versions but all of them
--force-fforce changing a component remote without asking for a confirmation

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]

import

Alias: i
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
--extension-ximport an extension 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
--conf [path]write the configuration file (bit.json) and the envs configuration files (use --conf without path to write to the default dir)
--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

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 [boolean]-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-harddelete all Bit files and directories, including Bit configuration, tracking and model data. Useful for re-start using Bit from scratch
--compiler <compiler>-cset up compiler
--tester <tester>-tset up tester
--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
--interactive-IEXPERIMENTAL. start an interactive process

install

Workspace only: yes
Description: Installs all dependencies for all the sourced components (or for a specific one), whether they were defined in your package.json or in each of the sourced components, and links them.
https://docs.bit.dev/docs/installing-components

bit install [ids...]

OptionOption aliasDescription
--verbose-vshow a more verbose output when possible

link

Alias: b
Workspace only: yes
Description: generate symlinks for sourced components absolute path resolution.
https://docs.bit.dev/docs/dependencies#missing-links

bit link


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 [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-config [boolean]don'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
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 <version> <ids...>

OptionOption aliasDescription
--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

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>


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

del

Usage: del <name>

Description: remove a tracked bit remote

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 [boolean]-tkeep tracking component (default = false)
--delete-files [boolean]-ddelete local component files (authored components only. for imported components the files are always deleted)
--force [boolean]-fremoves the component from the scope, even if used as a dependency. WARNING: components that depend on this component will corrupt
--silent [boolean]-sskip confirmation

show

Workspace only: no
Description: show component overview.
https://docs.bit.dev/docs/view#show

bit show <id>

OptionOption aliasDescription
--json-jreturn a json version of the component
--remote-rshow a remote component
--versions-vreturn a json of all the versions of the component
--outdated-oshow latest version from the remote scope (if exists)
--compare [boolean]-ccompare current file system component to latest tagged component [default=latest]
--detailed-dshow more details
--dependentsEXPERIMENTAL. show all dependents recursively
--dependenciesEXPERIMENTAL. show all dependencies recursively

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
--minor-miincrement the minor version number
--major-maincrement the major version number
--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

test

Workspace only: yes
Description: test any set of components with a configured tester as defined in bit.json (by default applies only on modified components)
https://docs.bit.dev/docs/testing-components)

bit test [id]

OptionOption aliasDescription
--all-atest all components in your workspace, including unmodified components
--verbose-vshowing npm verbose output for inspection and prints stack trace
--json-jreturn results in json format
--fork-level <forkLevel>NONE / ONE / COMPONENT how many child process create for test running

undeprecate

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

bit undeprecate <ids...>

OptionOption aliasDescription
--remote [boolean]-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
--force-frevert the tag even if used as a dependency. WARNING: components that depend on this tag will corrupt

untrack

Alias: u
Workspace only: yes
Description: untrack a new component(s)
https://docs.bit.dev/docs/add-and-isolate-components#untracking-components
you can use a pattern for multiple ids, such as bit untrack "utils/*". (wrap the pattern with quotes to avoid collision with shell commands)

bit untrack [ids...]

OptionOption aliasDescription
--all-arevert add for all tracked components

watch

Alias: w
Workspace only: yes
Description: watch components and perform build on changes

bit watch

OptionOption aliasDescription
--verbose-vshowing npm verbose output for inspection

← Workspace ConfigurationUsage Analytics →
  • add
  • build
  • checkout
  • clear-cache
  • config
    • set
    • del
    • get
    • list
  • deprecate
  • diff
  • doctor
  • eject
  • export
  • graph
  • import
  • init
  • install
  • link
  • list
  • log
  • login
  • logout
  • merge
  • move
  • remote
    • add
    • del
  • remove
  • show
  • status
  • tag
  • test
  • undeprecate
  • untag
  • untrack
  • watch
Docs
bit.dev
bit.devSupportTerms and PrivacySLA
Community
SlackTwitter
More
Star
Copyright © 2022 bit.dev