@aladac/hu 0.1.0-a1 → 0.1.0-a3
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/CLAUDE.md +159 -29
- package/HOOKS.md +146 -0
- package/commands/bump.md +30 -0
- package/commands/claude/reference.md +42 -0
- package/commands/pricing.md +16 -0
- package/commands/publish.md +20 -0
- package/commands/reinstall.md +6 -3
- package/doc/PRICING.md +171 -0
- package/doc/cli/hooks.md +1602 -0
- package/doc/cli/iam.md +352 -0
- package/doc/cli/plugins.md +1192 -0
- package/doc/cli/settings.md +1505 -0
- package/doc/cli/tutorial.md +367 -0
- package/hooks/session-start.sh +85 -0
- package/hooks/stop.sh +51 -0
- package/hooks/user-prompt-submit.sh +74 -0
- package/justfile +8 -7
- package/package.json +5 -2
- package/plans/ethereal-bouncing-creek.md +133 -0
- package/plans/gleaming-crunching-bear.md +160 -0
- package/session.md +54 -0
- package/settings.json +47 -10
- package/src/commands/bump.ts +406 -62
- package/src/commands/data.ts +1211 -0
- package/src/commands/disk.ts +522 -0
- package/src/commands/gh.ts +480 -0
- package/src/commands/jira.ts +654 -0
- package/src/commands/plugin.ts +216 -0
- package/src/commands/services.ts +659 -0
- package/src/commands/settings.ts +432 -0
- package/src/commands/utils.ts +230 -0
- package/src/index.ts +15 -1
- package/src/lib/claude-paths.ts +136 -0
- package/src/lib/config.ts +363 -0
- package/src/lib/db.ts +59 -0
- package/src/lib/hook-io.ts +128 -0
- package/src/lib/jira.ts +779 -0
- package/src/lib/jsonl.ts +95 -0
- package/src/lib/pricing.ts +300 -0
- package/src/lib/schema.ts +164 -0
- package/src/lib/sync.ts +300 -0
- package/src/lib/table.ts +278 -0
- package/tests/lib/claude-paths.test.ts +73 -0
- package/tests/lib/config.test.ts +163 -0
- package/tests/lib/db.test.ts +230 -0
- package/tests/lib/escaping.test.ts +257 -0
- package/tests/lib/hook-io.test.ts +151 -0
- package/tests/lib/jsonl.test.ts +166 -0
- package/HOOKS-DATA-INTEGRATION.md +0 -457
- package/SAMPLE.md +0 -378
- package/TODO.md +0 -25
- package/doc/claude-code/hooks.md +0 -348
- package/doc/claude-code/plugins.md +0 -273
- /package/doc/{claude-code → cli}/capabilities.md +0 -0
- /package/doc/{claude-code → cli}/overview.md +0 -0
- /package/doc/{claude-code/sdk-protocols.md → cli/sdk.md} +0 -0
- /package/doc/{claude-code/directory-structure.md → cli/structure.md} +0 -0
- /package/{commands/warp.md → hu.db} +0 -0
package/CLAUDE.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
4
4
|
|
|
5
|
+
## Important Guidelines
|
|
6
|
+
|
|
7
|
+
**Before implementing new features**: Always check if Claude Code already has a built-in feature for the requested functionality:
|
|
8
|
+
1. Check CLI help: `claude --help`
|
|
9
|
+
2. Check interactive commands: `/help` within a session
|
|
10
|
+
3. Search the web for "Claude Code [feature name]" to find recent additions
|
|
11
|
+
4. Check official docs at docs.anthropic.com
|
|
12
|
+
|
|
13
|
+
Don't duplicate existing capabilities.
|
|
14
|
+
|
|
5
15
|
## Overview
|
|
6
16
|
|
|
7
17
|
This is the `~/.claude` configuration directory containing custom slash commands, CLI tools, and documentation management workflows for Claude Code.
|
|
@@ -11,60 +21,174 @@ This is the `~/.claude` configuration directory containing custom slash commands
|
|
|
11
21
|
- `commands/` - Slash command definitions (`.md` files that become `/command-name`)
|
|
12
22
|
- `docs/` - Documentation management commands (`/docs:*`)
|
|
13
23
|
- `plans/` - Planning commands (`/plans:*`)
|
|
14
|
-
- `
|
|
24
|
+
- `claude/` - Claude Code reference commands (`/claude:*`)
|
|
25
|
+
- `src/` - TypeScript source for the `hu` CLI
|
|
15
26
|
- `commands/` - CLI subcommand implementations
|
|
16
|
-
- `lib/` - Shared utilities (fs, colors, html conversion)
|
|
27
|
+
- `lib/` - Shared utilities (fs, colors, html conversion, db, sync)
|
|
17
28
|
- `doc/` - Reference documentation fetched from the web
|
|
18
29
|
- `documents/` - Global documentation store (`~/.claude/documents/`)
|
|
30
|
+
- `hooks/` - Hook scripts for Claude Code events
|
|
19
31
|
- `plans/` - Saved implementation plans (PLAN.md files)
|
|
20
32
|
- `plugins/` - Claude Code plugins
|
|
21
33
|
- `settings.json` - Global permissions and plugin configuration
|
|
22
34
|
|
|
23
|
-
## CLI Tool:
|
|
35
|
+
## CLI Tool: hu
|
|
24
36
|
|
|
25
37
|
A unified CLI for Claude Code workflows. Install with:
|
|
26
38
|
```bash
|
|
27
39
|
cd ~/.claude && npm install
|
|
28
40
|
```
|
|
29
41
|
|
|
30
|
-
The `
|
|
42
|
+
The `hu` binary provides these subcommands:
|
|
31
43
|
|
|
32
|
-
###
|
|
44
|
+
### hu data
|
|
45
|
+
Access Claude Code session data (requires SQLite database):
|
|
46
|
+
```bash
|
|
47
|
+
hu data sync # Sync Claude data to local database
|
|
48
|
+
hu data sync -f # Force full sync
|
|
49
|
+
hu data config # Show current configuration
|
|
50
|
+
hu data config -j # JSON output
|
|
51
|
+
hu data session list # List sessions
|
|
52
|
+
hu data session list -p <dir> # Filter by project
|
|
53
|
+
hu data stats # Show usage statistics
|
|
54
|
+
hu data todos pending # Show pending todos
|
|
55
|
+
hu data search <query> # Search messages
|
|
56
|
+
hu data tools # Show tool usage statistics
|
|
57
|
+
hu data errors # Extract errors from debug logs
|
|
58
|
+
hu data pricing # Show pricing analysis
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### hu docs
|
|
33
62
|
Documentation management:
|
|
34
63
|
```bash
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
64
|
+
hu docs list [location] # List docs (project|global|all|repo)
|
|
65
|
+
hu docs list -j # JSON output
|
|
66
|
+
hu docs check # Check system document status in repo
|
|
67
|
+
hu docs scan [target] # Scan docs for sync (shows staleness)
|
|
68
|
+
hu docs archive <file...> # Archive docs to global store
|
|
40
69
|
```
|
|
41
70
|
|
|
42
|
-
###
|
|
71
|
+
### hu plans
|
|
43
72
|
Plan management:
|
|
44
73
|
```bash
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
74
|
+
hu plans list # List saved plans
|
|
75
|
+
hu plans list -f # Full content preview
|
|
76
|
+
hu plans clear # Delete all plans (with confirmation)
|
|
77
|
+
hu plans clear -d # Dry run
|
|
49
78
|
```
|
|
50
79
|
|
|
51
|
-
###
|
|
80
|
+
### hu utils
|
|
52
81
|
Utility commands:
|
|
53
82
|
```bash
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
83
|
+
hu utils fetch-html <url> # Fetch URL, convert to markdown
|
|
84
|
+
hu utils fetch-html <url> -c # With extra cleaning
|
|
85
|
+
hu utils fetch-html <url> -s "article" # Target CSS selector
|
|
86
|
+
hu utils fetch-html <url> -o out.md # Write to file
|
|
87
|
+
|
|
88
|
+
hu utils plist <file> # Read plist as colorized JSON
|
|
89
|
+
hu utils plist com.apple.finder # Read app preferences by bundle ID
|
|
90
|
+
hu utils plist -l # List available preference plists
|
|
91
|
+
hu utils plist -s <pattern> # Search for plists by name
|
|
92
|
+
hu utils plist <file> -k <key> # Extract specific key (dot notation)
|
|
93
|
+
hu utils plist <file> -r # Output raw JSON without colors
|
|
94
|
+
|
|
95
|
+
hu utils sync-checkboxes # Clean TODO.md/PLAN.md
|
|
96
|
+
hu utils sync-checkboxes file.md # Specific file
|
|
97
|
+
hu utils sync-checkboxes -d # Dry run
|
|
62
98
|
```
|
|
63
99
|
|
|
64
|
-
###
|
|
100
|
+
### hu disk
|
|
65
101
|
Disk space analysis (macOS):
|
|
66
102
|
```bash
|
|
67
|
-
|
|
103
|
+
hu disk # Full disk inventory
|
|
104
|
+
hu disk overview # APFS volume usage
|
|
105
|
+
hu disk home # Home directory breakdown
|
|
106
|
+
hu disk library # ~/Library breakdown
|
|
107
|
+
hu disk hogs # Check common space hogs
|
|
108
|
+
hu disk models # List AI models
|
|
109
|
+
hu disk cleanup # Cleanup suggestions
|
|
110
|
+
|
|
111
|
+
hu disk known # Scan all known space hogs with cleanup commands
|
|
112
|
+
hu disk known dev-tools # Filter by category (ai-models, dev-tools, apps, caches, system, media)
|
|
113
|
+
hu disk known -m 1G # Only show items >= 1GB
|
|
114
|
+
hu disk known -j # JSON output
|
|
115
|
+
hu disk list-known # List all known hog definitions
|
|
116
|
+
hu disk list-known ai-models # List definitions for category
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### hu services
|
|
120
|
+
Services and startup items management (macOS):
|
|
121
|
+
```bash
|
|
122
|
+
hu services summary # Overview of all services
|
|
123
|
+
hu services brew list # List Homebrew services (-r for running only)
|
|
124
|
+
hu services brew start <name> # Start a brew service
|
|
125
|
+
hu services brew stop <name> # Stop a brew service
|
|
126
|
+
hu services brew restart <name> # Restart a brew service
|
|
127
|
+
hu services login # List login items and user launch agents
|
|
128
|
+
hu services launch list # List launch agents/daemons (-t agent/daemon, -s user/system)
|
|
129
|
+
hu services launch load <name> # Load (enable) a launch agent
|
|
130
|
+
hu services launch unload <name> # Unload (disable) a launch agent
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### hu gh
|
|
134
|
+
GitHub integration:
|
|
135
|
+
```bash
|
|
136
|
+
hu gh config # Show GitHub configuration
|
|
137
|
+
hu gh prs # List pull requests
|
|
138
|
+
hu gh prs -s "search term" # Search PRs
|
|
139
|
+
hu gh runs # List workflow runs
|
|
140
|
+
hu gh open <pr-number> # Open PR in browser
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### hu jira
|
|
144
|
+
Jira integration:
|
|
145
|
+
```bash
|
|
146
|
+
hu jira auth # Authenticate with Jira via OAuth 2.0
|
|
147
|
+
hu jira config # Show Jira configuration
|
|
148
|
+
hu jira sprint # Show current sprint info
|
|
149
|
+
hu jira tickets # List assigned tickets (current sprint)
|
|
150
|
+
hu jira search <query> # Search tickets
|
|
151
|
+
hu jira show <ticket> # Show ticket details
|
|
152
|
+
hu jira branch <ticket> # Create git branch from ticket
|
|
153
|
+
hu jira open <ticket> # Open ticket in browser
|
|
154
|
+
hu jira check # Find sprint tickets without descriptions
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### hu settings
|
|
158
|
+
Claude Code settings management:
|
|
159
|
+
```bash
|
|
160
|
+
hu settings show # Show settings from all scopes
|
|
161
|
+
hu settings edit # Edit settings file in $EDITOR
|
|
162
|
+
hu settings managed # View/edit managed settings (highest priority)
|
|
163
|
+
hu settings allow <pattern> # Add a permission rule
|
|
164
|
+
hu settings path # Show paths to settings files
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
### hu plugin
|
|
168
|
+
Plugin management:
|
|
169
|
+
```bash
|
|
170
|
+
hu plugin init <name> # Initialize a new plugin
|
|
171
|
+
hu plugin install # Install plugin hooks
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### hu bump
|
|
175
|
+
Version bumping with configurable patterns (auto-detects format from git tags):
|
|
176
|
+
```bash
|
|
177
|
+
hu bump run # Bump prerelease (0.1.0-a1 -> 0.1.0-a2)
|
|
178
|
+
hu bump run patch # Bump patch (0.1.0-a2 -> 0.1.1-a1)
|
|
179
|
+
hu bump run minor # Bump minor (0.1.0-a2 -> 0.2.0-a1)
|
|
180
|
+
hu bump run major # Bump major (0.1.0-a2 -> 1.0.0-a1)
|
|
181
|
+
hu bump run -p pre # Use -preN pattern instead of -aN
|
|
182
|
+
hu bump run -p beta # Use -betaN pattern
|
|
183
|
+
hu bump run -p rc # Use -rcN pattern
|
|
184
|
+
hu bump run -p none # No prerelease suffix (0.1.0)
|
|
185
|
+
hu bump run -t "" # No tag prefix (default: "v")
|
|
186
|
+
hu bump run --no-tag # Skip git tagging
|
|
187
|
+
hu bump run --no-push # Skip git push
|
|
188
|
+
hu bump run -d # Dry run
|
|
189
|
+
|
|
190
|
+
hu bump detect # Show detected version format
|
|
191
|
+
hu bump detect -j # JSON output
|
|
68
192
|
```
|
|
69
193
|
|
|
70
194
|
## Slash Commands
|
|
@@ -85,11 +209,17 @@ honbu disk # Show disk usage summary
|
|
|
85
209
|
- `/plans:sync` - Sync TODO.md and PLAN.md progress
|
|
86
210
|
- `/plans:clear` - Delete all saved plans
|
|
87
211
|
|
|
212
|
+
### Claude Code Reference (`/claude:*`)
|
|
213
|
+
- `/claude:reference [topic]` - Load Claude Code CLI reference documentation
|
|
214
|
+
|
|
88
215
|
### Utilities
|
|
89
216
|
- `/c` - Quick commit: adds all files, commits with timestamp message
|
|
217
|
+
- `/bump [type]` - Bump package version (prerelease/patch/minor/major)
|
|
218
|
+
- `/publish` - Publish package to npm registry
|
|
90
219
|
- `/disk` - Disk space analysis commands for macOS
|
|
91
|
-
- `/
|
|
92
|
-
- `/
|
|
220
|
+
- `/pricing` - Show pricing analysis and competitor comparison
|
|
221
|
+
- `/bootstrap` - Bootstrap hu if not installed
|
|
222
|
+
- `/reinstall` - Reinstall hu from source
|
|
93
223
|
- `/check-name <name>` - Check package name availability across registries
|
|
94
224
|
- `/replicate` - Diagnose a reported issue and identify code areas to investigate
|
|
95
225
|
|
|
@@ -102,7 +232,7 @@ The `/docs:*` commands explicitly ignore these files:
|
|
|
102
232
|
|
|
103
233
|
## Documentation Workflow
|
|
104
234
|
|
|
105
|
-
1. **Fetching**: `/docs:get` uses `
|
|
235
|
+
1. **Fetching**: `/docs:get` uses `hu utils fetch-html` to grab web content, stores with YAML frontmatter containing source URL and fetch date
|
|
106
236
|
2. **Manifests**: Project docs tracked in `./document-manifest.toml`, global in `~/.claude/documents/manifest.toml`
|
|
107
237
|
3. **Syncing**: `/docs:sync` re-fetches sources, follows new reference links, updates frontmatter dates
|
|
108
238
|
4. **Locations**:
|
package/HOOKS.md
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
# Hooks + Data Integration
|
|
2
|
+
|
|
3
|
+
Claude Code hooks that tap into local data stores for context-aware automation.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
### Prerequisites
|
|
8
|
+
|
|
9
|
+
Install the `hu` CLI:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
cd ~/.claude && npm install
|
|
13
|
+
npm link # or: npm install -g @aladac/hu
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
### Configure Claude Code Hooks
|
|
17
|
+
|
|
18
|
+
Add to `~/.claude/settings.json`:
|
|
19
|
+
|
|
20
|
+
```json
|
|
21
|
+
{
|
|
22
|
+
"hooks": {
|
|
23
|
+
"SessionStart": [
|
|
24
|
+
{
|
|
25
|
+
"matcher": ".*",
|
|
26
|
+
"hooks": [{ "type": "command", "command": "~/.claude/hooks/session-start.sh" }]
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
"UserPromptSubmit": [
|
|
30
|
+
{
|
|
31
|
+
"matcher": ".*",
|
|
32
|
+
"hooks": [{ "type": "command", "command": "~/.claude/hooks/user-prompt-submit.sh" }]
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"Stop": [
|
|
36
|
+
{
|
|
37
|
+
"matcher": ".*",
|
|
38
|
+
"hooks": [{ "type": "command", "command": "~/.claude/hooks/stop.sh" }]
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Configuration
|
|
46
|
+
|
|
47
|
+
The `hu` CLI uses `~/.config/hu/settings.toml` for configuration:
|
|
48
|
+
|
|
49
|
+
```toml
|
|
50
|
+
[general]
|
|
51
|
+
claude_dir = "~/.claude" # Claude Code data directory
|
|
52
|
+
database = "hu.db" # SQLite database name
|
|
53
|
+
|
|
54
|
+
[sync]
|
|
55
|
+
auto_sync_interval = 300 # Seconds between auto-syncs (0 = manual)
|
|
56
|
+
sync_on_start = true
|
|
57
|
+
|
|
58
|
+
[hooks]
|
|
59
|
+
enabled = true
|
|
60
|
+
temp_dir = "/tmp" # Temp files for hook data exchange
|
|
61
|
+
temp_file_ttl = 3600 # Cleanup temp files after (seconds)
|
|
62
|
+
|
|
63
|
+
[search]
|
|
64
|
+
default_limit = 20
|
|
65
|
+
show_snippets = true
|
|
66
|
+
|
|
67
|
+
[output]
|
|
68
|
+
default_format = "table"
|
|
69
|
+
colors = true
|
|
70
|
+
date_format = "%Y-%m-%d %H:%M"
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Features
|
|
74
|
+
|
|
75
|
+
- **Session Context Loading** - On session start, automatically loads recent sessions, pending todos, and recently modified files for the current project. Provides continuity across sessions without manual context-setting.
|
|
76
|
+
|
|
77
|
+
- **Similarity Search** - When you submit a prompt, searches past transcripts for similar prompts and solutions. Surfaces relevant prior work so you don't reinvent the wheel.
|
|
78
|
+
|
|
79
|
+
- **Usage Statistics** - Aggregates token usage, costs, peak activity hours, and model distribution from stats cache. Helps track spending and identify usage patterns.
|
|
80
|
+
|
|
81
|
+
- **Cross-Session Todo Sync** - Extracts incomplete todos from any session and makes them available globally. No more losing track of tasks when sessions end.
|
|
82
|
+
|
|
83
|
+
- **File Modification Tracking** - Monitors which files get edited frequently across sessions. Flags "hot" files that might need refactoring or closer attention.
|
|
84
|
+
|
|
85
|
+
- **Session Summarization** - On stop, extracts learnings and summaries from the session transcript. Builds a knowledge base of solved problems over time.
|
|
86
|
+
|
|
87
|
+
- **Tool Usage Patterns** - Tracks which tools are used, how often, and in what contexts. Identifies automation opportunities and common workflows.
|
|
88
|
+
|
|
89
|
+
## Data Sources
|
|
90
|
+
|
|
91
|
+
| Source | Location | Contains |
|
|
92
|
+
|--------|----------|----------|
|
|
93
|
+
| Transcripts | `projects/{path}/{session}.jsonl` | Full message history, tool calls, costs |
|
|
94
|
+
| History | `history.jsonl` | Session index with prompts |
|
|
95
|
+
| Stats | `stats-cache.json` | Aggregated metrics |
|
|
96
|
+
| Todos | `todos/{session}.json` | Task lists per session |
|
|
97
|
+
| File History | `file-history/{session}/` | File version snapshots |
|
|
98
|
+
| Plans | `plans/*.md` | Saved implementation plans |
|
|
99
|
+
| Debug | `debug/{session}.txt` | Error logs, timing data |
|
|
100
|
+
|
|
101
|
+
## Hook Events
|
|
102
|
+
|
|
103
|
+
- `SessionStart` - Load context, show recent activity
|
|
104
|
+
- `UserPromptSubmit` - Find similar past work
|
|
105
|
+
- `PreToolUse` - Check file history before edits
|
|
106
|
+
- `PostToolUse` - Track patterns, flag hot files
|
|
107
|
+
- `Stop` - Summarize session, extract learnings
|
|
108
|
+
- `SessionEnd` - Archive todos, update indexes
|
|
109
|
+
|
|
110
|
+
## CLI Commands
|
|
111
|
+
|
|
112
|
+
The `hu data` command provides access to Claude Code session data:
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
hu data sync # Sync Claude Code data to SQLite
|
|
116
|
+
hu data sync --quiet # Quiet mode for hooks
|
|
117
|
+
hu data config # Show configuration
|
|
118
|
+
hu data session list # List sessions
|
|
119
|
+
hu data session read <id> # Read session transcript
|
|
120
|
+
hu data session current # Show current session ($SESSION_ID)
|
|
121
|
+
hu data stats # Usage statistics
|
|
122
|
+
hu data search <query> # Full-text search
|
|
123
|
+
hu data tools # Tool usage patterns
|
|
124
|
+
hu data todos list # List all todos
|
|
125
|
+
hu data todos pending # Show pending todos
|
|
126
|
+
hu data errors # Extract errors from debug logs
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
All commands support `--json` for machine-readable output and `--output <path>` to write to a file.
|
|
130
|
+
|
|
131
|
+
## Architecture
|
|
132
|
+
|
|
133
|
+
The hooks use a temp-file approach for data exchange to avoid shell escaping issues:
|
|
134
|
+
|
|
135
|
+
1. Hook receives JSON input via stdin
|
|
136
|
+
2. Writes input to temp file for parsing
|
|
137
|
+
3. Calls `hu data` commands with `--json --output` flags
|
|
138
|
+
4. Reads results from temp files
|
|
139
|
+
5. Builds response JSON and outputs to stdout
|
|
140
|
+
6. Temp files are cleaned up after `temp_file_ttl` seconds
|
|
141
|
+
|
|
142
|
+
This approach ensures safe handling of:
|
|
143
|
+
- Unicode characters (emoji, CJK, RTL)
|
|
144
|
+
- Special shell characters (`$`, backticks, quotes)
|
|
145
|
+
- Multiline content and code blocks
|
|
146
|
+
- Nested JSON structures
|
package/commands/bump.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
Bump package version. Auto-detects format from git tags.
|
|
2
|
+
|
|
3
|
+
## Arguments
|
|
4
|
+
|
|
5
|
+
$ARGUMENTS - bump type: `prerelease` (default), `patch`, `minor`, `major`
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
hu bump run $ARGUMENTS
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Options
|
|
14
|
+
|
|
15
|
+
- `-p/--pattern` - prerelease pattern: `alpha` (a1), `pre` (pre1), `beta` (beta1), `rc` (rc1), `none`
|
|
16
|
+
- `-t/--tag-prefix` - git tag prefix (default: "v", use "" for none)
|
|
17
|
+
- `--no-tag` - skip git tagging
|
|
18
|
+
- `--no-push` - skip git push
|
|
19
|
+
- `--no-install` - skip npm install && npm link
|
|
20
|
+
- `-d/--dry-run` - preview changes without executing
|
|
21
|
+
|
|
22
|
+
## Examples
|
|
23
|
+
|
|
24
|
+
- `/bump` - bump prerelease (0.1.0-a1 -> 0.1.0-a2)
|
|
25
|
+
- `/bump patch` - bump patch (0.1.0-a2 -> 0.1.1-a1)
|
|
26
|
+
- `/bump minor` - bump minor version
|
|
27
|
+
- `/bump major` - bump major version
|
|
28
|
+
- `/bump -d` - dry run to preview
|
|
29
|
+
|
|
30
|
+
Run the bump now.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
Load Claude Code CLI reference documentation for implementation guidance.
|
|
2
|
+
|
|
3
|
+
## Reference Documentation
|
|
4
|
+
|
|
5
|
+
The following documentation files in `doc/cli/` provide comprehensive reference for Claude Code implementation:
|
|
6
|
+
|
|
7
|
+
| File | Content |
|
|
8
|
+
|------|---------|
|
|
9
|
+
| `settings.md` | settings.json format, scopes, permissions syntax |
|
|
10
|
+
| `hooks.md` | Hooks reference (events, matchers, configuration) |
|
|
11
|
+
| `tutorial.md` | Hooks getting started guide |
|
|
12
|
+
| `plugins.md` | Plugin system reference |
|
|
13
|
+
| `iam.md` | Identity, authentication, access management |
|
|
14
|
+
| `capabilities.md` | Tool capabilities |
|
|
15
|
+
| `structure.md` | Directory structure conventions |
|
|
16
|
+
| `sdk.md` | SDK protocols |
|
|
17
|
+
| `overview.md` | General overview |
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
When the user invokes `/claude:reference`, read the relevant documentation files from `doc/cli/` based on what they're trying to implement:
|
|
22
|
+
|
|
23
|
+
- **Settings/permissions**: Read `doc/cli/settings.md`
|
|
24
|
+
- **Hooks**: Read `doc/cli/hooks.md` and `doc/cli/tutorial.md`
|
|
25
|
+
- **Plugins**: Read `doc/cli/plugins.md`
|
|
26
|
+
- **Authentication**: Read `doc/cli/iam.md`
|
|
27
|
+
- **General questions**: Read `doc/cli/overview.md`
|
|
28
|
+
|
|
29
|
+
If no specific topic is mentioned, provide a summary of available documentation and ask what aspect they need help with.
|
|
30
|
+
|
|
31
|
+
## Example
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
User: /claude:reference settings permissions
|
|
35
|
+
Action: Read doc/cli/settings.md, focus on permissions section
|
|
36
|
+
|
|
37
|
+
User: /claude:reference hooks
|
|
38
|
+
Action: Read doc/cli/hooks.md and doc/cli/tutorial.md
|
|
39
|
+
|
|
40
|
+
User: /claude:reference
|
|
41
|
+
Action: List available topics and ask for clarification
|
|
42
|
+
```
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
Show pricing analysis and competitor comparison.
|
|
2
|
+
|
|
3
|
+
Run `hu data pricing` to show:
|
|
4
|
+
- Your subscription cost vs API equivalent cost
|
|
5
|
+
- Break-even analysis for Max tiers
|
|
6
|
+
- Competitor pricing comparison
|
|
7
|
+
|
|
8
|
+
Options:
|
|
9
|
+
- `-s, --subscription` - Your Claude subscription (free, pro, max5x, max20x)
|
|
10
|
+
- `-j, --json` - Output as JSON
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
hu data pricing
|
|
14
|
+
hu data pricing -s pro
|
|
15
|
+
hu data pricing -j
|
|
16
|
+
```
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Publish package to npm registry.
|
|
2
|
+
|
|
3
|
+
## Command
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm publish --access public --tag alpha
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
This publishes the package with:
|
|
10
|
+
- `--access public` - makes the scoped package publicly accessible
|
|
11
|
+
- `--tag alpha` - tags as alpha release (required for prerelease versions)
|
|
12
|
+
|
|
13
|
+
## Before Publishing
|
|
14
|
+
|
|
15
|
+
Ensure you have:
|
|
16
|
+
1. Bumped the version (`/bump` or `hu bump run`)
|
|
17
|
+
2. Committed and pushed all changes
|
|
18
|
+
3. Logged into npm (`npm login`)
|
|
19
|
+
|
|
20
|
+
Run the publish now.
|
package/commands/reinstall.md
CHANGED
|
@@ -3,13 +3,16 @@ Reinstall hu from source.
|
|
|
3
3
|
## Command
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
|
+
# Remove existing hu command if present (avoid conflicts)
|
|
7
|
+
which hu &>/dev/null && npm unlink -g hu 2>/dev/null
|
|
6
8
|
cd ~/.claude && npm install && npm link
|
|
7
9
|
```
|
|
8
10
|
|
|
9
11
|
This will:
|
|
10
|
-
1.
|
|
11
|
-
2.
|
|
12
|
-
3.
|
|
12
|
+
1. Remove any existing `hu` command to avoid conflicts
|
|
13
|
+
2. Install/update dependencies from package.json
|
|
14
|
+
3. Rebuild TypeScript via tsx
|
|
15
|
+
4. Update global symlink for `hu` binary
|
|
13
16
|
|
|
14
17
|
## Verify
|
|
15
18
|
|