Skip to content

Commit 261727c

Browse files
committed
feat(cli): add --skill flag for auto-generating Claude Code skill files
1 parent 0f22da5 commit 261727c

File tree

6 files changed

+1017
-264
lines changed

6 files changed

+1017
-264
lines changed

contrib/claude-skill-bit-cli/CLI_FLAGS.md

Lines changed: 731 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 47 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,94 +1,86 @@
11
# Bit CLI Skill for Claude Code
22

3-
This skill provides Claude Code with accurate Bit CLI command reference, eliminating trial-and-error when running bit commands.
3+
A lightweight skill that provides Claude Code with Bit CLI command reference using progressive disclosure.
4+
5+
## How It Works
6+
7+
The skill uses a two-level approach to minimize token usage:
8+
9+
1. **SKILL.md** (~800 tokens) - Command index with descriptions, loaded when you ask about bit commands
10+
2. **CLI_FLAGS.md** (~2000 tokens) - Flag details, loaded only when needed
11+
3. **Fallback** - `bit <command> --help` for anything not covered
12+
13+
No bash scripts, no permission prompts, minimal context usage.
414

515
## Installation
616

7-
### Quick Install (recommended)
17+
### Quick Install
818

919
```bash
10-
# Create the skill directory
1120
mkdir -p ~/.claude/skills/bit-cli
1221

13-
# Download the skill files
1422
curl -fsL https://raw.githubusercontent.com/teambit/bit/master/contrib/claude-skill-bit-cli/SKILL.md \
1523
-o ~/.claude/skills/bit-cli/SKILL.md
1624

17-
curl -fsL https://raw.githubusercontent.com/teambit/bit/master/contrib/claude-skill-bit-cli/bit-cli-lookup \
18-
-o ~/.claude/skills/bit-cli/bit-cli-lookup
19-
20-
# Make the lookup script executable
21-
chmod +x ~/.claude/skills/bit-cli/bit-cli-lookup
22-
23-
# Download the CLI reference (or let it auto-download on first use)
24-
~/.claude/skills/bit-cli/bit-cli-lookup --update
25+
curl -fsL https://raw.githubusercontent.com/teambit/bit/master/contrib/claude-skill-bit-cli/CLI_FLAGS.md \
26+
-o ~/.claude/skills/bit-cli/CLI_FLAGS.md
2527
```
2628

2729
### One-liner
2830

2931
```bash
30-
mkdir -p ~/.claude/skills/bit-cli && cd ~/.claude/skills/bit-cli && curl -fsLO https://raw.githubusercontent.com/teambit/bit/master/contrib/claude-skill-bit-cli/SKILL.md && curl -fsLO https://raw.githubusercontent.com/teambit/bit/master/contrib/claude-skill-bit-cli/bit-cli-lookup && chmod +x bit-cli-lookup && ./bit-cli-lookup --update
32+
mkdir -p ~/.claude/skills/bit-cli && cd ~/.claude/skills/bit-cli && curl -fsLO https://raw.githubusercontent.com/teambit/bit/master/contrib/claude-skill-bit-cli/SKILL.md && curl -fsLO https://raw.githubusercontent.com/teambit/bit/master/contrib/claude-skill-bit-cli/CLI_FLAGS.md
3133
```
3234

33-
### Manual Install
35+
## What's Included
3436

35-
1. Copy the following files to `~/.claude/skills/bit-cli/`:
37+
### SKILL.md (Level 2 - loaded when triggered)
3638

37-
- `SKILL.md`
38-
- `bit-cli-lookup`
39+
- All public commands organized by category
40+
- One-line descriptions
41+
- Auto-generated from `bit cli generate --skill commands`
3942

40-
2. Make the lookup script executable:
43+
### CLI_FLAGS.md (Level 3 - loaded on demand)
4144

42-
```bash
43-
chmod +x ~/.claude/skills/bit-cli/bit-cli-lookup
44-
```
45+
- Full command reference with descriptions, args, and flags
46+
- Auto-generated from `bit cli generate --skill flags`
47+
- Fallback to `bit --help` for more details
4548

46-
3. Download the CLI reference:
47-
```bash
48-
~/.claude/skills/bit-cli/bit-cli-lookup --update
49-
```
49+
## Token Usage
5050

51-
## Requirements
51+
| Scenario | Tokens Used |
52+
| ----------------------- | ----------------- |
53+
| Skill metadata (always) | ~100 |
54+
| Command lookup | ~800 |
55+
| Need flag details | ~800 + ~2000 |
56+
| Edge case | Uses `bit --help` |
5257

53-
- `jq` - JSON processor (install with `brew install jq` or `apt install jq`)
54-
- `curl` - For downloading updates
55-
56-
## How It Works
58+
## Keeping Updated
5759

58-
1. Claude Code automatically discovers this skill when you ask about bit commands
59-
2. Instead of loading the full 5000+-line CLI reference, Claude runs the lookup script
60-
3. The script returns only the relevant command info (~20-50 lines)
61-
4. Claude uses the accurate flags without trial-and-error
60+
```bash
61+
cd ~/.claude/skills/bit-cli
62+
curl -fsLO https://raw.githubusercontent.com/teambit/bit/master/contrib/claude-skill-bit-cli/SKILL.md
63+
curl -fsLO https://raw.githubusercontent.com/teambit/bit/master/contrib/claude-skill-bit-cli/CLI_FLAGS.md
64+
```
6265

63-
## Usage (for humans)
66+
## Regenerating (for Bit developers)
6467

65-
You can also use the lookup script directly:
68+
The skill files are auto-generated from the Bit CLI:
6669

6770
```bash
68-
# Look up a specific command
69-
~/.claude/skills/bit-cli/bit-cli-lookup snap
70-
~/.claude/skills/bit-cli/bit-cli-lookup tag
71-
~/.claude/skills/bit-cli/bit-cli-lookup export
72-
73-
# List all commands
74-
~/.claude/skills/bit-cli/bit-cli-lookup --list
71+
# Generate command list (SKILL.md body)
72+
bit cli generate --skill commands
7573

76-
# Update to latest CLI reference
77-
~/.claude/skills/bit-cli/bit-cli-lookup --update
74+
# Generate flag reference (CLI_FLAGS.md)
75+
bit cli generate --skill flags
7876
```
7977

80-
## Keeping Updated
78+
## Alternative: Full MCP Server
8179

82-
The CLI reference is fetched from the Bit repository. To update:
80+
For a more comprehensive solution with real-time command discovery, consider using the Bit MCP server instead:
8381

8482
```bash
85-
~/.claude/skills/bit-cli/bit-cli-lookup --update
83+
bit mcp-server setup claude-code
8684
```
8785

88-
## Troubleshooting
89-
90-
**"jq not found"**: Install jq with your package manager
91-
92-
**"CLI reference not found"**: Run `bit-cli-lookup --update` to download it
93-
94-
**Command not found**: Check spelling, or run `bit-cli-lookup --list` to see available commands
86+
The MCP server provides dynamic access to all commands but requires more resources.
Lines changed: 107 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,125 @@
11
---
22
name: bit-cli
3-
description: Bit CLI command reference with all flags and options. Use this skill BEFORE running any bit command to get the correct syntax, flags, and arguments. Covers all bit commands including snap, tag, export, import, install, status, compile, test, add, remove, and 100+ more.
3+
description: Bit CLI command reference. Use before running bit commands to get correct syntax and flags.
44
---
55

6-
# Bit CLI Reference
6+
# Bit CLI Quick Reference
77

8-
This skill provides accurate command syntax for the Bit CLI. **Always use the lookup script before running bit commands** to avoid trial-and-error with flags.
8+
<!-- This content is auto-generated by: bit cli generate --skill commands -->
99

10-
## Usage
10+
usage: bit [--version] [--help] <command> [<args>]
1111

12-
To find the correct syntax for any bit command:
12+
bit documentation: https://bit.dev/
1313

14-
```bash
15-
~/.claude/skills/bit-cli/bit-cli-lookup <command-name>
16-
```
14+
System & Utility
15+
help display available commands and usage information
16+
version display the installed Bit version
17+
config manage Bit configuration settings
18+
globals display global directories and paths used by Bit
19+
system access system-level operations and debugging tools
20+
doctor diagnose and troubleshoot workspace issues
21+
clear-cache remove cached data to resolve stale data issues
1722

18-
### Examples
23+
Information & Analysis
24+
show display component metadata, dependencies, and configuration
25+
graph visualize component dependencies as a graph image
26+
pattern test and validate component patterns
27+
list display components in workspace or remote scope
28+
diff compare component changes between versions or against the current workspace
29+
status show workspace component status and issues
30+
schema display component API schema and type definitions
1931

20-
```bash
21-
# Get snap command syntax
22-
~/.claude/skills/bit-cli/bit-cli-lookup snap
32+
Component Configuration
33+
envs show components and their assigned environments
34+
scope manage component scope names and assignments
35+
eject-conf create component.json configuration files for components
36+
local-only manage components that exist only in the workspace
37+
aspect manage component aspects and their configurations
2338

24-
# Get tag command syntax
25-
~/.claude/skills/bit-cli/bit-cli-lookup tag
39+
Collaboration & Remote
40+
remote manage remote scopes for self-hosted environments
41+
deprecate mark a component as deprecated to discourage its use
42+
undeprecate remove the deprecation status from a component
43+
import bring components from remote scopes into your workspace
44+
delete soft-delete components from remote scopes
45+
recover restore soft-deleted components
46+
export upload components to remote scopes
47+
lane manage lanes for parallel development
48+
ci continuous integration commands for automated workflows
49+
fork create a new component by copying from an existing one
2650

27-
# Get export command syntax
28-
~/.claude/skills/bit-cli/bit-cli-lookup export
51+
Run & Serve
52+
start launch the Bit development server
53+
run start an application component locally
54+
app manage application components
2955

30-
# Search for commands containing "env"
31-
~/.claude/skills/bit-cli/bit-cli-lookup env
56+
Advanced/Debug
57+
capsule manage isolated component environments
58+
mcp-server start Model Context Protocol server for AI assistants
3259

33-
# List all available commands
34-
~/.claude/skills/bit-cli/bit-cli-lookup --list
35-
```
60+
Develop components
61+
script run a script defined by the environment
3662

37-
## Important Notes
63+
Workspace Tools
64+
ws-config generate IDE configuration files
65+
git Git utilities for Bit repositories
66+
refactor automatically refactor component source code
3867

39-
- The lookup returns the exact flags with short (`-m`) and long (`--message`) forms
40-
- Subcommands are included (e.g., `env set`, `env get`, `lane merge`)
41-
- Arguments show whether they're required `<arg>` or optional `[arg]`
42-
- Always check before using unfamiliar flags
68+
Component Development
69+
add track existing directory contents as new components in the workspace
70+
create scaffold new component(s) from a template (sources, config, and env)
71+
templates list available templates for creating components and workspaces
72+
watch watch and compile components on file changes
73+
build run build pipeline tasks in isolated environments
74+
compile transpile component source files
75+
move relocate a component to a different directory
76+
remove untrack components from the workspace
77+
rename change a component name
4378

44-
## Common Commands Quick Reference
79+
Workspace & Project Setup
80+
new create a new Bit workspace from a template
81+
init initialize a Bit workspace in an existing project
4582

46-
| Command | Description |
47-
| --------- | --------------------------------- |
48-
| `snap` | Create a snapshot (dev version) |
49-
| `tag` | Create a semver release version |
50-
| `export` | Push components to remote scope |
51-
| `import` | Pull components from remote scope |
52-
| `install` | Install dependencies |
53-
| `status` | Show workspace status |
54-
| `compile` | Compile components |
55-
| `test` | Run component tests |
56-
| `build` | Run full build pipeline |
57-
| `add` | Track new components |
58-
| `remove` | Remove components |
59-
| `lane` | Work with lanes (branches) |
83+
Testing & Quality
84+
artifacts view and download build artifacts
85+
test run component tests
86+
check-types validate TypeScript type correctness
87+
lint analyze component code for issues and style violations
88+
validate run type-checking, linting, and testing in sequence
89+
format auto-format component source code
90+
91+
Dependencies & Packages
92+
install install workspace dependencies
93+
uninstall remove dependencies from workspace
94+
update update workspace dependencies to newer versions
95+
link create links between components and node_modules
96+
eject remove component from workspace and install it as npm package
97+
deps manage component dependencies
98+
why find components that use the specified dependency
99+
set-peer configure component to always be installed as peer dependency
100+
unset-peer remove always-peer configuration from component
101+
dependents show components that depend on the specified component
102+
103+
Version Control
104+
checkout switch between component versions or remove local changes
105+
revert replace component files with specified version while preserving current version
106+
tag create immutable component snapshots with semantic version tags
107+
snap create immutable component snapshots for development versions
108+
reset revert local tags and snaps to previous versions
109+
merge merge diverged component history when local and remote have different versions
110+
stash temporarily save and restore component changes
111+
log display component version history
112+
log-file EXPERIMENTAL. display history of changes to a specific file
113+
blame EXPERIMENTAL. show line-by-line authorship and modification history
114+
115+
Authentication & Cloud
116+
login authenticate with Bit Cloud for component publishing and collaboration
117+
logout sign out of Bit Cloud and clear authentication tokens
118+
whoami display the currently authenticated Bit Cloud user
119+
npmrc configure .npmrc file with Bit Cloud registry and authentication settings
120+
121+
Dot-bit
122+
sign complete the build process for components
123+
124+
For flag details, see [CLI_FLAGS.md](CLI_FLAGS.md).
125+
Run 'bit <command> --help' for more information on a specific command.

0 commit comments

Comments
 (0)