@teambit/cli 0.0.0-00805bd6ead01ffad26e598a8de15824e876ee5a
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.npmignore +18 -0
- package/cli-output-style-guide.md +132 -0
- package/cli.composition.tsx +7 -0
- package/cli.docs.mdx +12 -0
- package/dist/cli-output-style-guide.md +132 -0
- package/dist/cli-parser.d.ts +38 -0
- package/dist/cli-parser.js +388 -0
- package/dist/cli-parser.js.map +1 -0
- package/dist/cli-parser.spec.d.ts +1 -0
- package/dist/cli-parser.spec.js +113 -0
- package/dist/cli-parser.spec.js.map +1 -0
- package/dist/cli.aspect.d.ts +4 -0
- package/dist/cli.aspect.js +22 -0
- package/dist/cli.aspect.js.map +1 -0
- package/dist/cli.cmd.d.ts +34 -0
- package/dist/cli.cmd.js +163 -0
- package/dist/cli.cmd.js.map +1 -0
- package/dist/cli.composition.d.ts +2 -0
- package/dist/cli.composition.js +29 -0
- package/dist/cli.composition.js.map +1 -0
- package/dist/cli.docs.mdx +12 -0
- package/dist/cli.main.runtime.d.ts +86 -0
- package/dist/cli.main.runtime.js +270 -0
- package/dist/cli.main.runtime.js.map +1 -0
- package/dist/command-groups.d.ts +31 -0
- package/dist/command-groups.js +44 -0
- package/dist/command-groups.js.map +1 -0
- package/dist/command-helper.d.ts +25 -0
- package/dist/command-helper.js +59 -0
- package/dist/command-helper.js.map +1 -0
- package/dist/command-runner.d.ts +38 -0
- package/dist/command-runner.js +227 -0
- package/dist/command-runner.js.map +1 -0
- package/dist/command.d.ts +145 -0
- package/dist/command.js +3 -0
- package/dist/command.js.map +1 -0
- package/dist/completion.cmd.d.ts +9 -0
- package/dist/completion.cmd.js +22 -0
- package/dist/completion.cmd.js.map +1 -0
- package/dist/default-error-handler.d.ts +12 -0
- package/dist/default-error-handler.js +80 -0
- package/dist/default-error-handler.js.map +1 -0
- package/dist/details.cmd.d.ts +12 -0
- package/dist/details.cmd.js +78 -0
- package/dist/details.cmd.js.map +1 -0
- package/dist/esm.mjs +17 -0
- package/dist/exceptions/already-exists.d.ts +4 -0
- package/dist/exceptions/already-exists.js +21 -0
- package/dist/exceptions/already-exists.js.map +1 -0
- package/dist/exceptions/command-not-found.d.ts +7 -0
- package/dist/exceptions/command-not-found.js +44 -0
- package/dist/exceptions/command-not-found.js.map +1 -0
- package/dist/exceptions/index.d.ts +2 -0
- package/dist/exceptions/index.js +33 -0
- package/dist/exceptions/index.js.map +1 -0
- package/dist/exceptions/yargs-exit-workaround.d.ts +6 -0
- package/dist/exceptions/yargs-exit-workaround.js +23 -0
- package/dist/exceptions/yargs-exit-workaround.js.map +1 -0
- package/dist/generate-doc-md.d.ts +39 -0
- package/dist/generate-doc-md.js +266 -0
- package/dist/generate-doc-md.js.map +1 -0
- package/dist/get-command-id.d.ts +1 -0
- package/dist/get-command-id.js +11 -0
- package/dist/get-command-id.js.map +1 -0
- package/dist/global-flags.d.ts +7 -0
- package/dist/global-flags.js +24 -0
- package/dist/global-flags.js.map +1 -0
- package/dist/handle-errors.d.ts +3 -0
- package/dist/handle-errors.js +78 -0
- package/dist/handle-errors.js.map +1 -0
- package/dist/help.cmd.d.ts +16 -0
- package/dist/help.cmd.js +37 -0
- package/dist/help.cmd.js.map +1 -0
- package/dist/help.d.ts +3 -0
- package/dist/help.js +88 -0
- package/dist/help.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +245 -0
- package/dist/index.js.map +1 -0
- package/dist/output-formatter.d.ts +40 -0
- package/dist/output-formatter.js +115 -0
- package/dist/output-formatter.js.map +1 -0
- package/dist/pager.d.ts +35 -0
- package/dist/pager.js +178 -0
- package/dist/pager.js.map +1 -0
- package/dist/preview-1787076242549.js +7 -0
- package/dist/version.cmd.d.ts +13 -0
- package/dist/version.cmd.js +39 -0
- package/dist/version.cmd.js.map +1 -0
- package/dist/yargs-adapter.d.ts +22 -0
- package/dist/yargs-adapter.js +133 -0
- package/dist/yargs-adapter.js.map +1 -0
- package/esm.mjs +17 -0
- package/exceptions/already-exists.ts +7 -0
- package/exceptions/command-not-found.ts +22 -0
- package/exceptions/index.ts +2 -0
- package/exceptions/yargs-exit-workaround.ts +10 -0
- package/package.json +74 -0
- package/types/asset.d.ts +41 -0
- package/types/style.d.ts +46 -0
package/.npmignore
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
dist/tsconfig.tsbuildinfo
|
|
2
|
+
dist/tsconfig.json
|
|
3
|
+
/tsconfig.json
|
|
4
|
+
|
|
5
|
+
package-tar/
|
|
6
|
+
.bit-capsule-ready
|
|
7
|
+
/*.ts
|
|
8
|
+
artifacts/*
|
|
9
|
+
!artifacts/env-template
|
|
10
|
+
!artifacts/ui-bundle
|
|
11
|
+
!artifacts/preview-bundle
|
|
12
|
+
package-tar/
|
|
13
|
+
.bit-capsule-ready
|
|
14
|
+
/*.ts
|
|
15
|
+
artifacts/*
|
|
16
|
+
!artifacts/env-template
|
|
17
|
+
!artifacts/ui-bundle
|
|
18
|
+
!artifacts/preview-bundle
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
# CLI Output Style Guide
|
|
2
|
+
|
|
3
|
+
All CLI command output should use the shared formatting toolkit from `@teambit/cli` (`scopes/harmony/cli/output-formatter.ts`). Never use raw `chalk.underline` for headers or hardcode Unicode symbols directly.
|
|
4
|
+
|
|
5
|
+
## Toolkit Functions
|
|
6
|
+
|
|
7
|
+
| Function | Purpose | Example output |
|
|
8
|
+
| ----------------------------------- | ------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
9
|
+
| `formatTitle(text)` | Bold white section title | **modified components** |
|
|
10
|
+
| `formatSection(title, desc, items)` | Full section: title with count, dim description, item list. Returns `''` if items is empty | **modified components (3)**<br/> _(use "bit diff" to compare)_<br/><br/> › comp-a<br/> › comp-b |
|
|
11
|
+
| `formatItem(text, symbol?)` | Indented item line (3-space + symbol + text). Defaults to `bulletSymbol` | › comp-a |
|
|
12
|
+
| `formatHint(text)` | Dim text for hints/timing | _Finished. (1.2s)_ |
|
|
13
|
+
| `formatSuccessSummary(msg)` | Green checkmark + green text | ✔ 5/5 compiled successfully |
|
|
14
|
+
| `formatWarningSummary(msg)` | Warning symbol + yellow text | ⚠ 2/5 failed |
|
|
15
|
+
| `joinSections(sections)` | Filter empty strings, join with `\n\n` | — |
|
|
16
|
+
| `renderSections(sections, expand?)` | Render with collapsible section support | — |
|
|
17
|
+
|
|
18
|
+
## Symbols
|
|
19
|
+
|
|
20
|
+
| Symbol | Variable | Use for |
|
|
21
|
+
| ----------- | ----------------- | ------------------------------------------------------------------------------------------- |
|
|
22
|
+
| ✔ (green) | `successSymbol()` | Summary lines confirming an operation completed. **Not** for individual items in long lists |
|
|
23
|
+
| ⚠ (yellow) | `warnSymbol` | Items with warnings, deprecations, pending state |
|
|
24
|
+
| ✖ (red) | `errorSymbol` | Items with errors, failures, missing/deleted state |
|
|
25
|
+
| › (dim) | `bulletSymbol` | Neutral list items — the default for informational lists |
|
|
26
|
+
|
|
27
|
+
## Design Principles
|
|
28
|
+
|
|
29
|
+
### Silence means success
|
|
30
|
+
|
|
31
|
+
For commands that process many components (compile, import), don't list every successful item. Show only failures by default, with the full list available via `--verbose`. The summary line is enough when everything passes.
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
# default — all pass:
|
|
35
|
+
✔ 309/309 components compiled successfully.
|
|
36
|
+
Finished. (45s)
|
|
37
|
+
|
|
38
|
+
# default — some fail:
|
|
39
|
+
✖ teambit.workspace/watcher ... failed
|
|
40
|
+
✖ teambit.vue/vue-aspect ... failed
|
|
41
|
+
|
|
42
|
+
⚠ 2/309 components failed to compile.
|
|
43
|
+
Finished. (45s)
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Reserve checkmarks for summaries
|
|
47
|
+
|
|
48
|
+
Use `bulletSymbol` (›) for individual items in lists. Reserve `successSymbol` (✔) for summary lines that confirm an operation completed. A long list of checkmarks is visual noise.
|
|
49
|
+
|
|
50
|
+
### Section structure
|
|
51
|
+
|
|
52
|
+
Use `formatSection` when you have a title + optional description + list of items. For sections with non-standard structure (key-value summaries, error messages with suggestions), use `formatTitle` for the heading.
|
|
53
|
+
|
|
54
|
+
```typescript
|
|
55
|
+
// Standard section — use formatSection
|
|
56
|
+
formatSection('modified components', '(use "bit diff" to compare)', items);
|
|
57
|
+
|
|
58
|
+
// Non-standard section — use formatTitle directly
|
|
59
|
+
const title = formatTitle('Merge Summary');
|
|
60
|
+
const body = `\nTotal Merged: ${chalk.bold(count)}`;
|
|
61
|
+
return `${title}${body}`;
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Join sections with joinSections
|
|
65
|
+
|
|
66
|
+
Never use `compact([...]).join('\n\n')` from lodash. Use `joinSections([...])` which filters empty strings and joins with double newlines.
|
|
67
|
+
|
|
68
|
+
### Error sections
|
|
69
|
+
|
|
70
|
+
Prefix error section titles with `errorSymbol`:
|
|
71
|
+
|
|
72
|
+
```typescript
|
|
73
|
+
const title = `${errorSymbol} ${formatTitle('Installation Error')}`;
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Conflict/warning sections
|
|
77
|
+
|
|
78
|
+
Prefix conflict section titles with `warnSymbol`:
|
|
79
|
+
|
|
80
|
+
```typescript
|
|
81
|
+
const title = formatTitle(`${warnSymbol} files with conflicts summary`);
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Commands already using this toolkit
|
|
85
|
+
|
|
86
|
+
- `bit status` — `scopes/component/status/status-cmd.ts`, `status-formatter.ts`
|
|
87
|
+
- `bit tag` / `bit snap` / `bit export` — use toolkit symbols and formatters
|
|
88
|
+
- `bit compile` — `scopes/compilation/compiler/compiler.cmd.ts`, `output-formatter.ts`
|
|
89
|
+
- `bit import` — `scopes/scope/importer/import.cmd.ts`
|
|
90
|
+
- `bit merge` — `scopes/component/merging/merge-cmd.ts`
|
|
91
|
+
- Shared merge helpers — `scopes/component/modules/merge-helper/merge-output.ts` (also used by `checkout`, `switch`, `lane merge`)
|
|
92
|
+
- `bit add` — `scopes/component/tracker/add-cmd.ts`
|
|
93
|
+
- `bit deps` (set/remove/unset/reset/eject/blame/diagnose) — `scopes/dependencies/dependencies/dependencies-cmd.ts`
|
|
94
|
+
- `bit lint` — `scopes/defender/linter/lint.cmd.ts`
|
|
95
|
+
- `bit link` — `scopes/workspace/install/link/link.cmd.ts`
|
|
96
|
+
- `bit remove` / `bit delete` — `scopes/component/remove/remove-template.ts`, `delete-cmd.ts`
|
|
97
|
+
- `bit fork` — `scopes/component/forking/fork.cmd.ts`
|
|
98
|
+
- `bit recover` — `scopes/component/remove/recover-cmd.ts`
|
|
99
|
+
- `bit scope rename` / `bit scope rename-owner` — `scopes/component/renaming/scope-rename.cmd.ts`, `scope-rename-owner.cmd.ts`
|
|
100
|
+
- `bit remote` (add/del/list) — `scopes/harmony/global-config/remote-cmd.ts`
|
|
101
|
+
- `bit init` — `scopes/harmony/host-initializer/init-cmd.ts`, `host-initializer.main.runtime.ts`
|
|
102
|
+
- `bit clear-cache` — `scopes/workspace/clear-cache/clear-cache-cmd.ts`
|
|
103
|
+
- `bit eject-conf` — `scopes/workspace/workspace/eject-conf.cmd.ts`
|
|
104
|
+
- `bit scope set` — `scopes/workspace/workspace/scope-subcommands/scope-set.cmd.ts`
|
|
105
|
+
- `bit deprecate` / `bit undeprecate` — `scopes/component/deprecation/deprecate-cmd.ts`, `undeprecate-cmd.ts`
|
|
106
|
+
- `bit rename` — `scopes/component/renaming/rename.cmd.ts`
|
|
107
|
+
- `bit move` — `scopes/component/mover/move-cmd.ts`
|
|
108
|
+
- `bit aspect` (set/update/unset/get) — `scopes/harmony/aspect/aspect.cmd.ts`
|
|
109
|
+
- `bit envs` (set/unset/update) — `scopes/workspace/workspace/envs-subcommands/`
|
|
110
|
+
- `bit use` / `bit unuse` — `scopes/workspace/workspace/use.cmd.ts`, `unuse.cmd.ts`
|
|
111
|
+
- `bit create` — `scopes/generator/generator/create.cmd.ts`
|
|
112
|
+
- `bit stash` (save/load) — `scopes/component/stash/stash.cmd.ts`
|
|
113
|
+
- `bit scope fork` — `scopes/component/forking/scope-fork.cmd.ts`
|
|
114
|
+
- `bit format` — `scopes/defender/formatter/format.cmd.ts`
|
|
115
|
+
- `bit validate` — `scopes/defender/validator/validate.cmd.ts`
|
|
116
|
+
- `bit login` / `bit logout` / `bit whoami` — `scopes/cloud/cloud/login.cmd.ts`, `logout.cmd.ts`, `whoami.cmd.ts`
|
|
117
|
+
- `bit build` — `scopes/pipelines/builder/build.cmd.ts`
|
|
118
|
+
- `bit new` — `scopes/generator/generator/new.cmd.ts`
|
|
119
|
+
- `bit merge-abort` — `scopes/lanes/merge-lanes/merge-abort.cmd.ts`
|
|
120
|
+
- `bit merge-move` — `scopes/lanes/merge-lanes/merge-move.cmd.ts`
|
|
121
|
+
- `bit envs` (list/get) — `scopes/envs/envs/envs.cmd.ts`
|
|
122
|
+
- `bit capsule` (create/list/delete) — `scopes/workspace/workspace/capsule.cmd.ts`
|
|
123
|
+
- `bit check-types` — `scopes/typescript/typescript/cmds/check-types.cmd.ts`
|
|
124
|
+
- `bit fetch` — `scopes/scope/importer/fetch-cmd.ts`
|
|
125
|
+
- `bit version-history` (build/show) — `scopes/scope/version-history/version-history-cmd.ts`
|
|
126
|
+
- `bit artifacts` — `scopes/pipelines/builder/artifact/artifacts.cmd.ts`
|
|
127
|
+
- `bit templates` — `scopes/generator/generator/templates.cmd.ts`
|
|
128
|
+
- `bit npmrc` — `scopes/cloud/cloud/npmrc.cmd.ts`
|
|
129
|
+
- `bit graph` — `scopes/component/graph/graph-cmd.ts`
|
|
130
|
+
- `bit git merge-bitmaps` / `bit set-merge-driver` — `scopes/git/git/merge-bitmaps.cmd.ts`, `set-git-merge-driver.cmd.ts`
|
|
131
|
+
- `bit pattern` — `scopes/workspace/workspace/pattern.cmd.ts`
|
|
132
|
+
- `bit mcp setup` — `scopes/mcp/cli-mcp-server/setup-cmd.ts`
|
package/cli.docs.mdx
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Bit's command-line interface. Enables aspects to add and remove commands.
|
|
3
|
+
labels: ['cli', 'component']
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
CLI Aspect manages the commands in the CLI. New commands are registered to this aspect with the necessary data such as, command-name, description and flags. Parsing the args from the CLI is done by Commander package.
|
|
7
|
+
|
|
8
|
+
## Features
|
|
9
|
+
|
|
10
|
+
- Allow to register new commands
|
|
11
|
+
- Use commander commands.
|
|
12
|
+
- Render to stdout as string or as a React component by Ink.
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
# CLI Output Style Guide
|
|
2
|
+
|
|
3
|
+
All CLI command output should use the shared formatting toolkit from `@teambit/cli` (`scopes/harmony/cli/output-formatter.ts`). Never use raw `chalk.underline` for headers or hardcode Unicode symbols directly.
|
|
4
|
+
|
|
5
|
+
## Toolkit Functions
|
|
6
|
+
|
|
7
|
+
| Function | Purpose | Example output |
|
|
8
|
+
| ----------------------------------- | ------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
9
|
+
| `formatTitle(text)` | Bold white section title | **modified components** |
|
|
10
|
+
| `formatSection(title, desc, items)` | Full section: title with count, dim description, item list. Returns `''` if items is empty | **modified components (3)**<br/> _(use "bit diff" to compare)_<br/><br/> › comp-a<br/> › comp-b |
|
|
11
|
+
| `formatItem(text, symbol?)` | Indented item line (3-space + symbol + text). Defaults to `bulletSymbol` | › comp-a |
|
|
12
|
+
| `formatHint(text)` | Dim text for hints/timing | _Finished. (1.2s)_ |
|
|
13
|
+
| `formatSuccessSummary(msg)` | Green checkmark + green text | ✔ 5/5 compiled successfully |
|
|
14
|
+
| `formatWarningSummary(msg)` | Warning symbol + yellow text | ⚠ 2/5 failed |
|
|
15
|
+
| `joinSections(sections)` | Filter empty strings, join with `\n\n` | — |
|
|
16
|
+
| `renderSections(sections, expand?)` | Render with collapsible section support | — |
|
|
17
|
+
|
|
18
|
+
## Symbols
|
|
19
|
+
|
|
20
|
+
| Symbol | Variable | Use for |
|
|
21
|
+
| ----------- | ----------------- | ------------------------------------------------------------------------------------------- |
|
|
22
|
+
| ✔ (green) | `successSymbol()` | Summary lines confirming an operation completed. **Not** for individual items in long lists |
|
|
23
|
+
| ⚠ (yellow) | `warnSymbol` | Items with warnings, deprecations, pending state |
|
|
24
|
+
| ✖ (red) | `errorSymbol` | Items with errors, failures, missing/deleted state |
|
|
25
|
+
| › (dim) | `bulletSymbol` | Neutral list items — the default for informational lists |
|
|
26
|
+
|
|
27
|
+
## Design Principles
|
|
28
|
+
|
|
29
|
+
### Silence means success
|
|
30
|
+
|
|
31
|
+
For commands that process many components (compile, import), don't list every successful item. Show only failures by default, with the full list available via `--verbose`. The summary line is enough when everything passes.
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
# default — all pass:
|
|
35
|
+
✔ 309/309 components compiled successfully.
|
|
36
|
+
Finished. (45s)
|
|
37
|
+
|
|
38
|
+
# default — some fail:
|
|
39
|
+
✖ teambit.workspace/watcher ... failed
|
|
40
|
+
✖ teambit.vue/vue-aspect ... failed
|
|
41
|
+
|
|
42
|
+
⚠ 2/309 components failed to compile.
|
|
43
|
+
Finished. (45s)
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Reserve checkmarks for summaries
|
|
47
|
+
|
|
48
|
+
Use `bulletSymbol` (›) for individual items in lists. Reserve `successSymbol` (✔) for summary lines that confirm an operation completed. A long list of checkmarks is visual noise.
|
|
49
|
+
|
|
50
|
+
### Section structure
|
|
51
|
+
|
|
52
|
+
Use `formatSection` when you have a title + optional description + list of items. For sections with non-standard structure (key-value summaries, error messages with suggestions), use `formatTitle` for the heading.
|
|
53
|
+
|
|
54
|
+
```typescript
|
|
55
|
+
// Standard section — use formatSection
|
|
56
|
+
formatSection('modified components', '(use "bit diff" to compare)', items);
|
|
57
|
+
|
|
58
|
+
// Non-standard section — use formatTitle directly
|
|
59
|
+
const title = formatTitle('Merge Summary');
|
|
60
|
+
const body = `\nTotal Merged: ${chalk.bold(count)}`;
|
|
61
|
+
return `${title}${body}`;
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Join sections with joinSections
|
|
65
|
+
|
|
66
|
+
Never use `compact([...]).join('\n\n')` from lodash. Use `joinSections([...])` which filters empty strings and joins with double newlines.
|
|
67
|
+
|
|
68
|
+
### Error sections
|
|
69
|
+
|
|
70
|
+
Prefix error section titles with `errorSymbol`:
|
|
71
|
+
|
|
72
|
+
```typescript
|
|
73
|
+
const title = `${errorSymbol} ${formatTitle('Installation Error')}`;
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Conflict/warning sections
|
|
77
|
+
|
|
78
|
+
Prefix conflict section titles with `warnSymbol`:
|
|
79
|
+
|
|
80
|
+
```typescript
|
|
81
|
+
const title = formatTitle(`${warnSymbol} files with conflicts summary`);
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Commands already using this toolkit
|
|
85
|
+
|
|
86
|
+
- `bit status` — `scopes/component/status/status-cmd.ts`, `status-formatter.ts`
|
|
87
|
+
- `bit tag` / `bit snap` / `bit export` — use toolkit symbols and formatters
|
|
88
|
+
- `bit compile` — `scopes/compilation/compiler/compiler.cmd.ts`, `output-formatter.ts`
|
|
89
|
+
- `bit import` — `scopes/scope/importer/import.cmd.ts`
|
|
90
|
+
- `bit merge` — `scopes/component/merging/merge-cmd.ts`
|
|
91
|
+
- Shared merge helpers — `scopes/component/modules/merge-helper/merge-output.ts` (also used by `checkout`, `switch`, `lane merge`)
|
|
92
|
+
- `bit add` — `scopes/component/tracker/add-cmd.ts`
|
|
93
|
+
- `bit deps` (set/remove/unset/reset/eject/blame/diagnose) — `scopes/dependencies/dependencies/dependencies-cmd.ts`
|
|
94
|
+
- `bit lint` — `scopes/defender/linter/lint.cmd.ts`
|
|
95
|
+
- `bit link` — `scopes/workspace/install/link/link.cmd.ts`
|
|
96
|
+
- `bit remove` / `bit delete` — `scopes/component/remove/remove-template.ts`, `delete-cmd.ts`
|
|
97
|
+
- `bit fork` — `scopes/component/forking/fork.cmd.ts`
|
|
98
|
+
- `bit recover` — `scopes/component/remove/recover-cmd.ts`
|
|
99
|
+
- `bit scope rename` / `bit scope rename-owner` — `scopes/component/renaming/scope-rename.cmd.ts`, `scope-rename-owner.cmd.ts`
|
|
100
|
+
- `bit remote` (add/del/list) — `scopes/harmony/global-config/remote-cmd.ts`
|
|
101
|
+
- `bit init` — `scopes/harmony/host-initializer/init-cmd.ts`, `host-initializer.main.runtime.ts`
|
|
102
|
+
- `bit clear-cache` — `scopes/workspace/clear-cache/clear-cache-cmd.ts`
|
|
103
|
+
- `bit eject-conf` — `scopes/workspace/workspace/eject-conf.cmd.ts`
|
|
104
|
+
- `bit scope set` — `scopes/workspace/workspace/scope-subcommands/scope-set.cmd.ts`
|
|
105
|
+
- `bit deprecate` / `bit undeprecate` — `scopes/component/deprecation/deprecate-cmd.ts`, `undeprecate-cmd.ts`
|
|
106
|
+
- `bit rename` — `scopes/component/renaming/rename.cmd.ts`
|
|
107
|
+
- `bit move` — `scopes/component/mover/move-cmd.ts`
|
|
108
|
+
- `bit aspect` (set/update/unset/get) — `scopes/harmony/aspect/aspect.cmd.ts`
|
|
109
|
+
- `bit envs` (set/unset/update) — `scopes/workspace/workspace/envs-subcommands/`
|
|
110
|
+
- `bit use` / `bit unuse` — `scopes/workspace/workspace/use.cmd.ts`, `unuse.cmd.ts`
|
|
111
|
+
- `bit create` — `scopes/generator/generator/create.cmd.ts`
|
|
112
|
+
- `bit stash` (save/load) — `scopes/component/stash/stash.cmd.ts`
|
|
113
|
+
- `bit scope fork` — `scopes/component/forking/scope-fork.cmd.ts`
|
|
114
|
+
- `bit format` — `scopes/defender/formatter/format.cmd.ts`
|
|
115
|
+
- `bit validate` — `scopes/defender/validator/validate.cmd.ts`
|
|
116
|
+
- `bit login` / `bit logout` / `bit whoami` — `scopes/cloud/cloud/login.cmd.ts`, `logout.cmd.ts`, `whoami.cmd.ts`
|
|
117
|
+
- `bit build` — `scopes/pipelines/builder/build.cmd.ts`
|
|
118
|
+
- `bit new` — `scopes/generator/generator/new.cmd.ts`
|
|
119
|
+
- `bit merge-abort` — `scopes/lanes/merge-lanes/merge-abort.cmd.ts`
|
|
120
|
+
- `bit merge-move` — `scopes/lanes/merge-lanes/merge-move.cmd.ts`
|
|
121
|
+
- `bit envs` (list/get) — `scopes/envs/envs/envs.cmd.ts`
|
|
122
|
+
- `bit capsule` (create/list/delete) — `scopes/workspace/workspace/capsule.cmd.ts`
|
|
123
|
+
- `bit check-types` — `scopes/typescript/typescript/cmds/check-types.cmd.ts`
|
|
124
|
+
- `bit fetch` — `scopes/scope/importer/fetch-cmd.ts`
|
|
125
|
+
- `bit version-history` (build/show) — `scopes/scope/version-history/version-history-cmd.ts`
|
|
126
|
+
- `bit artifacts` — `scopes/pipelines/builder/artifact/artifacts.cmd.ts`
|
|
127
|
+
- `bit templates` — `scopes/generator/generator/templates.cmd.ts`
|
|
128
|
+
- `bit npmrc` — `scopes/cloud/cloud/npmrc.cmd.ts`
|
|
129
|
+
- `bit graph` — `scopes/component/graph/graph-cmd.ts`
|
|
130
|
+
- `bit git merge-bitmaps` / `bit set-merge-driver` — `scopes/git/git/merge-bitmaps.cmd.ts`, `set-git-merge-driver.cmd.ts`
|
|
131
|
+
- `bit pattern` — `scopes/workspace/workspace/pattern.cmd.ts`
|
|
132
|
+
- `bit mcp setup` — `scopes/mcp/cli-mcp-server/setup-cmd.ts`
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import yargs from 'yargs';
|
|
2
|
+
import type { Command } from './command';
|
|
3
|
+
import type { GroupsType } from './command-groups';
|
|
4
|
+
import type { OnCommandStartSlot } from './cli.main.runtime';
|
|
5
|
+
import type { CommandRunner } from './command-runner';
|
|
6
|
+
export declare class CLIParser {
|
|
7
|
+
private commands;
|
|
8
|
+
private groups;
|
|
9
|
+
private onCommandStartSlot;
|
|
10
|
+
parser: yargs.Argv<{}>;
|
|
11
|
+
private yargsCommands;
|
|
12
|
+
constructor(commands: Command[], groups: GroupsType, onCommandStartSlot: OnCommandStartSlot);
|
|
13
|
+
parse(args?: string[]): Promise<CommandRunner>;
|
|
14
|
+
private addYargsCommand;
|
|
15
|
+
private setHelpMiddleware;
|
|
16
|
+
private handleCommandFailure;
|
|
17
|
+
private configureCompletion;
|
|
18
|
+
private printHelp;
|
|
19
|
+
private configureParser;
|
|
20
|
+
private parseCommandWithSubCommands;
|
|
21
|
+
private getYargsCommand;
|
|
22
|
+
private configureGlobalFlags;
|
|
23
|
+
private throwForNonExistsCommand;
|
|
24
|
+
/**
|
|
25
|
+
* manipulate the command help output. there is no API from Yarn to do any of this, so it needs to be done manually.
|
|
26
|
+
* see https://github.com/yargs/yargs/issues/1956
|
|
27
|
+
*
|
|
28
|
+
* the original order of the output:
|
|
29
|
+
* description
|
|
30
|
+
* Options
|
|
31
|
+
* Commands
|
|
32
|
+
* Global
|
|
33
|
+
* Positionals
|
|
34
|
+
* Examples
|
|
35
|
+
*/
|
|
36
|
+
private logCommandHelp;
|
|
37
|
+
}
|
|
38
|
+
export declare function findCommandByArgv(commands: Command[]): Command | undefined;
|