Rename component. if exported, create a new component and delete the original component. otherwise just renames current component
$bit rename <current-name> <new-name>
Copiedcopy

Arguments

ArgumentDescriptionRequired
current-namethe current component name (without its scope name)
new-namethe new component name (without its scope name. use --scope to define the new component's scope)

Options

OptionOption AliasDescriptionValue Type
--scope-sdefine the scope for the new componentstring
--refactor-rupdate the import/require statements in all dependent components (in the same workspace)boolean
--preserve-avoid renaming files and variables/classes according to the new component nameboolean
--ast-EXPERIMENTAL. use ast to transform files instead of regexboolean
--delete-DEPRECATED. this is now the defaultboolean
--deprecate-instead of deleting the original component, deprecating itboolean
--path-prelative path in the workspace to place new component in. by default, the directory of the new component is from your workspace's "defaultScope" valuestring