skill-creator 1.5.1 → 1.5.2
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/README.md +173 -103
- package/dist/buildIndex-B_9ABRtx.mjs +2 -0
- package/dist/buildIndex-B_9ABRtx.mjs.map +1 -0
- package/dist/buildIndex-Cea97e0l.mjs +1 -0
- package/dist/cli.d.mts +0 -0
- package/dist/cli.d.mts.map +1 -1
- package/dist/cli.mjs +17 -33
- package/dist/cli.mjs.map +1 -1
- package/dist/contentManager-CoVTiSDT.mjs +13 -0
- package/dist/contentManager-CoVTiSDT.mjs.map +1 -0
- package/dist/contentManager-CwquwC1s.mjs +1 -0
- package/dist/context7-BejCCqkm.mjs +1 -0
- package/dist/context7-BxMpyQiW.mjs +2 -0
- package/dist/context7-BxMpyQiW.mjs.map +1 -0
- package/dist/index.d.mts +317 -123
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1 -20
- package/dist/index.mjs.map +1 -1
- package/dist/{listContext7-DKXzgWdn.mjs → listContext7-DHj9AL-z.mjs} +2 -2
- package/dist/{listContext7-DKXzgWdn.mjs.map → listContext7-DHj9AL-z.mjs.map} +1 -1
- package/dist/package-CFJazwTO.mjs +2 -0
- package/dist/package-CFJazwTO.mjs.map +1 -0
- package/dist/referenceSearchUtils-DZgupMZp.mjs +2 -0
- package/dist/referenceSearchUtils-DZgupMZp.mjs.map +1 -0
- package/dist/removeContext7-BZtL4_CJ.mjs +3 -0
- package/dist/{removeContext7-DOXrTXeI.mjs.map → removeContext7-BZtL4_CJ.mjs.map} +1 -1
- package/dist/{removeSkill-C-ehFexk.mjs → removeSkill-Bat_plVG.mjs} +4 -4
- package/dist/removeSkill-Bat_plVG.mjs.map +1 -0
- package/dist/removeSkill-DjDZjhJU.mjs +1 -0
- package/dist/runScript-CSKqb831.mjs +13 -0
- package/dist/runScript-CSKqb831.mjs.map +1 -0
- package/dist/scopeSelection-BWteJQSv.mjs +2 -0
- package/dist/scopeSelection-BWteJQSv.mjs.map +1 -0
- package/dist/searchQuality-DVdHmamh.mjs +2 -0
- package/dist/searchQuality-DVdHmamh.mjs.map +1 -0
- package/dist/search_format-RyjXACJa.mjs +5 -0
- package/dist/search_format-RyjXACJa.mjs.map +1 -0
- package/dist/shared-DsVh4gOV.mjs +2 -0
- package/dist/shared-DsVh4gOV.mjs.map +1 -0
- package/dist/skillCreator-BomXoqdw.mjs +2 -0
- package/dist/skillCreator-BomXoqdw.mjs.map +1 -0
- package/dist/skillMdManager-DGBZ6M5J.mjs +7 -0
- package/dist/skillMdManager-DGBZ6M5J.mjs.map +1 -0
- package/dist/sqliteVectorSearchAdapter-56kZjbUT.mjs +28 -0
- package/dist/sqliteVectorSearchAdapter-56kZjbUT.mjs.map +1 -0
- package/dist/sqliteVectorSearchAdapter-DNkyKuZs.mjs +1 -0
- package/dist/unifiedSearch-CLdazMYU.mjs +4 -0
- package/dist/unifiedSearch-CLdazMYU.mjs.map +1 -0
- package/dist/unifiedSearch-DCFPrtzZ.mjs +1 -0
- package/package.json +32 -28
- package/templates/SKILL.md +19 -4
- package/templates/SKILL.zh-CN.md +54 -12
- package/templates/skill-creator.md +52 -19
- package/templates/skill-creator.zh-CN.md +55 -22
- package/dist/chunk-Da8dvM5T.mjs +0 -1
- package/dist/contentManager-8rmWJMb6.mjs +0 -22
- package/dist/contentManager-8rmWJMb6.mjs.map +0 -1
- package/dist/contentManager-Xt8N5psY.mjs +0 -1
- package/dist/dist-DZL34HNo.mjs +0 -8
- package/dist/dist-DZL34HNo.mjs.map +0 -1
- package/dist/dist-X_kVEzbK.mjs +0 -1
- package/dist/esm-8qfZdcpd.mjs +0 -33
- package/dist/esm-8qfZdcpd.mjs.map +0 -1
- package/dist/esm-BF5pvSbc.mjs +0 -1
- package/dist/esm-BbhxxeGF.mjs +0 -4
- package/dist/esm-BbhxxeGF.mjs.map +0 -1
- package/dist/package-Cxx_VSyD.mjs +0 -2
- package/dist/package-Cxx_VSyD.mjs.map +0 -1
- package/dist/path-CuoiIaIe.mjs +0 -2
- package/dist/path-CuoiIaIe.mjs.map +0 -1
- package/dist/removeContext7-DOXrTXeI.mjs +0 -3
- package/dist/removeSkill-C-ehFexk.mjs.map +0 -1
- package/dist/removeSkill-DWwhvzej.mjs +0 -1
- package/dist/runScript-Cr9RRN9y.mjs +0 -14
- package/dist/runScript-Cr9RRN9y.mjs.map +0 -1
- package/dist/search_format-DIs-1lKk.mjs +0 -5
- package/dist/search_format-DIs-1lKk.mjs.map +0 -1
- package/dist/shared-CFoY2Xhg.mjs +0 -2
- package/dist/shared-CFoY2Xhg.mjs.map +0 -1
- package/dist/skillMdManager-DP8fGZb7.mjs +0 -7
- package/dist/skillMdManager-DP8fGZb7.mjs.map +0 -1
- package/dist/unifiedSearch-CGZXw0NB.mjs +0 -1
- package/dist/unifiedSearch-l-lrSc9C.mjs +0 -4
- package/dist/unifiedSearch-l-lrSc9C.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -10,14 +10,14 @@ A powerful composite tool for creating and managing Claude Code skills. It serve
|
|
|
10
10
|
### Core Capabilities
|
|
11
11
|
|
|
12
12
|
- 🚀 **Automated Skill Creation**: Generate skills with proper folder naming (`package@version` format)
|
|
13
|
-
- 📚 **Context7 Integration**:
|
|
14
|
-
- 🔍 **Intelligent Search**:
|
|
13
|
+
- 📚 **Context7 Integration**: Resolve the best Context7 project ID, then download and slice documentation automatically
|
|
14
|
+
- 🔍 **Intelligent Search**: Lightweight local full-text search with optional explicit vector mode
|
|
15
15
|
- 💾 **Dynamic Content Management**: Add custom knowledge with deduplication
|
|
16
16
|
|
|
17
17
|
### CLI & Subagent
|
|
18
18
|
|
|
19
19
|
- 🛠️ **Modern TypeScript**: Full type safety with ESM modules
|
|
20
|
-
- 🎯 **
|
|
20
|
+
- 🎯 **CLI-first Workflow**: Non-interactive by default, with explicit interactive prompts when requested
|
|
21
21
|
- 🤖 **Subagent Mode**: Intelligent agent that handles the entire skill creation workflow
|
|
22
22
|
- 📦 **Flexible Storage**: Store skills in project (`.claude/skills/`) or user directory (`~/.claude/skills`)
|
|
23
23
|
|
|
@@ -31,68 +31,23 @@ npm install -g skill-creator
|
|
|
31
31
|
|
|
32
32
|
### Verify Installation
|
|
33
33
|
|
|
34
|
-
After installation,
|
|
34
|
+
After installation, verify that the CLI is available:
|
|
35
35
|
|
|
36
36
|
```bash
|
|
37
|
-
# Check if Context7 MCP is accessible
|
|
38
37
|
skill-creator --help
|
|
39
|
-
|
|
40
|
-
# The help should show all commands if MCP servers are properly configured
|
|
41
38
|
```
|
|
42
39
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
Before installing skill-creator, make sure you have the required MCP (Model Context Protocol) servers installed for full functionality:
|
|
46
|
-
|
|
47
|
-
<details>
|
|
48
|
-
<summary>Context7 MCP - For downloading and managing documentation</summary>
|
|
49
|
-
|
|
50
|
-
```bash
|
|
51
|
-
# Install from npm
|
|
52
|
-
npm install -g @upstash/context7-mcp
|
|
53
|
-
|
|
54
|
-
# Or follow installation guide: https://github.com/upstash/context7?tab=readme-ov-file
|
|
40
|
+
If the help output renders, the local skill workflow is available.
|
|
55
41
|
|
|
56
|
-
|
|
42
|
+
### Runtime Prerequisites
|
|
57
43
|
|
|
58
|
-
|
|
44
|
+
`skill-creator` does not require Claude Code MCP servers for its core CLI workflow.
|
|
59
45
|
|
|
60
|
-
|
|
61
|
-
|
|
46
|
+
It uses:
|
|
47
|
+
- npm registry HTTP APIs for `search` and `get-info`
|
|
48
|
+
- Context7 HTTP APIs for `resolve-context7` and `download-context7`
|
|
62
49
|
|
|
63
|
-
|
|
64
|
-
# Install from npm
|
|
65
|
-
npm install -g @chromedevtools/chrome-devtools-mcp
|
|
66
|
-
|
|
67
|
-
# Or follow installation guide: https://github.com/ChromeDevTools/chrome-devtools-mcp?tab=readme-ov-file
|
|
68
|
-
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
</details>
|
|
72
|
-
|
|
73
|
-
<details>
|
|
74
|
-
<summary>MCP Server Configuration</summary>
|
|
75
|
-
|
|
76
|
-
After installing the MCP servers, you need to configure them in your Claude Code settings. Add the following to your Claude Code configuration:
|
|
77
|
-
|
|
78
|
-
```json
|
|
79
|
-
{
|
|
80
|
-
"mcpServers": {
|
|
81
|
-
"context7": {
|
|
82
|
-
"command": "npx",
|
|
83
|
-
"args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_CONTEXT7_API_KEY"]
|
|
84
|
-
},
|
|
85
|
-
"chrome-devtools": {
|
|
86
|
-
"command": "npx",
|
|
87
|
-
"args": ["-y", "chrome-devtools-mcp@latest"]
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
> **Note**: The MCP servers are required for full functionality. Without them, some features like Context7 documentation downloading and web-based research may not work properly.
|
|
94
|
-
|
|
95
|
-
</details>
|
|
50
|
+
You only need normal outbound network access when using those commands.
|
|
96
51
|
|
|
97
52
|
## Quick Start
|
|
98
53
|
|
|
@@ -105,8 +60,23 @@ npm install -g skill-creator
|
|
|
105
60
|
### 2. Setup for Claude Code
|
|
106
61
|
|
|
107
62
|
```bash
|
|
108
|
-
# Interactive installation -
|
|
63
|
+
# Interactive installation - defaults to current when a local subagent already exists, otherwise user
|
|
109
64
|
skill-creator init
|
|
65
|
+
|
|
66
|
+
# Non-interactive installation with explicit default scope resolution
|
|
67
|
+
skill-creator init --scope auto
|
|
68
|
+
|
|
69
|
+
# Machine-readable installation output for tooling/subagents
|
|
70
|
+
skill-creator init-cc --json
|
|
71
|
+
|
|
72
|
+
# Machine-readable documentation sync output
|
|
73
|
+
skill-creator download-context7 --pwd ~/.claude/skills/zustand@5 --package zustand --package-version 5.0.0 --json
|
|
74
|
+
|
|
75
|
+
# Machine-readable user-note output
|
|
76
|
+
skill-creator add-skill --package zustand --title "Best Practices" --content "Your custom notes" --json
|
|
77
|
+
|
|
78
|
+
# Machine-readable index build output
|
|
79
|
+
skill-creator build-index --pwd ~/.claude/skills/zustand@5 --json
|
|
110
80
|
```
|
|
111
81
|
|
|
112
82
|
### 3. Choose Your Usage Mode
|
|
@@ -136,17 +106,39 @@ skill-creator search "react query"
|
|
|
136
106
|
# Get package information (Options)
|
|
137
107
|
skill-creator get-info @tanstack/react-query
|
|
138
108
|
|
|
139
|
-
# Create skill with
|
|
140
|
-
skill-creator create-cc-skill --scope user --name "@tanstack/react-query" --description "React Query for data fetching" @tanstack/react-query@5
|
|
109
|
+
# Create skill with package identity only
|
|
110
|
+
skill-creator create-cc-skill --scope user --name "@tanstack/react-query" --description "React Query for data fetching" @tanstack/react-query@5 --json
|
|
111
|
+
|
|
112
|
+
# Create skill with a custom visible skill name while keeping the source package identity
|
|
113
|
+
skill-creator create-cc-skill --scope user --name "@tanstack/react-query" --skill-name "react-query" --description "React Query for data fetching" @tanstack/react-query@5 --json
|
|
114
|
+
|
|
115
|
+
# Let the CLI choose the default storage scope automatically
|
|
116
|
+
skill-creator create-cc-skill --scope auto --name zod --description "Zod validation skill" zod@4 --json
|
|
141
117
|
|
|
142
118
|
# Create skill with interactive prompts
|
|
143
|
-
skill-creator create-cc-skill --interactive --description "React Query for data fetching" @tanstack/react-query@5
|
|
119
|
+
skill-creator create-cc-skill --scope user --interactive --description "React Query for data fetching" @tanstack/react-query@5
|
|
120
|
+
|
|
121
|
+
# Resolve the best Context7 project id
|
|
122
|
+
skill-creator resolve-context7 @tanstack/react-query
|
|
123
|
+
|
|
124
|
+
# If no package-path candidate matches reliably, the command exits instead of returning a wrong website mirror
|
|
125
|
+
skill-creator resolve-context7 is-odd --package-version 3.0.1
|
|
144
126
|
|
|
145
|
-
# Download documentation
|
|
127
|
+
# Download documentation directly from the package name
|
|
128
|
+
skill-creator download-context7 --package @tanstack/react-query --package-version 5.0.0
|
|
129
|
+
|
|
130
|
+
# If the skill was created from a package, the package metadata is stored in SKILL.md
|
|
131
|
+
# so the same download can usually be triggered with only the skill path
|
|
132
|
+
skill-creator download-context7 --pwd ~/.claude/skills/@tanstack__react-query@5
|
|
133
|
+
|
|
134
|
+
# Or download with an explicit resolved Context7 id
|
|
146
135
|
skill-creator download-context7 --package @tanstack/react-query /tanstack/react-query
|
|
147
136
|
|
|
148
137
|
# Search your skill knowledge base
|
|
149
138
|
skill-creator search-skill --package @tanstack/react-query "useQuery hook"
|
|
139
|
+
|
|
140
|
+
# Append a structured knowledge update into the closest matching user note
|
|
141
|
+
skill-creator add-skill --package @tanstack/react-query --title "Bundle guidance" --content "Prefer React Query cache ownership conventions in bundle-sensitive apps." --force-append
|
|
150
142
|
```
|
|
151
143
|
|
|
152
144
|
## Commands
|
|
@@ -155,7 +147,7 @@ skill-creator search-skill --package @tanstack/react-query "useQuery hook"
|
|
|
155
147
|
|
|
156
148
|
| Command | Description |
|
|
157
149
|
| --------- | ----------------------------------------------------------- |
|
|
158
|
-
| `init` | Install skill-creator as Claude Code subagent (
|
|
150
|
+
| `init` | Install skill-creator as Claude Code subagent (`user`, `current`, or `auto`) |
|
|
159
151
|
| `init-cc` | Install skill-creator as subagent in user directory |
|
|
160
152
|
|
|
161
153
|
### Skill Creation (CLI Mode)
|
|
@@ -164,13 +156,15 @@ skill-creator search-skill --package @tanstack/react-query "useQuery hook"
|
|
|
164
156
|
| ------------------------ | -------------------------------- |
|
|
165
157
|
| `search <keywords>` | Search npm packages |
|
|
166
158
|
| `get-info <package>` | Get detailed package information |
|
|
159
|
+
| `resolve-context7 <package>` | Resolve the best Context7 library id |
|
|
167
160
|
| `create-cc-skill <name>` | Create a new skill directory |
|
|
168
161
|
|
|
169
162
|
### Content Management
|
|
170
163
|
|
|
171
164
|
| Command | Description |
|
|
172
165
|
| -------------------------------- | ----------------------------------------- |
|
|
173
|
-
| `download-context7
|
|
166
|
+
| `download-context7 [project_id]` | Download and slice Context7 documentation |
|
|
167
|
+
| `build-index` | Build or refresh the local search index |
|
|
174
168
|
| `search-skill <query>` | Search in skill knowledge base |
|
|
175
169
|
| `add-skill` | Add custom knowledge to skill |
|
|
176
170
|
|
|
@@ -178,14 +172,21 @@ skill-creator search-skill --package @tanstack/react-query "useQuery hook"
|
|
|
178
172
|
|
|
179
173
|
### Options
|
|
180
174
|
|
|
181
|
-
- `--scope <user|current>`: Storage location for skills (required)
|
|
175
|
+
- `--scope <user|current|auto>`: Storage location for skills (required). `auto` resolves to `current` when `.claude/agents/skill-creator.md` exists, otherwise `user`
|
|
182
176
|
- `--name <name>`: Package name for the skill (recommended)
|
|
177
|
+
- `--skill-name <name>`: Visible skill name written into `SKILL.md`. When omitted, the visible skill name defaults to `--name` when present, otherwise `skill_dir_name`
|
|
183
178
|
- `--pwd <path>`: Working directory for skill operations
|
|
184
179
|
- `--package <name>`: Use package name to find skill directory
|
|
180
|
+
- `--package-version <version>`: Version hint for Context7 library resolution
|
|
185
181
|
- `--description <description>`: Custom description for the skill
|
|
186
|
-
- `--force`:
|
|
187
|
-
- `--
|
|
182
|
+
- `--force`: Replace the closest matching user knowledge note when adding content
|
|
183
|
+
- `--force-append`: Append a structured knowledge update into the closest matching user note
|
|
184
|
+
- `--skip-indexing`: Skip automatic local index building
|
|
188
185
|
- `--interactive`: Enable interactive prompts
|
|
186
|
+
- `--json`: Print machine-readable output for `init`, `init-cc`, `create-cc-skill`, `download-context7`, `add-skill`, and `build-index`
|
|
187
|
+
|
|
188
|
+
When `--package <name>` is used to find an existing skill, the CLI first checks the
|
|
189
|
+
`<skill-package ...>` metadata stored in `SKILL.md`. Directory-name matching is only a fallback.
|
|
189
190
|
|
|
190
191
|
## Workflow
|
|
191
192
|
|
|
@@ -206,26 +207,53 @@ skill-creator search-skill --package @tanstack/react-query "useQuery hook"
|
|
|
206
207
|
3. **Create Skill**: Set up skill directory (requires --scope, recommended to use --name)
|
|
207
208
|
|
|
208
209
|
```bash
|
|
209
|
-
# With
|
|
210
|
-
skill-creator create-cc-skill --scope current --name zustand --description "Zustand state management"
|
|
210
|
+
# With source package identity only
|
|
211
|
+
skill-creator create-cc-skill --scope current --name zustand --description "Zustand state management" zustand@5 --json
|
|
212
|
+
|
|
213
|
+
# With a separate visible skill name
|
|
214
|
+
skill-creator create-cc-skill --scope current --name @tanstack/router --skill-name router-skill --description "Router workflow skill" tanstack-router@1 --json
|
|
215
|
+
|
|
216
|
+
# With explicit default scope resolution handled by the CLI
|
|
217
|
+
skill-creator create-cc-skill --scope auto --name zod --description "Zod validation skill" zod@4 --json
|
|
211
218
|
|
|
212
219
|
# With interactive prompts
|
|
213
220
|
skill-creator create-cc-skill --scope current --interactive zustand
|
|
214
221
|
```
|
|
215
222
|
|
|
216
|
-
|
|
223
|
+
`--name` records the source package identity for later package-aware workflows. `--skill-name` only controls the visible skill title written into `SKILL.md`.
|
|
224
|
+
|
|
225
|
+
4. **Resolve Context7 Project ID**: Pick the strongest Context7 source for the package
|
|
217
226
|
|
|
218
227
|
```bash
|
|
228
|
+
skill-creator resolve-context7 zustand --package-version 5.0.0
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
5. **Download Documentation**: Get Context7 docs with automatic indexing
|
|
232
|
+
|
|
233
|
+
```bash
|
|
234
|
+
# Simplest path when the skill already stores package metadata
|
|
235
|
+
skill-creator download-context7 --pwd ~/.claude/skills/zustand@5
|
|
236
|
+
|
|
237
|
+
# One-step path: resolve and download from the package name
|
|
238
|
+
skill-creator download-context7 --package zustand --package-version 5.0.0
|
|
239
|
+
|
|
240
|
+
# Two-step path: supply the explicit Context7 project id
|
|
219
241
|
skill-creator download-context7 --package zustand /zustand
|
|
220
242
|
```
|
|
221
243
|
|
|
222
|
-
|
|
244
|
+
6. **Add Custom Knowledge**: Enhance with your own content
|
|
223
245
|
|
|
224
246
|
```bash
|
|
225
247
|
skill-creator add-skill --package zustand --title "Best Practices" --content "Your custom notes"
|
|
248
|
+
|
|
249
|
+
# Replace the closest existing user note
|
|
250
|
+
skill-creator add-skill --package zustand --title "Best Practices" --content "Updated note" --force
|
|
251
|
+
|
|
252
|
+
# Append a structured update into the closest existing user note
|
|
253
|
+
skill-creator add-skill --package zustand --title "Operational update" --content "Additional guidance" --force-append
|
|
226
254
|
```
|
|
227
255
|
|
|
228
|
-
|
|
256
|
+
7. **Search Knowledge Base**: Query your skill
|
|
229
257
|
```bash
|
|
230
258
|
skill-creator search-skill --package zustand "typescript patterns"
|
|
231
259
|
```
|
|
@@ -236,24 +264,15 @@ skill-creator search-skill --package @tanstack/react-query "useQuery hook"
|
|
|
236
264
|
.claude/skills/
|
|
237
265
|
└── package@version/
|
|
238
266
|
├── assets/
|
|
239
|
-
│
|
|
267
|
+
│ ├── references/
|
|
240
268
|
│ ├── context7/ # Auto-sliced Context7 docs
|
|
241
269
|
│ └── user/ # Custom knowledge files
|
|
242
|
-
|
|
270
|
+
│ └── search/ # Local search indexes and state
|
|
243
271
|
└── SKILL.md # Skill documentation
|
|
244
272
|
```
|
|
245
273
|
|
|
246
274
|
## Development
|
|
247
275
|
|
|
248
|
-
### Prerequisites
|
|
249
|
-
|
|
250
|
-
Make sure you have the MCP servers installed and configured before development:
|
|
251
|
-
|
|
252
|
-
```bash
|
|
253
|
-
# Verify MCP servers are available
|
|
254
|
-
npm list -g @upstash/context7-mcp @chromedevtools/chrome-devtools-mcp
|
|
255
|
-
```
|
|
256
|
-
|
|
257
276
|
### Development Setup
|
|
258
277
|
|
|
259
278
|
```bash
|
|
@@ -272,43 +291,94 @@ npm test
|
|
|
272
291
|
# Run tests with coverage
|
|
273
292
|
npm run test:coverage
|
|
274
293
|
|
|
275
|
-
# Lint code
|
|
276
|
-
npm run lint
|
|
277
|
-
|
|
278
294
|
# Type check
|
|
279
|
-
|
|
295
|
+
pnpm ts
|
|
280
296
|
```
|
|
281
297
|
|
|
282
|
-
### Testing
|
|
298
|
+
### Testing Context7 Integration
|
|
283
299
|
|
|
284
|
-
To test
|
|
300
|
+
To test the built-in Context7 workflow during development:
|
|
285
301
|
|
|
286
302
|
```bash
|
|
287
|
-
|
|
288
|
-
skill-creator get-info @upstash/context7
|
|
289
|
-
|
|
290
|
-
# Test Chrome DevTools integration
|
|
303
|
+
skill-creator resolve-context7 vitest --package-version 4.1.7
|
|
291
304
|
skill-creator download-context7 --help
|
|
292
305
|
```
|
|
293
306
|
|
|
294
|
-
|
|
307
|
+
### Verifying Installed Binaries During Development
|
|
295
308
|
|
|
296
|
-
|
|
309
|
+
When validating the real installed CLI during local development, prefer isolated install roots instead of relying on your machine's global package manager state:
|
|
310
|
+
|
|
311
|
+
```bash
|
|
312
|
+
# Source-mode workflow verification
|
|
313
|
+
pnpm verify:workflow
|
|
297
314
|
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
"chromaPath": "./chroma"
|
|
304
|
-
}
|
|
305
|
-
}
|
|
315
|
+
# Published-style installed binary verification in an isolated prefix
|
|
316
|
+
pnpm verify:installed
|
|
317
|
+
|
|
318
|
+
# Source-linked binary verification in an isolated prefix
|
|
319
|
+
pnpm verify:linked
|
|
306
320
|
```
|
|
307
321
|
|
|
322
|
+
These workflow gates now also prove the vector-runtime contract:
|
|
323
|
+
|
|
324
|
+
- if the local runtime supports `node:sqlite` and `sqlite-vec`, the verification path builds and queries a real `--mode=vector` index
|
|
325
|
+
- otherwise, the verification path proves that the CLI returns the expected runtime-support error
|
|
326
|
+
|
|
327
|
+
If you still want a linked local binary for ad hoc manual testing, use an isolated prefix:
|
|
328
|
+
|
|
329
|
+
```bash
|
|
330
|
+
TMP_PREFIX="$(mktemp -d /tmp/skill-creator-link-XXXXXX)"
|
|
331
|
+
npm_config_prefix="$TMP_PREFIX" npm link
|
|
332
|
+
PATH="$TMP_PREFIX/bin:$PATH" skill-creator --help
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
This avoids toolchain managers such as Volta interfering with the linked executable.
|
|
336
|
+
|
|
337
|
+
If you intentionally skip indexing during documentation download, rebuild it explicitly with:
|
|
338
|
+
|
|
339
|
+
```bash
|
|
340
|
+
skill-creator build-index --pwd ~/.claude/skills/zustand@5
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
`build-index` supports the same persistent index modes as the runtime:
|
|
344
|
+
|
|
345
|
+
- `--mode=auto`: build the default lightweight persisted index path
|
|
346
|
+
- `--mode=fulltext`: build the explicit MiniSearch index
|
|
347
|
+
- `--mode=vector`: build the explicit SQLite vector index when the runtime supports it
|
|
348
|
+
|
|
349
|
+
For offline or deterministic local vector verification, pass an explicit embedder:
|
|
350
|
+
|
|
351
|
+
```bash
|
|
352
|
+
skill-creator build-index --pwd ~/.claude/skills/zustand@5 --mode vector --vector-embedder deterministic
|
|
353
|
+
skill-creator search-skill --pwd ~/.claude/skills/zustand@5 --mode vector --vector-embedder deterministic "query ownership"
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
`--vector-embedder deterministic` switches vector mode to the built-in local deterministic embedder instead of the default runtime embedder.
|
|
357
|
+
|
|
358
|
+
`--mode=fuzzy` is intentionally rejected because fuzzy search does not use a standalone persisted index.
|
|
359
|
+
|
|
360
|
+
### Release Readiness
|
|
361
|
+
|
|
362
|
+
`pnpm pre-release-check` is a release gate, not a diagnostic summary. It now fails when:
|
|
363
|
+
|
|
364
|
+
- the current `package.json` version is already published to npm
|
|
365
|
+
- the published npm version cannot be verified
|
|
366
|
+
|
|
367
|
+
That means a green result is evidence that the repository is both technically verified and version-ready for release.
|
|
368
|
+
|
|
369
|
+
## Search Modes
|
|
370
|
+
|
|
371
|
+
- `auto`: default path, tries full-text first and falls back to fuzzy when quality is weak
|
|
372
|
+
- `fulltext`: explicit MiniSearch-backed local index
|
|
373
|
+
- `fuzzy`: explicit `uFuzzy` fallback for path/term-style matching
|
|
374
|
+
- `vector`: explicit SQLite vector search path when the local runtime supports it
|
|
375
|
+
|
|
376
|
+
`chroma` remains accepted only as an undocumented legacy alias for `vector`.
|
|
377
|
+
|
|
308
378
|
## Architecture
|
|
309
379
|
|
|
310
380
|
- **TypeScript + ESM**: Modern JavaScript with full type safety
|
|
311
|
-
- **
|
|
381
|
+
- **Search Runtime**: MiniSearch-backed local full-text indexing by default, with explicit vector mode available when runtime support exists
|
|
312
382
|
- **Context7 API**: Automated documentation downloading and slicing
|
|
313
383
|
- **CLI-first Design**: Professional command-line interface
|
|
314
384
|
- **Modular Architecture**: Clean separation of concerns
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{n as e,r as t,t as n}from"./shared-DsVh4gOV.mjs";import{join as r}from"node:path";async function i(i){let a=t(i,[{name:`mode`,type:`string`,default:`auto`},{name:`vector-embedder`,type:`string`},{name:`json`,type:`boolean`}]),o=!!a.json,s=e(a.mode);if(s===`fuzzy`&&(console.error(`❌ Fuzzy mode does not support standalone prebuilt indexes. Use auto, fulltext, or vector.`),process.exit(1)),s===`vector`){let{SqliteVectorSearchAdapter:e}=await import(`./sqliteVectorSearchAdapter-DNkyKuZs.mjs`);await e.isRuntimeSupported()||(console.error(`❌ Vector mode is unavailable in this runtime. It requires node:sqlite support and sqlite-vec.`),process.exit(1))}let c=await n({searchMode:s,useFormatting:!1,vectorEmbedder:a[`vector-embedder`]}),l=r(process.cwd(),`assets`,`references`);await c.buildIndex(l);let u=await c.getStats(),d=await c.getBackendInfo();return o||(console.log(`Building search index...`),console.log(`Mode: ${s}`),a[`vector-embedder`]&&console.log(`Vector embedder: ${a[`vector-embedder`]}`),console.log(`✅ Index built: ${u.totalDocuments||0} documents`),d&&console.log(`🎯 Active backend: ${d.backendId} (${d.mode})`)),{mode:s,vectorEmbedder:a[`vector-embedder`],totalDocuments:u.totalDocuments||0,backendInfo:d}}export{i as t};
|
|
2
|
+
//# sourceMappingURL=buildIndex-B_9ABRtx.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildIndex-B_9ABRtx.mjs","names":[],"sources":["../src/commands/buildIndex.ts"],"sourcesContent":["/**\n * Build search index command\n */\n\nimport { join } from 'node:path'\nimport { createSearchEngine, normalizeSearchMode, parseArgs } from './shared.js'\nimport type { BuildIndexCommandResult } from '../types/index.js'\n\nexport async function buildIndex(args: string[]): Promise<BuildIndexCommandResult> {\n const options = parseArgs(args, [\n { name: 'mode', type: 'string', default: 'auto' },\n { name: 'vector-embedder', type: 'string' },\n { name: 'json', type: 'boolean' },\n ])\n const jsonMode = Boolean(options.json)\n const normalizedMode = normalizeSearchMode(options.mode)\n\n if (normalizedMode === 'fuzzy') {\n console.error(\n '❌ Fuzzy mode does not support standalone prebuilt indexes. Use auto, fulltext, or vector.'\n )\n process.exit(1)\n }\n\n if (normalizedMode === 'vector') {\n const { SqliteVectorSearchAdapter } = await import('../core/sqliteVectorSearchAdapter.js')\n const runtimeSupported = await SqliteVectorSearchAdapter.isRuntimeSupported()\n if (!runtimeSupported) {\n console.error(\n '❌ Vector mode is unavailable in this runtime. It requires node:sqlite support and sqlite-vec.'\n )\n process.exit(1)\n }\n }\n\n const searchEngine = await createSearchEngine({\n searchMode: normalizedMode,\n useFormatting: false,\n vectorEmbedder: options['vector-embedder'],\n })\n\n // Build index\n const referencesDir = join(process.cwd(), 'assets', 'references')\n await searchEngine.buildIndex(referencesDir)\n\n // Show stats\n const stats = await searchEngine.getStats()\n const backendInfo = await searchEngine.getBackendInfo()\n if (!jsonMode) {\n console.log('Building search index...')\n console.log(`Mode: ${normalizedMode}`)\n if (options['vector-embedder']) {\n console.log(`Vector embedder: ${options['vector-embedder']}`)\n }\n console.log(`✅ Index built: ${stats.totalDocuments || 0} documents`)\n if (backendInfo) {\n console.log(`🎯 Active backend: ${backendInfo.backendId} (${backendInfo.mode})`)\n }\n }\n return {\n mode: normalizedMode,\n vectorEmbedder: options['vector-embedder'],\n totalDocuments: stats.totalDocuments || 0,\n backendInfo,\n }\n}\n"],"mappings":"yFAQA,eAAsB,EAAW,EAAkD,CACjF,IAAM,EAAU,EAAU,EAAM,CAC9B,CAAE,KAAM,OAAQ,KAAM,SAAU,QAAS,OAAQ,CACjD,CAAE,KAAM,kBAAmB,KAAM,SAAU,CAC3C,CAAE,KAAM,OAAQ,KAAM,UAAW,CAClC,CAAC,CACI,EAAW,EAAQ,EAAQ,KAC3B,EAAiB,EAAoB,EAAQ,KAAK,CASxD,GAPI,IAAmB,UACrB,QAAQ,MACN,4FACD,CACD,QAAQ,KAAK,EAAE,EAGb,IAAmB,SAAU,CAC/B,GAAM,CAAE,6BAA8B,MAAM,OAAO,4CAC1B,MAAM,EAA0B,oBAAoB,GAE3E,QAAQ,MACN,gGACD,CACD,QAAQ,KAAK,EAAE,EAInB,IAAM,EAAe,MAAM,EAAmB,CAC5C,WAAY,EACZ,cAAe,GACf,eAAgB,EAAQ,mBACzB,CAAC,CAGI,EAAgB,EAAK,QAAQ,KAAK,CAAE,SAAU,aAAa,CACjE,MAAM,EAAa,WAAW,EAAc,CAG5C,IAAM,EAAQ,MAAM,EAAa,UAAU,CACrC,EAAc,MAAM,EAAa,gBAAgB,CAYvD,OAXK,IACH,QAAQ,IAAI,2BAA2B,CACvC,QAAQ,IAAI,SAAS,IAAiB,CAClC,EAAQ,oBACV,QAAQ,IAAI,oBAAoB,EAAQ,qBAAqB,CAE/D,QAAQ,IAAI,kBAAkB,EAAM,gBAAkB,EAAE,YAAY,CAChE,GACF,QAAQ,IAAI,sBAAsB,EAAY,UAAU,IAAI,EAAY,KAAK,GAAG,EAG7E,CACL,KAAM,EACN,eAAgB,EAAQ,mBACxB,eAAgB,EAAM,gBAAkB,EACxC,cACD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./shared-DsVh4gOV.mjs";import{t as e}from"./buildIndex-B_9ABRtx.mjs";export{e as buildIndex};
|
package/dist/cli.d.mts
CHANGED
|
File without changes
|
package/dist/cli.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.mts","names":["LiteralUnion","LiteralType","BaseType","Record","CommanderError","Error","InvalidArgumentError","InvalidOptionArgumentError","ErrorOptions","Argument","T","Option","OptionValues","Help","Command","Map","HelpConfiguration","Partial","ParseOptions","HelpContext","AddHelpTextContext","OutputConfiguration","AddHelpTextPosition","HookEvent","OptionValueSource","CommandOptions","ReturnType","ExecutableCommandOptions","Promise","RegExp","ParseOptionsResult","createCommand","createOption","createArgument","program"],"sources":["../node_modules/.pnpm/commander@14.0.1/node_modules/commander/typings/index.d.ts","../src/cli.ts"],"sourcesContent":["// Type definitions for commander\n// Original definitions by: Alan Agius <https://github.com/alan-agius4>, Marcelo Dezem <https://github.com/mdezem>, vvakame <https://github.com/vvakame>, Jules Randolph <https://github.com/sveinburne>\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\n// This is a trick to encourage editor to suggest the known literals while still\n// allowing any BaseType value.\n// References:\n// - https://github.com/microsoft/TypeScript/issues/29729\n// - https://github.com/sindresorhus/type-fest/blob/main/source/literal-union.d.ts\n// - https://github.com/sindresorhus/type-fest/blob/main/source/primitive.d.ts\ntype LiteralUnion<LiteralType, BaseType extends string | number> =\n | LiteralType\n | (BaseType & Record<never, never>);\n\nexport class CommanderError extends Error {\n code: string;\n exitCode: number;\n message: string;\n nestedError?: string;\n\n /**\n * Constructs the CommanderError class\n * @param exitCode - suggested exit code which could be used with process.exit\n * @param code - an id string representing the error\n * @param message - human-readable description of the error\n */\n constructor(exitCode: number, code: string, message: string);\n}\n\nexport class InvalidArgumentError extends CommanderError {\n /**\n * Constructs the InvalidArgumentError class\n * @param message - explanation of why argument is invalid\n */\n constructor(message: string);\n}\nexport { InvalidArgumentError as InvalidOptionArgumentError }; // deprecated old name\n\nexport interface ErrorOptions {\n // optional parameter for error()\n /** an id string representing the error */\n code?: string;\n /** suggested exit code which could be used with process.exit */\n exitCode?: number;\n}\n\nexport class Argument {\n description: string;\n required: boolean;\n variadic: boolean;\n defaultValue?: any;\n defaultValueDescription?: string;\n parseArg?: <T>(value: string, previous: T) => T;\n argChoices?: string[];\n\n /**\n * Initialize a new command argument with the given name and description.\n * The default is that the argument is required, and you can explicitly\n * indicate this with <> around the name. Put [] around the name for an optional argument.\n */\n constructor(arg: string, description?: string);\n\n /**\n * Return argument name.\n */\n name(): string;\n\n /**\n * Set the default value, and optionally supply the description to be displayed in the help.\n */\n default(value: unknown, description?: string): this;\n\n /**\n * Set the custom handler for processing CLI command arguments into argument values.\n */\n argParser<T>(fn: (value: string, previous: T) => T): this;\n\n /**\n * Only allow argument value to be one of choices.\n */\n choices(values: readonly string[]): this;\n\n /**\n * Make argument required.\n */\n argRequired(): this;\n\n /**\n * Make argument optional.\n */\n argOptional(): this;\n}\n\nexport class Option {\n flags: string;\n description: string;\n\n required: boolean; // A value must be supplied when the option is specified.\n optional: boolean; // A value is optional when the option is specified.\n variadic: boolean;\n mandatory: boolean; // The option must have a value after parsing, which usually means it must be specified on command line.\n short?: string;\n long?: string;\n negate: boolean;\n defaultValue?: any;\n defaultValueDescription?: string;\n presetArg?: unknown;\n envVar?: string;\n parseArg?: <T>(value: string, previous: T) => T;\n hidden: boolean;\n argChoices?: string[];\n helpGroupHeading?: string;\n\n constructor(flags: string, description?: string);\n\n /**\n * Set the default value, and optionally supply the description to be displayed in the help.\n */\n default(value: unknown, description?: string): this;\n\n /**\n * Preset to use when option used without option-argument, especially optional but also boolean and negated.\n * The custom processing (parseArg) is called.\n *\n * @example\n * ```ts\n * new Option('--color').default('GREYSCALE').preset('RGB');\n * new Option('--donate [amount]').preset('20').argParser(parseFloat);\n * ```\n */\n preset(arg: unknown): this;\n\n /**\n * Add option name(s) that conflict with this option.\n * An error will be displayed if conflicting options are found during parsing.\n *\n * @example\n * ```ts\n * new Option('--rgb').conflicts('cmyk');\n * new Option('--js').conflicts(['ts', 'jsx']);\n * ```\n */\n conflicts(names: string | string[]): this;\n\n /**\n * Specify implied option values for when this option is set and the implied options are not.\n *\n * The custom processing (parseArg) is not called on the implied values.\n *\n * @example\n * program\n * .addOption(new Option('--log', 'write logging information to file'))\n * .addOption(new Option('--trace', 'log extra details').implies({ log: 'trace.txt' }));\n */\n implies(optionValues: OptionValues): this;\n\n /**\n * Set environment variable to check for option value.\n *\n * An environment variables is only used if when processed the current option value is\n * undefined, or the source of the current value is 'default' or 'config' or 'env'.\n */\n env(name: string): this;\n\n /**\n * Set the custom handler for processing CLI option arguments into option values.\n */\n argParser<T>(fn: (value: string, previous: T) => T): this;\n\n /**\n * Whether the option is mandatory and must have a value after parsing.\n */\n makeOptionMandatory(mandatory?: boolean): this;\n\n /**\n * Hide option in help.\n */\n hideHelp(hide?: boolean): this;\n\n /**\n * Only allow option value to be one of choices.\n */\n choices(values: readonly string[]): this;\n\n /**\n * Return option name.\n */\n name(): string;\n\n /**\n * Return option name, in a camelcase format that can be used\n * as an object attribute key.\n */\n attributeName(): string;\n\n /**\n * Set the help group heading.\n */\n helpGroup(heading: string): this;\n\n /**\n * Return whether a boolean option.\n *\n * Options are one of boolean, negated, required argument, or optional argument.\n */\n isBoolean(): boolean;\n}\n\nexport class Help {\n /** output helpWidth, long lines are wrapped to fit */\n helpWidth?: number;\n minWidthToWrap: number;\n sortSubcommands: boolean;\n sortOptions: boolean;\n showGlobalOptions: boolean;\n\n constructor();\n\n /*\n * prepareContext is called by Commander after applying overrides from `Command.configureHelp()`\n * and just before calling `formatHelp()`.\n *\n * Commander just uses the helpWidth and the others are provided for subclasses.\n */\n prepareContext(contextOptions: {\n error?: boolean;\n helpWidth?: number;\n outputHasColors?: boolean;\n }): void;\n\n /** Get the command term to show in the list of subcommands. */\n subcommandTerm(cmd: Command): string;\n /** Get the command summary to show in the list of subcommands. */\n subcommandDescription(cmd: Command): string;\n /** Get the option term to show in the list of options. */\n optionTerm(option: Option): string;\n /** Get the option description to show in the list of options. */\n optionDescription(option: Option): string;\n /** Get the argument term to show in the list of arguments. */\n argumentTerm(argument: Argument): string;\n /** Get the argument description to show in the list of arguments. */\n argumentDescription(argument: Argument): string;\n\n /** Get the command usage to be displayed at the top of the built-in help. */\n commandUsage(cmd: Command): string;\n /** Get the description for the command. */\n commandDescription(cmd: Command): string;\n\n /** Get an array of the visible subcommands. Includes a placeholder for the implicit help command, if there is one. */\n visibleCommands(cmd: Command): Command[];\n /** Get an array of the visible options. Includes a placeholder for the implicit help option, if there is one. */\n visibleOptions(cmd: Command): Option[];\n /** Get an array of the visible global options. (Not including help.) */\n visibleGlobalOptions(cmd: Command): Option[];\n /** Get an array of the arguments which have descriptions. */\n visibleArguments(cmd: Command): Argument[];\n\n /** Get the longest command term length. */\n longestSubcommandTermLength(cmd: Command, helper: Help): number;\n /** Get the longest option term length. */\n longestOptionTermLength(cmd: Command, helper: Help): number;\n /** Get the longest global option term length. */\n longestGlobalOptionTermLength(cmd: Command, helper: Help): number;\n /** Get the longest argument term length. */\n longestArgumentTermLength(cmd: Command, helper: Help): number;\n\n /** Return display width of string, ignoring ANSI escape sequences. Used in padding and wrapping calculations. */\n displayWidth(str: string): number;\n\n /** Style the titles. Called with 'Usage:', 'Options:', etc. */\n styleTitle(title: string): string;\n\n /** Usage: <str> */\n styleUsage(str: string): string;\n /** Style for command name in usage string. */\n styleCommandText(str: string): string;\n\n styleCommandDescription(str: string): string;\n styleOptionDescription(str: string): string;\n styleSubcommandDescription(str: string): string;\n styleArgumentDescription(str: string): string;\n /** Base style used by descriptions. */\n styleDescriptionText(str: string): string;\n\n styleOptionTerm(str: string): string;\n styleSubcommandTerm(str: string): string;\n styleArgumentTerm(str: string): string;\n\n /** Base style used in terms and usage for options. */\n styleOptionText(str: string): string;\n /** Base style used in terms and usage for subcommands. */\n styleSubcommandText(str: string): string;\n /** Base style used in terms and usage for arguments. */\n styleArgumentText(str: string): string;\n\n /** Calculate the pad width from the maximum term length. */\n padWidth(cmd: Command, helper: Help): number;\n\n /**\n * Wrap a string at whitespace, preserving existing line breaks.\n * Wrapping is skipped if the width is less than `minWidthToWrap`.\n */\n boxWrap(str: string, width: number): string;\n\n /** Detect manually wrapped and indented strings by checking for line break followed by whitespace. */\n preformatted(str: string): boolean;\n\n /**\n * Format the \"item\", which consists of a term and description. Pad the term and wrap the description, indenting the following lines.\n *\n * So \"TTT\", 5, \"DDD DDDD DD DDD\" might be formatted for this.helpWidth=17 like so:\n * TTT DDD DDDD\n * DD DDD\n */\n formatItem(\n term: string,\n termWidth: number,\n description: string,\n helper: Help,\n ): string;\n\n /**\n * Format a list of items, given a heading and an array of formatted items.\n */\n formatItemList(heading: string, items: string[], helper: Help): string[];\n\n /**\n * Group items by their help group heading.\n */\n groupItems<T extends Command | Option>(\n unsortedItems: T[],\n visibleItems: T[],\n getGroup: (item: T) => string,\n ): Map<string, T[]>;\n\n /** Generate the built-in help text. */\n formatHelp(cmd: Command, helper: Help): string;\n}\nexport type HelpConfiguration = Partial<Help>;\n\nexport interface ParseOptions {\n from: 'node' | 'electron' | 'user';\n}\nexport interface HelpContext {\n // optional parameter for .help() and .outputHelp()\n error: boolean;\n}\nexport interface AddHelpTextContext {\n // passed to text function used with .addHelpText()\n error: boolean;\n command: Command;\n}\nexport interface OutputConfiguration {\n writeOut?(str: string): void;\n writeErr?(str: string): void;\n outputError?(str: string, write: (str: string) => void): void;\n\n getOutHelpWidth?(): number;\n getErrHelpWidth?(): number;\n\n getOutHasColors?(): boolean;\n getErrHasColors?(): boolean;\n stripColor?(str: string): string;\n}\n\nexport type AddHelpTextPosition = 'beforeAll' | 'before' | 'after' | 'afterAll';\nexport type HookEvent = 'preSubcommand' | 'preAction' | 'postAction';\n// The source is a string so author can define their own too.\nexport type OptionValueSource =\n | LiteralUnion<'default' | 'config' | 'env' | 'cli' | 'implied', string>\n | undefined;\n\nexport type OptionValues = Record<string, any>;\n\nexport class Command {\n args: string[];\n processedArgs: any[];\n readonly commands: readonly Command[];\n readonly options: readonly Option[];\n readonly registeredArguments: readonly Argument[];\n parent: Command | null;\n\n constructor(name?: string);\n\n /**\n * Set the program version to `str`.\n *\n * This method auto-registers the \"-V, --version\" flag\n * which will print the version number when passed.\n *\n * You can optionally supply the flags and description to override the defaults.\n */\n version(str: string, flags?: string, description?: string): this;\n /**\n * Get the program version.\n */\n version(): string | undefined;\n\n /**\n * Define a command, implemented using an action handler.\n *\n * @remarks\n * The command description is supplied using `.description`, not as a parameter to `.command`.\n *\n * @example\n * ```ts\n * program\n * .command('clone <source> [destination]')\n * .description('clone a repository into a newly created directory')\n * .action((source, destination) => {\n * console.log('clone command called');\n * });\n * ```\n *\n * @param nameAndArgs - command name and arguments, args are `<required>` or `[optional]` and last may also be `variadic...`\n * @param opts - configuration options\n * @returns new command\n */\n command(\n nameAndArgs: string,\n opts?: CommandOptions,\n ): ReturnType<this['createCommand']>;\n /**\n * Define a command, implemented in a separate executable file.\n *\n * @remarks\n * The command description is supplied as the second parameter to `.command`.\n *\n * @example\n * ```ts\n * program\n * .command('start <service>', 'start named service')\n * .command('stop [service]', 'stop named service, or all if no name supplied');\n * ```\n *\n * @param nameAndArgs - command name and arguments, args are `<required>` or `[optional]` and last may also be `variadic...`\n * @param description - description of executable command\n * @param opts - configuration options\n * @returns `this` command for chaining\n */\n command(\n nameAndArgs: string,\n description: string,\n opts?: ExecutableCommandOptions,\n ): this;\n\n /**\n * Factory routine to create a new unattached command.\n *\n * See .command() for creating an attached subcommand, which uses this routine to\n * create the command. You can override createCommand to customise subcommands.\n */\n createCommand(name?: string): Command;\n\n /**\n * Add a prepared subcommand.\n *\n * See .command() for creating an attached subcommand which inherits settings from its parent.\n *\n * @returns `this` command for chaining\n */\n addCommand(cmd: Command, opts?: CommandOptions): this;\n\n /**\n * Factory routine to create a new unattached argument.\n *\n * See .argument() for creating an attached argument, which uses this routine to\n * create the argument. You can override createArgument to return a custom argument.\n */\n createArgument(name: string, description?: string): Argument;\n\n /**\n * Define argument syntax for command.\n *\n * The default is that the argument is required, and you can explicitly\n * indicate this with <> around the name. Put [] around the name for an optional argument.\n *\n * @example\n * ```\n * program.argument('<input-file>');\n * program.argument('[output-file]');\n * ```\n *\n * @returns `this` command for chaining\n */\n argument<T>(\n flags: string,\n description: string,\n parseArg: (value: string, previous: T) => T,\n defaultValue?: T,\n ): this;\n argument(name: string, description?: string, defaultValue?: unknown): this;\n\n /**\n * Define argument syntax for command, adding a prepared argument.\n *\n * @returns `this` command for chaining\n */\n addArgument(arg: Argument): this;\n\n /**\n * Define argument syntax for command, adding multiple at once (without descriptions).\n *\n * See also .argument().\n *\n * @example\n * ```\n * program.arguments('<cmd> [env]');\n * ```\n *\n * @returns `this` command for chaining\n */\n arguments(names: string): this;\n\n /**\n * Customise or override default help command. By default a help command is automatically added if your command has subcommands.\n *\n * @example\n * ```ts\n * program.helpCommand('help [cmd]');\n * program.helpCommand('help [cmd]', 'show help');\n * program.helpCommand(false); // suppress default help command\n * program.helpCommand(true); // add help command even if no subcommands\n * ```\n */\n helpCommand(nameAndArgs: string, description?: string): this;\n helpCommand(enable: boolean): this;\n\n /**\n * Add prepared custom help command.\n */\n addHelpCommand(cmd: Command): this;\n /** @deprecated since v12, instead use helpCommand */\n addHelpCommand(nameAndArgs: string, description?: string): this;\n /** @deprecated since v12, instead use helpCommand */\n addHelpCommand(enable?: boolean): this;\n\n /**\n * Add hook for life cycle event.\n */\n hook(\n event: HookEvent,\n listener: (\n thisCommand: Command,\n actionCommand: Command,\n ) => void | Promise<void>,\n ): this;\n\n /**\n * Register callback to use as replacement for calling process.exit.\n */\n exitOverride(callback?: (err: CommanderError) => never | void): this;\n\n /**\n * Display error message and exit (or call exitOverride).\n */\n error(message: string, errorOptions?: ErrorOptions): never;\n\n /**\n * You can customise the help with a subclass of Help by overriding createHelp,\n * or by overriding Help properties using configureHelp().\n */\n createHelp(): Help;\n\n /**\n * You can customise the help by overriding Help properties using configureHelp(),\n * or with a subclass of Help by overriding createHelp().\n */\n configureHelp(configuration: HelpConfiguration): this;\n /** Get configuration */\n configureHelp(): HelpConfiguration;\n\n /**\n * The default output goes to stdout and stderr. You can customise this for special\n * applications. You can also customise the display of errors by overriding outputError.\n *\n * The configuration properties are all functions:\n * ```\n * // functions to change where being written, stdout and stderr\n * writeOut(str)\n * writeErr(str)\n * // matching functions to specify width for wrapping help\n * getOutHelpWidth()\n * getErrHelpWidth()\n * // functions based on what is being written out\n * outputError(str, write) // used for displaying errors, and not used for displaying help\n * ```\n */\n configureOutput(configuration: OutputConfiguration): this;\n /** Get configuration */\n configureOutput(): OutputConfiguration;\n\n /**\n * Copy settings that are useful to have in common across root command and subcommands.\n *\n * (Used internally when adding a command using `.command()` so subcommands inherit parent settings.)\n */\n copyInheritedSettings(sourceCommand: Command): this;\n\n /**\n * Display the help or a custom message after an error occurs.\n */\n showHelpAfterError(displayHelp?: boolean | string): this;\n\n /**\n * Display suggestion of similar commands for unknown commands, or options for unknown options.\n */\n showSuggestionAfterError(displaySuggestion?: boolean): this;\n\n /**\n * Register callback `fn` for the command.\n *\n * @example\n * ```\n * program\n * .command('serve')\n * .description('start service')\n * .action(function() {\n * // do work here\n * });\n * ```\n *\n * @returns `this` command for chaining\n */\n action(fn: (this: this, ...args: any[]) => void | Promise<void>): this;\n\n /**\n * Define option with `flags`, `description`, and optional argument parsing function or `defaultValue` or both.\n *\n * The `flags` string contains the short and/or long flags, separated by comma, a pipe or space. A required\n * option-argument is indicated by `<>` and an optional option-argument by `[]`.\n *\n * See the README for more details, and see also addOption() and requiredOption().\n *\n * @example\n *\n * ```js\n * program\n * .option('-p, --pepper', 'add pepper')\n * .option('--pt, --pizza-type <TYPE>', 'type of pizza') // required option-argument\n * .option('-c, --cheese [CHEESE]', 'add extra cheese', 'mozzarella') // optional option-argument with default\n * .option('-t, --tip <VALUE>', 'add tip to purchase cost', parseFloat) // custom parse function\n * ```\n *\n * @returns `this` command for chaining\n */\n option(\n flags: string,\n description?: string,\n defaultValue?: string | boolean | string[],\n ): this;\n option<T>(\n flags: string,\n description: string,\n parseArg: (value: string, previous: T) => T,\n defaultValue?: T,\n ): this;\n /** @deprecated since v7, instead use choices or a custom function */\n option(\n flags: string,\n description: string,\n regexp: RegExp,\n defaultValue?: string | boolean | string[],\n ): this;\n\n /**\n * Define a required option, which must have a value after parsing. This usually means\n * the option must be specified on the command line. (Otherwise the same as .option().)\n *\n * The `flags` string contains the short and/or long flags, separated by comma, a pipe or space.\n */\n requiredOption(\n flags: string,\n description?: string,\n defaultValue?: string | boolean | string[],\n ): this;\n requiredOption<T>(\n flags: string,\n description: string,\n parseArg: (value: string, previous: T) => T,\n defaultValue?: T,\n ): this;\n /** @deprecated since v7, instead use choices or a custom function */\n requiredOption(\n flags: string,\n description: string,\n regexp: RegExp,\n defaultValue?: string | boolean | string[],\n ): this;\n\n /**\n * Factory routine to create a new unattached option.\n *\n * See .option() for creating an attached option, which uses this routine to\n * create the option. You can override createOption to return a custom option.\n */\n\n createOption(flags: string, description?: string): Option;\n\n /**\n * Add a prepared Option.\n *\n * See .option() and .requiredOption() for creating and attaching an option in a single call.\n */\n addOption(option: Option): this;\n\n /**\n * Whether to store option values as properties on command object,\n * or store separately (specify false). In both cases the option values can be accessed using .opts().\n *\n * @returns `this` command for chaining\n */\n storeOptionsAsProperties<T extends OptionValues>(): this & T;\n storeOptionsAsProperties<T extends OptionValues>(\n storeAsProperties: true,\n ): this & T;\n storeOptionsAsProperties(storeAsProperties?: boolean): this;\n\n /**\n * Retrieve option value.\n */\n getOptionValue(key: string): any;\n\n /**\n * Store option value.\n */\n setOptionValue(key: string, value: unknown): this;\n\n /**\n * Store option value and where the value came from.\n */\n setOptionValueWithSource(\n key: string,\n value: unknown,\n source: OptionValueSource,\n ): this;\n\n /**\n * Get source of option value.\n */\n getOptionValueSource(key: string): OptionValueSource | undefined;\n\n /**\n * Get source of option value. See also .optsWithGlobals().\n */\n getOptionValueSourceWithGlobals(key: string): OptionValueSource | undefined;\n\n /**\n * Alter parsing of short flags with optional values.\n *\n * @example\n * ```\n * // for `.option('-f,--flag [value]'):\n * .combineFlagAndOptionalValue(true) // `-f80` is treated like `--flag=80`, this is the default behaviour\n * .combineFlagAndOptionalValue(false) // `-fb` is treated like `-f -b`\n * ```\n *\n * @returns `this` command for chaining\n */\n combineFlagAndOptionalValue(combine?: boolean): this;\n\n /**\n * Allow unknown options on the command line.\n *\n * @returns `this` command for chaining\n */\n allowUnknownOption(allowUnknown?: boolean): this;\n\n /**\n * Allow excess command-arguments on the command line. Pass false to make excess arguments an error.\n *\n * @returns `this` command for chaining\n */\n allowExcessArguments(allowExcess?: boolean): this;\n\n /**\n * Enable positional options. Positional means global options are specified before subcommands which lets\n * subcommands reuse the same option names, and also enables subcommands to turn on passThroughOptions.\n *\n * The default behaviour is non-positional and global options may appear anywhere on the command line.\n *\n * @returns `this` command for chaining\n */\n enablePositionalOptions(positional?: boolean): this;\n\n /**\n * Pass through options that come after command-arguments rather than treat them as command-options,\n * so actual command-options come before command-arguments. Turning this on for a subcommand requires\n * positional options to have been enabled on the program (parent commands).\n *\n * The default behaviour is non-positional and options may appear before or after command-arguments.\n *\n * @returns `this` command for chaining\n */\n passThroughOptions(passThrough?: boolean): this;\n\n /**\n * Parse `argv`, setting options and invoking commands when defined.\n *\n * Use parseAsync instead of parse if any of your action handlers are async.\n *\n * Call with no parameters to parse `process.argv`. Detects Electron and special node options like `node --eval`. Easy mode!\n *\n * Or call with an array of strings to parse, and optionally where the user arguments start by specifying where the arguments are `from`:\n * - `'node'`: default, `argv[0]` is the application and `argv[1]` is the script being run, with user arguments after that\n * - `'electron'`: `argv[0]` is the application and `argv[1]` varies depending on whether the electron application is packaged\n * - `'user'`: just user arguments\n *\n * @example\n * ```\n * program.parse(); // parse process.argv and auto-detect electron and special node flags\n * program.parse(process.argv); // assume argv[0] is app and argv[1] is script\n * program.parse(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0]\n * ```\n *\n * @returns `this` command for chaining\n */\n parse(argv?: readonly string[], parseOptions?: ParseOptions): this;\n\n /**\n * Parse `argv`, setting options and invoking commands when defined.\n *\n * Call with no parameters to parse `process.argv`. Detects Electron and special node options like `node --eval`. Easy mode!\n *\n * Or call with an array of strings to parse, and optionally where the user arguments start by specifying where the arguments are `from`:\n * - `'node'`: default, `argv[0]` is the application and `argv[1]` is the script being run, with user arguments after that\n * - `'electron'`: `argv[0]` is the application and `argv[1]` varies depending on whether the electron application is packaged\n * - `'user'`: just user arguments\n *\n * @example\n * ```\n * await program.parseAsync(); // parse process.argv and auto-detect electron and special node flags\n * await program.parseAsync(process.argv); // assume argv[0] is app and argv[1] is script\n * await program.parseAsync(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0]\n * ```\n *\n * @returns Promise\n */\n parseAsync(\n argv?: readonly string[],\n parseOptions?: ParseOptions,\n ): Promise<this>;\n\n /**\n * Called the first time parse is called to save state and allow a restore before subsequent calls to parse.\n * Not usually called directly, but available for subclasses to save their custom state.\n *\n * This is called in a lazy way. Only commands used in parsing chain will have state saved.\n */\n saveStateBeforeParse(): void;\n\n /**\n * Restore state before parse for calls after the first.\n * Not usually called directly, but available for subclasses to save their custom state.\n *\n * This is called in a lazy way. Only commands used in parsing chain will have state restored.\n */\n restoreStateBeforeParse(): void;\n\n /**\n * Parse options from `argv` removing known options,\n * and return argv split into operands and unknown arguments.\n *\n * Side effects: modifies command by storing options. Does not reset state if called again.\n *\n * argv => operands, unknown\n * --known kkk op => [op], []\n * op --known kkk => [op], []\n * sub --unknown uuu op => [sub], [--unknown uuu op]\n * sub -- --unknown uuu op => [sub --unknown uuu op], []\n */\n parseOptions(argv: string[]): ParseOptionsResult;\n\n /**\n * Return an object containing local option values as key-value pairs\n */\n opts<T extends OptionValues>(): T;\n\n /**\n * Return an object containing merged local and global option values as key-value pairs.\n */\n optsWithGlobals<T extends OptionValues>(): T;\n\n /**\n * Set the description.\n *\n * @returns `this` command for chaining\n */\n\n description(str: string): this;\n /** @deprecated since v8, instead use .argument to add command argument with description */\n description(str: string, argsDescription: Record<string, string>): this;\n /**\n * Get the description.\n */\n description(): string;\n\n /**\n * Set the summary. Used when listed as subcommand of parent.\n *\n * @returns `this` command for chaining\n */\n\n summary(str: string): this;\n /**\n * Get the summary.\n */\n summary(): string;\n\n /**\n * Set an alias for the command.\n *\n * You may call more than once to add multiple aliases. Only the first alias is shown in the auto-generated help.\n *\n * @returns `this` command for chaining\n */\n alias(alias: string): this;\n /**\n * Get alias for the command.\n */\n alias(): string;\n\n /**\n * Set aliases for the command.\n *\n * Only the first alias is shown in the auto-generated help.\n *\n * @returns `this` command for chaining\n */\n aliases(aliases: readonly string[]): this;\n /**\n * Get aliases for the command.\n */\n aliases(): string[];\n\n /**\n * Set the command usage.\n *\n * @returns `this` command for chaining\n */\n usage(str: string): this;\n /**\n * Get the command usage.\n */\n usage(): string;\n\n /**\n * Set the name of the command.\n *\n * @returns `this` command for chaining\n */\n name(str: string): this;\n /**\n * Get the name of the command.\n */\n name(): string;\n\n /**\n * Set the name of the command from script filename, such as process.argv[1],\n * or require.main.filename, or __filename.\n *\n * (Used internally and public although not documented in README.)\n *\n * @example\n * ```ts\n * program.nameFromFilename(require.main.filename);\n * ```\n *\n * @returns `this` command for chaining\n */\n nameFromFilename(filename: string): this;\n\n /**\n * Set the directory for searching for executable subcommands of this command.\n *\n * @example\n * ```ts\n * program.executableDir(__dirname);\n * // or\n * program.executableDir('subcommands');\n * ```\n *\n * @returns `this` command for chaining\n */\n executableDir(path: string): this;\n /**\n * Get the executable search directory.\n */\n executableDir(): string | null;\n\n /**\n * Set the help group heading for this subcommand in parent command's help.\n *\n * @returns `this` command for chaining\n */\n helpGroup(heading: string): this;\n /**\n * Get the help group heading for this subcommand in parent command's help.\n */\n helpGroup(): string;\n\n /**\n * Set the default help group heading for subcommands added to this command.\n * (This does not override a group set directly on the subcommand using .helpGroup().)\n *\n * @example\n * program.commandsGroup('Development Commands:);\n * program.command('watch')...\n * program.command('lint')...\n * ...\n *\n * @returns `this` command for chaining\n */\n commandsGroup(heading: string): this;\n /**\n * Get the default help group heading for subcommands added to this command.\n */\n commandsGroup(): string;\n\n /**\n * Set the default help group heading for options added to this command.\n * (This does not override a group set directly on the option using .helpGroup().)\n *\n * @example\n * program\n * .optionsGroup('Development Options:')\n * .option('-d, --debug', 'output extra debugging')\n * .option('-p, --profile', 'output profiling information')\n *\n * @returns `this` command for chaining\n */\n optionsGroup(heading: string): this;\n /**\n * Get the default help group heading for options added to this command.\n */\n optionsGroup(): string;\n\n /**\n * Output help information for this command.\n *\n * Outputs built-in help, and custom text added using `.addHelpText()`.\n *\n */\n outputHelp(context?: HelpContext): void;\n /** @deprecated since v7 */\n outputHelp(cb?: (str: string) => string): void;\n\n /**\n * Return command help documentation.\n */\n helpInformation(context?: HelpContext): string;\n\n /**\n * You can pass in flags and a description to override the help\n * flags and help description for your command. Pass in false\n * to disable the built-in help option.\n */\n helpOption(flags?: string | boolean, description?: string): this;\n\n /**\n * Supply your own option to use for the built-in help option.\n * This is an alternative to using helpOption() to customise the flags and description etc.\n */\n addHelpOption(option: Option): this;\n\n /**\n * Output help information and exit.\n *\n * Outputs built-in help, and custom text added using `.addHelpText()`.\n */\n help(context?: HelpContext): never;\n /** @deprecated since v7 */\n help(cb?: (str: string) => string): never;\n\n /**\n * Add additional text to be displayed with the built-in help.\n *\n * Position is 'before' or 'after' to affect just this command,\n * and 'beforeAll' or 'afterAll' to affect this command and all its subcommands.\n */\n addHelpText(position: AddHelpTextPosition, text: string): this;\n addHelpText(\n position: AddHelpTextPosition,\n text: (context: AddHelpTextContext) => string,\n ): this;\n\n /**\n * Add a listener (callback) for when events occur. (Implemented using EventEmitter.)\n */\n on(event: string | symbol, listener: (...args: any[]) => void): this;\n}\n\nexport interface CommandOptions {\n hidden?: boolean;\n isDefault?: boolean;\n /** @deprecated since v7, replaced by hidden */\n noHelp?: boolean;\n}\nexport interface ExecutableCommandOptions extends CommandOptions {\n executableFile?: string;\n}\n\nexport interface ParseOptionsResult {\n operands: string[];\n unknown: string[];\n}\n\nexport function createCommand(name?: string): Command;\nexport function createOption(flags: string, description?: string): Option;\nexport function createArgument(name: string, description?: string): Argument;\n\nexport const program: Command;\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;AAeA;AAwBA;AAQA;;KApCKA,YA0C2CU,CAAAA,WAAAA,EAAAA,iBAAAA,MAAAA,GAAAA,MAAAA,CAAAA,GAzC5CT,WAgEyCS,GAAMA,CA/D9CR,QA+D8CQ,GA/DnCP,MA+DmCO,CAAAA,KAAAA,EAAAA,KAAAA,CAAAA,CAAAA;AAkBtCC,cA/EAP,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;;;gBAMxBK;;;;;;+BAMeG;;mBAEZA;;;;;;;;;;;;;;;;;;iCAkBcK;;qBAEZA;;;;;;;uCAOkBP;;;;;;;;;;;;;;;;;;;;;;;;;;;oDA2Bac;;;;;;;;;;;;;;;;;;;;;;;oFA8BZlB,MAAMA,kBAC3BA;;qDAMPmB;;;;;;;;;4FAkB4BnB,MAAMA,kBAC3BA;;6DAMPmB;;;;;;;;;qDAWyClB;;;;;;;oBAOjCA;;;;;;;;qCAQiBC,wBAAwBF;qCACxBE,+CAEzBF;;;;;;;;;;;;;;;;gEAmBAc;;;;;qCAMyBA;;;;;gDAKWA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iDAwECN;;;;;;;;;;;;;;;;;;;;;sDAuB9BA,eACdU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCA8B2BE;;;;;iBAKflB,iBAAiBF;;;;;4BAKNE,iBAAiBF;;;;;;;;;;4CAUDP;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBAwJrBgB;;;;;;;4BAOKA;;;;;;;;;;;;;wBAaJR;;;;;;;iBAOPQ;;;;;;;;;;wBAUOG;wBAEVA,qCACMF;;;;;;;UASHK,cAAAA;;;;;;UAMAE,wBAAAA,SAAiCF;;;UAIjCK,kBAAAA;;;;;;cClkCX,ODAU3B,ECAH,ODAGA"}
|
|
1
|
+
{"version":3,"file":"cli.d.mts","names":["LiteralUnion","LiteralType","BaseType","Record","CommanderError","Error","InvalidArgumentError","InvalidOptionArgumentError","ErrorOptions","Argument","T","Option","OptionValues","Help","Command","Map","HelpConfiguration","Partial","ParseOptions","HelpContext","AddHelpTextContext","OutputConfiguration","AddHelpTextPosition","HookEvent","OptionValueSource","CommandOptions","ReturnType","ExecutableCommandOptions","Promise","RegExp","ParseOptionsResult","createCommand","createOption","createArgument","program"],"sources":["../node_modules/.pnpm/commander@14.0.1/node_modules/commander/typings/index.d.ts","../src/cli.ts"],"sourcesContent":["// Type definitions for commander\n// Original definitions by: Alan Agius <https://github.com/alan-agius4>, Marcelo Dezem <https://github.com/mdezem>, vvakame <https://github.com/vvakame>, Jules Randolph <https://github.com/sveinburne>\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\n// This is a trick to encourage editor to suggest the known literals while still\n// allowing any BaseType value.\n// References:\n// - https://github.com/microsoft/TypeScript/issues/29729\n// - https://github.com/sindresorhus/type-fest/blob/main/source/literal-union.d.ts\n// - https://github.com/sindresorhus/type-fest/blob/main/source/primitive.d.ts\ntype LiteralUnion<LiteralType, BaseType extends string | number> =\n | LiteralType\n | (BaseType & Record<never, never>);\n\nexport class CommanderError extends Error {\n code: string;\n exitCode: number;\n message: string;\n nestedError?: string;\n\n /**\n * Constructs the CommanderError class\n * @param exitCode - suggested exit code which could be used with process.exit\n * @param code - an id string representing the error\n * @param message - human-readable description of the error\n */\n constructor(exitCode: number, code: string, message: string);\n}\n\nexport class InvalidArgumentError extends CommanderError {\n /**\n * Constructs the InvalidArgumentError class\n * @param message - explanation of why argument is invalid\n */\n constructor(message: string);\n}\nexport { InvalidArgumentError as InvalidOptionArgumentError }; // deprecated old name\n\nexport interface ErrorOptions {\n // optional parameter for error()\n /** an id string representing the error */\n code?: string;\n /** suggested exit code which could be used with process.exit */\n exitCode?: number;\n}\n\nexport class Argument {\n description: string;\n required: boolean;\n variadic: boolean;\n defaultValue?: any;\n defaultValueDescription?: string;\n parseArg?: <T>(value: string, previous: T) => T;\n argChoices?: string[];\n\n /**\n * Initialize a new command argument with the given name and description.\n * The default is that the argument is required, and you can explicitly\n * indicate this with <> around the name. Put [] around the name for an optional argument.\n */\n constructor(arg: string, description?: string);\n\n /**\n * Return argument name.\n */\n name(): string;\n\n /**\n * Set the default value, and optionally supply the description to be displayed in the help.\n */\n default(value: unknown, description?: string): this;\n\n /**\n * Set the custom handler for processing CLI command arguments into argument values.\n */\n argParser<T>(fn: (value: string, previous: T) => T): this;\n\n /**\n * Only allow argument value to be one of choices.\n */\n choices(values: readonly string[]): this;\n\n /**\n * Make argument required.\n */\n argRequired(): this;\n\n /**\n * Make argument optional.\n */\n argOptional(): this;\n}\n\nexport class Option {\n flags: string;\n description: string;\n\n required: boolean; // A value must be supplied when the option is specified.\n optional: boolean; // A value is optional when the option is specified.\n variadic: boolean;\n mandatory: boolean; // The option must have a value after parsing, which usually means it must be specified on command line.\n short?: string;\n long?: string;\n negate: boolean;\n defaultValue?: any;\n defaultValueDescription?: string;\n presetArg?: unknown;\n envVar?: string;\n parseArg?: <T>(value: string, previous: T) => T;\n hidden: boolean;\n argChoices?: string[];\n helpGroupHeading?: string;\n\n constructor(flags: string, description?: string);\n\n /**\n * Set the default value, and optionally supply the description to be displayed in the help.\n */\n default(value: unknown, description?: string): this;\n\n /**\n * Preset to use when option used without option-argument, especially optional but also boolean and negated.\n * The custom processing (parseArg) is called.\n *\n * @example\n * ```ts\n * new Option('--color').default('GREYSCALE').preset('RGB');\n * new Option('--donate [amount]').preset('20').argParser(parseFloat);\n * ```\n */\n preset(arg: unknown): this;\n\n /**\n * Add option name(s) that conflict with this option.\n * An error will be displayed if conflicting options are found during parsing.\n *\n * @example\n * ```ts\n * new Option('--rgb').conflicts('cmyk');\n * new Option('--js').conflicts(['ts', 'jsx']);\n * ```\n */\n conflicts(names: string | string[]): this;\n\n /**\n * Specify implied option values for when this option is set and the implied options are not.\n *\n * The custom processing (parseArg) is not called on the implied values.\n *\n * @example\n * program\n * .addOption(new Option('--log', 'write logging information to file'))\n * .addOption(new Option('--trace', 'log extra details').implies({ log: 'trace.txt' }));\n */\n implies(optionValues: OptionValues): this;\n\n /**\n * Set environment variable to check for option value.\n *\n * An environment variables is only used if when processed the current option value is\n * undefined, or the source of the current value is 'default' or 'config' or 'env'.\n */\n env(name: string): this;\n\n /**\n * Set the custom handler for processing CLI option arguments into option values.\n */\n argParser<T>(fn: (value: string, previous: T) => T): this;\n\n /**\n * Whether the option is mandatory and must have a value after parsing.\n */\n makeOptionMandatory(mandatory?: boolean): this;\n\n /**\n * Hide option in help.\n */\n hideHelp(hide?: boolean): this;\n\n /**\n * Only allow option value to be one of choices.\n */\n choices(values: readonly string[]): this;\n\n /**\n * Return option name.\n */\n name(): string;\n\n /**\n * Return option name, in a camelcase format that can be used\n * as an object attribute key.\n */\n attributeName(): string;\n\n /**\n * Set the help group heading.\n */\n helpGroup(heading: string): this;\n\n /**\n * Return whether a boolean option.\n *\n * Options are one of boolean, negated, required argument, or optional argument.\n */\n isBoolean(): boolean;\n}\n\nexport class Help {\n /** output helpWidth, long lines are wrapped to fit */\n helpWidth?: number;\n minWidthToWrap: number;\n sortSubcommands: boolean;\n sortOptions: boolean;\n showGlobalOptions: boolean;\n\n constructor();\n\n /*\n * prepareContext is called by Commander after applying overrides from `Command.configureHelp()`\n * and just before calling `formatHelp()`.\n *\n * Commander just uses the helpWidth and the others are provided for subclasses.\n */\n prepareContext(contextOptions: {\n error?: boolean;\n helpWidth?: number;\n outputHasColors?: boolean;\n }): void;\n\n /** Get the command term to show in the list of subcommands. */\n subcommandTerm(cmd: Command): string;\n /** Get the command summary to show in the list of subcommands. */\n subcommandDescription(cmd: Command): string;\n /** Get the option term to show in the list of options. */\n optionTerm(option: Option): string;\n /** Get the option description to show in the list of options. */\n optionDescription(option: Option): string;\n /** Get the argument term to show in the list of arguments. */\n argumentTerm(argument: Argument): string;\n /** Get the argument description to show in the list of arguments. */\n argumentDescription(argument: Argument): string;\n\n /** Get the command usage to be displayed at the top of the built-in help. */\n commandUsage(cmd: Command): string;\n /** Get the description for the command. */\n commandDescription(cmd: Command): string;\n\n /** Get an array of the visible subcommands. Includes a placeholder for the implicit help command, if there is one. */\n visibleCommands(cmd: Command): Command[];\n /** Get an array of the visible options. Includes a placeholder for the implicit help option, if there is one. */\n visibleOptions(cmd: Command): Option[];\n /** Get an array of the visible global options. (Not including help.) */\n visibleGlobalOptions(cmd: Command): Option[];\n /** Get an array of the arguments which have descriptions. */\n visibleArguments(cmd: Command): Argument[];\n\n /** Get the longest command term length. */\n longestSubcommandTermLength(cmd: Command, helper: Help): number;\n /** Get the longest option term length. */\n longestOptionTermLength(cmd: Command, helper: Help): number;\n /** Get the longest global option term length. */\n longestGlobalOptionTermLength(cmd: Command, helper: Help): number;\n /** Get the longest argument term length. */\n longestArgumentTermLength(cmd: Command, helper: Help): number;\n\n /** Return display width of string, ignoring ANSI escape sequences. Used in padding and wrapping calculations. */\n displayWidth(str: string): number;\n\n /** Style the titles. Called with 'Usage:', 'Options:', etc. */\n styleTitle(title: string): string;\n\n /** Usage: <str> */\n styleUsage(str: string): string;\n /** Style for command name in usage string. */\n styleCommandText(str: string): string;\n\n styleCommandDescription(str: string): string;\n styleOptionDescription(str: string): string;\n styleSubcommandDescription(str: string): string;\n styleArgumentDescription(str: string): string;\n /** Base style used by descriptions. */\n styleDescriptionText(str: string): string;\n\n styleOptionTerm(str: string): string;\n styleSubcommandTerm(str: string): string;\n styleArgumentTerm(str: string): string;\n\n /** Base style used in terms and usage for options. */\n styleOptionText(str: string): string;\n /** Base style used in terms and usage for subcommands. */\n styleSubcommandText(str: string): string;\n /** Base style used in terms and usage for arguments. */\n styleArgumentText(str: string): string;\n\n /** Calculate the pad width from the maximum term length. */\n padWidth(cmd: Command, helper: Help): number;\n\n /**\n * Wrap a string at whitespace, preserving existing line breaks.\n * Wrapping is skipped if the width is less than `minWidthToWrap`.\n */\n boxWrap(str: string, width: number): string;\n\n /** Detect manually wrapped and indented strings by checking for line break followed by whitespace. */\n preformatted(str: string): boolean;\n\n /**\n * Format the \"item\", which consists of a term and description. Pad the term and wrap the description, indenting the following lines.\n *\n * So \"TTT\", 5, \"DDD DDDD DD DDD\" might be formatted for this.helpWidth=17 like so:\n * TTT DDD DDDD\n * DD DDD\n */\n formatItem(\n term: string,\n termWidth: number,\n description: string,\n helper: Help,\n ): string;\n\n /**\n * Format a list of items, given a heading and an array of formatted items.\n */\n formatItemList(heading: string, items: string[], helper: Help): string[];\n\n /**\n * Group items by their help group heading.\n */\n groupItems<T extends Command | Option>(\n unsortedItems: T[],\n visibleItems: T[],\n getGroup: (item: T) => string,\n ): Map<string, T[]>;\n\n /** Generate the built-in help text. */\n formatHelp(cmd: Command, helper: Help): string;\n}\nexport type HelpConfiguration = Partial<Help>;\n\nexport interface ParseOptions {\n from: 'node' | 'electron' | 'user';\n}\nexport interface HelpContext {\n // optional parameter for .help() and .outputHelp()\n error: boolean;\n}\nexport interface AddHelpTextContext {\n // passed to text function used with .addHelpText()\n error: boolean;\n command: Command;\n}\nexport interface OutputConfiguration {\n writeOut?(str: string): void;\n writeErr?(str: string): void;\n outputError?(str: string, write: (str: string) => void): void;\n\n getOutHelpWidth?(): number;\n getErrHelpWidth?(): number;\n\n getOutHasColors?(): boolean;\n getErrHasColors?(): boolean;\n stripColor?(str: string): string;\n}\n\nexport type AddHelpTextPosition = 'beforeAll' | 'before' | 'after' | 'afterAll';\nexport type HookEvent = 'preSubcommand' | 'preAction' | 'postAction';\n// The source is a string so author can define their own too.\nexport type OptionValueSource =\n | LiteralUnion<'default' | 'config' | 'env' | 'cli' | 'implied', string>\n | undefined;\n\nexport type OptionValues = Record<string, any>;\n\nexport class Command {\n args: string[];\n processedArgs: any[];\n readonly commands: readonly Command[];\n readonly options: readonly Option[];\n readonly registeredArguments: readonly Argument[];\n parent: Command | null;\n\n constructor(name?: string);\n\n /**\n * Set the program version to `str`.\n *\n * This method auto-registers the \"-V, --version\" flag\n * which will print the version number when passed.\n *\n * You can optionally supply the flags and description to override the defaults.\n */\n version(str: string, flags?: string, description?: string): this;\n /**\n * Get the program version.\n */\n version(): string | undefined;\n\n /**\n * Define a command, implemented using an action handler.\n *\n * @remarks\n * The command description is supplied using `.description`, not as a parameter to `.command`.\n *\n * @example\n * ```ts\n * program\n * .command('clone <source> [destination]')\n * .description('clone a repository into a newly created directory')\n * .action((source, destination) => {\n * console.log('clone command called');\n * });\n * ```\n *\n * @param nameAndArgs - command name and arguments, args are `<required>` or `[optional]` and last may also be `variadic...`\n * @param opts - configuration options\n * @returns new command\n */\n command(\n nameAndArgs: string,\n opts?: CommandOptions,\n ): ReturnType<this['createCommand']>;\n /**\n * Define a command, implemented in a separate executable file.\n *\n * @remarks\n * The command description is supplied as the second parameter to `.command`.\n *\n * @example\n * ```ts\n * program\n * .command('start <service>', 'start named service')\n * .command('stop [service]', 'stop named service, or all if no name supplied');\n * ```\n *\n * @param nameAndArgs - command name and arguments, args are `<required>` or `[optional]` and last may also be `variadic...`\n * @param description - description of executable command\n * @param opts - configuration options\n * @returns `this` command for chaining\n */\n command(\n nameAndArgs: string,\n description: string,\n opts?: ExecutableCommandOptions,\n ): this;\n\n /**\n * Factory routine to create a new unattached command.\n *\n * See .command() for creating an attached subcommand, which uses this routine to\n * create the command. You can override createCommand to customise subcommands.\n */\n createCommand(name?: string): Command;\n\n /**\n * Add a prepared subcommand.\n *\n * See .command() for creating an attached subcommand which inherits settings from its parent.\n *\n * @returns `this` command for chaining\n */\n addCommand(cmd: Command, opts?: CommandOptions): this;\n\n /**\n * Factory routine to create a new unattached argument.\n *\n * See .argument() for creating an attached argument, which uses this routine to\n * create the argument. You can override createArgument to return a custom argument.\n */\n createArgument(name: string, description?: string): Argument;\n\n /**\n * Define argument syntax for command.\n *\n * The default is that the argument is required, and you can explicitly\n * indicate this with <> around the name. Put [] around the name for an optional argument.\n *\n * @example\n * ```\n * program.argument('<input-file>');\n * program.argument('[output-file]');\n * ```\n *\n * @returns `this` command for chaining\n */\n argument<T>(\n flags: string,\n description: string,\n parseArg: (value: string, previous: T) => T,\n defaultValue?: T,\n ): this;\n argument(name: string, description?: string, defaultValue?: unknown): this;\n\n /**\n * Define argument syntax for command, adding a prepared argument.\n *\n * @returns `this` command for chaining\n */\n addArgument(arg: Argument): this;\n\n /**\n * Define argument syntax for command, adding multiple at once (without descriptions).\n *\n * See also .argument().\n *\n * @example\n * ```\n * program.arguments('<cmd> [env]');\n * ```\n *\n * @returns `this` command for chaining\n */\n arguments(names: string): this;\n\n /**\n * Customise or override default help command. By default a help command is automatically added if your command has subcommands.\n *\n * @example\n * ```ts\n * program.helpCommand('help [cmd]');\n * program.helpCommand('help [cmd]', 'show help');\n * program.helpCommand(false); // suppress default help command\n * program.helpCommand(true); // add help command even if no subcommands\n * ```\n */\n helpCommand(nameAndArgs: string, description?: string): this;\n helpCommand(enable: boolean): this;\n\n /**\n * Add prepared custom help command.\n */\n addHelpCommand(cmd: Command): this;\n /** @deprecated since v12, instead use helpCommand */\n addHelpCommand(nameAndArgs: string, description?: string): this;\n /** @deprecated since v12, instead use helpCommand */\n addHelpCommand(enable?: boolean): this;\n\n /**\n * Add hook for life cycle event.\n */\n hook(\n event: HookEvent,\n listener: (\n thisCommand: Command,\n actionCommand: Command,\n ) => void | Promise<void>,\n ): this;\n\n /**\n * Register callback to use as replacement for calling process.exit.\n */\n exitOverride(callback?: (err: CommanderError) => never | void): this;\n\n /**\n * Display error message and exit (or call exitOverride).\n */\n error(message: string, errorOptions?: ErrorOptions): never;\n\n /**\n * You can customise the help with a subclass of Help by overriding createHelp,\n * or by overriding Help properties using configureHelp().\n */\n createHelp(): Help;\n\n /**\n * You can customise the help by overriding Help properties using configureHelp(),\n * or with a subclass of Help by overriding createHelp().\n */\n configureHelp(configuration: HelpConfiguration): this;\n /** Get configuration */\n configureHelp(): HelpConfiguration;\n\n /**\n * The default output goes to stdout and stderr. You can customise this for special\n * applications. You can also customise the display of errors by overriding outputError.\n *\n * The configuration properties are all functions:\n * ```\n * // functions to change where being written, stdout and stderr\n * writeOut(str)\n * writeErr(str)\n * // matching functions to specify width for wrapping help\n * getOutHelpWidth()\n * getErrHelpWidth()\n * // functions based on what is being written out\n * outputError(str, write) // used for displaying errors, and not used for displaying help\n * ```\n */\n configureOutput(configuration: OutputConfiguration): this;\n /** Get configuration */\n configureOutput(): OutputConfiguration;\n\n /**\n * Copy settings that are useful to have in common across root command and subcommands.\n *\n * (Used internally when adding a command using `.command()` so subcommands inherit parent settings.)\n */\n copyInheritedSettings(sourceCommand: Command): this;\n\n /**\n * Display the help or a custom message after an error occurs.\n */\n showHelpAfterError(displayHelp?: boolean | string): this;\n\n /**\n * Display suggestion of similar commands for unknown commands, or options for unknown options.\n */\n showSuggestionAfterError(displaySuggestion?: boolean): this;\n\n /**\n * Register callback `fn` for the command.\n *\n * @example\n * ```\n * program\n * .command('serve')\n * .description('start service')\n * .action(function() {\n * // do work here\n * });\n * ```\n *\n * @returns `this` command for chaining\n */\n action(fn: (this: this, ...args: any[]) => void | Promise<void>): this;\n\n /**\n * Define option with `flags`, `description`, and optional argument parsing function or `defaultValue` or both.\n *\n * The `flags` string contains the short and/or long flags, separated by comma, a pipe or space. A required\n * option-argument is indicated by `<>` and an optional option-argument by `[]`.\n *\n * See the README for more details, and see also addOption() and requiredOption().\n *\n * @example\n *\n * ```js\n * program\n * .option('-p, --pepper', 'add pepper')\n * .option('--pt, --pizza-type <TYPE>', 'type of pizza') // required option-argument\n * .option('-c, --cheese [CHEESE]', 'add extra cheese', 'mozzarella') // optional option-argument with default\n * .option('-t, --tip <VALUE>', 'add tip to purchase cost', parseFloat) // custom parse function\n * ```\n *\n * @returns `this` command for chaining\n */\n option(\n flags: string,\n description?: string,\n defaultValue?: string | boolean | string[],\n ): this;\n option<T>(\n flags: string,\n description: string,\n parseArg: (value: string, previous: T) => T,\n defaultValue?: T,\n ): this;\n /** @deprecated since v7, instead use choices or a custom function */\n option(\n flags: string,\n description: string,\n regexp: RegExp,\n defaultValue?: string | boolean | string[],\n ): this;\n\n /**\n * Define a required option, which must have a value after parsing. This usually means\n * the option must be specified on the command line. (Otherwise the same as .option().)\n *\n * The `flags` string contains the short and/or long flags, separated by comma, a pipe or space.\n */\n requiredOption(\n flags: string,\n description?: string,\n defaultValue?: string | boolean | string[],\n ): this;\n requiredOption<T>(\n flags: string,\n description: string,\n parseArg: (value: string, previous: T) => T,\n defaultValue?: T,\n ): this;\n /** @deprecated since v7, instead use choices or a custom function */\n requiredOption(\n flags: string,\n description: string,\n regexp: RegExp,\n defaultValue?: string | boolean | string[],\n ): this;\n\n /**\n * Factory routine to create a new unattached option.\n *\n * See .option() for creating an attached option, which uses this routine to\n * create the option. You can override createOption to return a custom option.\n */\n\n createOption(flags: string, description?: string): Option;\n\n /**\n * Add a prepared Option.\n *\n * See .option() and .requiredOption() for creating and attaching an option in a single call.\n */\n addOption(option: Option): this;\n\n /**\n * Whether to store option values as properties on command object,\n * or store separately (specify false). In both cases the option values can be accessed using .opts().\n *\n * @returns `this` command for chaining\n */\n storeOptionsAsProperties<T extends OptionValues>(): this & T;\n storeOptionsAsProperties<T extends OptionValues>(\n storeAsProperties: true,\n ): this & T;\n storeOptionsAsProperties(storeAsProperties?: boolean): this;\n\n /**\n * Retrieve option value.\n */\n getOptionValue(key: string): any;\n\n /**\n * Store option value.\n */\n setOptionValue(key: string, value: unknown): this;\n\n /**\n * Store option value and where the value came from.\n */\n setOptionValueWithSource(\n key: string,\n value: unknown,\n source: OptionValueSource,\n ): this;\n\n /**\n * Get source of option value.\n */\n getOptionValueSource(key: string): OptionValueSource | undefined;\n\n /**\n * Get source of option value. See also .optsWithGlobals().\n */\n getOptionValueSourceWithGlobals(key: string): OptionValueSource | undefined;\n\n /**\n * Alter parsing of short flags with optional values.\n *\n * @example\n * ```\n * // for `.option('-f,--flag [value]'):\n * .combineFlagAndOptionalValue(true) // `-f80` is treated like `--flag=80`, this is the default behaviour\n * .combineFlagAndOptionalValue(false) // `-fb` is treated like `-f -b`\n * ```\n *\n * @returns `this` command for chaining\n */\n combineFlagAndOptionalValue(combine?: boolean): this;\n\n /**\n * Allow unknown options on the command line.\n *\n * @returns `this` command for chaining\n */\n allowUnknownOption(allowUnknown?: boolean): this;\n\n /**\n * Allow excess command-arguments on the command line. Pass false to make excess arguments an error.\n *\n * @returns `this` command for chaining\n */\n allowExcessArguments(allowExcess?: boolean): this;\n\n /**\n * Enable positional options. Positional means global options are specified before subcommands which lets\n * subcommands reuse the same option names, and also enables subcommands to turn on passThroughOptions.\n *\n * The default behaviour is non-positional and global options may appear anywhere on the command line.\n *\n * @returns `this` command for chaining\n */\n enablePositionalOptions(positional?: boolean): this;\n\n /**\n * Pass through options that come after command-arguments rather than treat them as command-options,\n * so actual command-options come before command-arguments. Turning this on for a subcommand requires\n * positional options to have been enabled on the program (parent commands).\n *\n * The default behaviour is non-positional and options may appear before or after command-arguments.\n *\n * @returns `this` command for chaining\n */\n passThroughOptions(passThrough?: boolean): this;\n\n /**\n * Parse `argv`, setting options and invoking commands when defined.\n *\n * Use parseAsync instead of parse if any of your action handlers are async.\n *\n * Call with no parameters to parse `process.argv`. Detects Electron and special node options like `node --eval`. Easy mode!\n *\n * Or call with an array of strings to parse, and optionally where the user arguments start by specifying where the arguments are `from`:\n * - `'node'`: default, `argv[0]` is the application and `argv[1]` is the script being run, with user arguments after that\n * - `'electron'`: `argv[0]` is the application and `argv[1]` varies depending on whether the electron application is packaged\n * - `'user'`: just user arguments\n *\n * @example\n * ```\n * program.parse(); // parse process.argv and auto-detect electron and special node flags\n * program.parse(process.argv); // assume argv[0] is app and argv[1] is script\n * program.parse(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0]\n * ```\n *\n * @returns `this` command for chaining\n */\n parse(argv?: readonly string[], parseOptions?: ParseOptions): this;\n\n /**\n * Parse `argv`, setting options and invoking commands when defined.\n *\n * Call with no parameters to parse `process.argv`. Detects Electron and special node options like `node --eval`. Easy mode!\n *\n * Or call with an array of strings to parse, and optionally where the user arguments start by specifying where the arguments are `from`:\n * - `'node'`: default, `argv[0]` is the application and `argv[1]` is the script being run, with user arguments after that\n * - `'electron'`: `argv[0]` is the application and `argv[1]` varies depending on whether the electron application is packaged\n * - `'user'`: just user arguments\n *\n * @example\n * ```\n * await program.parseAsync(); // parse process.argv and auto-detect electron and special node flags\n * await program.parseAsync(process.argv); // assume argv[0] is app and argv[1] is script\n * await program.parseAsync(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0]\n * ```\n *\n * @returns Promise\n */\n parseAsync(\n argv?: readonly string[],\n parseOptions?: ParseOptions,\n ): Promise<this>;\n\n /**\n * Called the first time parse is called to save state and allow a restore before subsequent calls to parse.\n * Not usually called directly, but available for subclasses to save their custom state.\n *\n * This is called in a lazy way. Only commands used in parsing chain will have state saved.\n */\n saveStateBeforeParse(): void;\n\n /**\n * Restore state before parse for calls after the first.\n * Not usually called directly, but available for subclasses to save their custom state.\n *\n * This is called in a lazy way. Only commands used in parsing chain will have state restored.\n */\n restoreStateBeforeParse(): void;\n\n /**\n * Parse options from `argv` removing known options,\n * and return argv split into operands and unknown arguments.\n *\n * Side effects: modifies command by storing options. Does not reset state if called again.\n *\n * argv => operands, unknown\n * --known kkk op => [op], []\n * op --known kkk => [op], []\n * sub --unknown uuu op => [sub], [--unknown uuu op]\n * sub -- --unknown uuu op => [sub --unknown uuu op], []\n */\n parseOptions(argv: string[]): ParseOptionsResult;\n\n /**\n * Return an object containing local option values as key-value pairs\n */\n opts<T extends OptionValues>(): T;\n\n /**\n * Return an object containing merged local and global option values as key-value pairs.\n */\n optsWithGlobals<T extends OptionValues>(): T;\n\n /**\n * Set the description.\n *\n * @returns `this` command for chaining\n */\n\n description(str: string): this;\n /** @deprecated since v8, instead use .argument to add command argument with description */\n description(str: string, argsDescription: Record<string, string>): this;\n /**\n * Get the description.\n */\n description(): string;\n\n /**\n * Set the summary. Used when listed as subcommand of parent.\n *\n * @returns `this` command for chaining\n */\n\n summary(str: string): this;\n /**\n * Get the summary.\n */\n summary(): string;\n\n /**\n * Set an alias for the command.\n *\n * You may call more than once to add multiple aliases. Only the first alias is shown in the auto-generated help.\n *\n * @returns `this` command for chaining\n */\n alias(alias: string): this;\n /**\n * Get alias for the command.\n */\n alias(): string;\n\n /**\n * Set aliases for the command.\n *\n * Only the first alias is shown in the auto-generated help.\n *\n * @returns `this` command for chaining\n */\n aliases(aliases: readonly string[]): this;\n /**\n * Get aliases for the command.\n */\n aliases(): string[];\n\n /**\n * Set the command usage.\n *\n * @returns `this` command for chaining\n */\n usage(str: string): this;\n /**\n * Get the command usage.\n */\n usage(): string;\n\n /**\n * Set the name of the command.\n *\n * @returns `this` command for chaining\n */\n name(str: string): this;\n /**\n * Get the name of the command.\n */\n name(): string;\n\n /**\n * Set the name of the command from script filename, such as process.argv[1],\n * or require.main.filename, or __filename.\n *\n * (Used internally and public although not documented in README.)\n *\n * @example\n * ```ts\n * program.nameFromFilename(require.main.filename);\n * ```\n *\n * @returns `this` command for chaining\n */\n nameFromFilename(filename: string): this;\n\n /**\n * Set the directory for searching for executable subcommands of this command.\n *\n * @example\n * ```ts\n * program.executableDir(__dirname);\n * // or\n * program.executableDir('subcommands');\n * ```\n *\n * @returns `this` command for chaining\n */\n executableDir(path: string): this;\n /**\n * Get the executable search directory.\n */\n executableDir(): string | null;\n\n /**\n * Set the help group heading for this subcommand in parent command's help.\n *\n * @returns `this` command for chaining\n */\n helpGroup(heading: string): this;\n /**\n * Get the help group heading for this subcommand in parent command's help.\n */\n helpGroup(): string;\n\n /**\n * Set the default help group heading for subcommands added to this command.\n * (This does not override a group set directly on the subcommand using .helpGroup().)\n *\n * @example\n * program.commandsGroup('Development Commands:);\n * program.command('watch')...\n * program.command('lint')...\n * ...\n *\n * @returns `this` command for chaining\n */\n commandsGroup(heading: string): this;\n /**\n * Get the default help group heading for subcommands added to this command.\n */\n commandsGroup(): string;\n\n /**\n * Set the default help group heading for options added to this command.\n * (This does not override a group set directly on the option using .helpGroup().)\n *\n * @example\n * program\n * .optionsGroup('Development Options:')\n * .option('-d, --debug', 'output extra debugging')\n * .option('-p, --profile', 'output profiling information')\n *\n * @returns `this` command for chaining\n */\n optionsGroup(heading: string): this;\n /**\n * Get the default help group heading for options added to this command.\n */\n optionsGroup(): string;\n\n /**\n * Output help information for this command.\n *\n * Outputs built-in help, and custom text added using `.addHelpText()`.\n *\n */\n outputHelp(context?: HelpContext): void;\n /** @deprecated since v7 */\n outputHelp(cb?: (str: string) => string): void;\n\n /**\n * Return command help documentation.\n */\n helpInformation(context?: HelpContext): string;\n\n /**\n * You can pass in flags and a description to override the help\n * flags and help description for your command. Pass in false\n * to disable the built-in help option.\n */\n helpOption(flags?: string | boolean, description?: string): this;\n\n /**\n * Supply your own option to use for the built-in help option.\n * This is an alternative to using helpOption() to customise the flags and description etc.\n */\n addHelpOption(option: Option): this;\n\n /**\n * Output help information and exit.\n *\n * Outputs built-in help, and custom text added using `.addHelpText()`.\n */\n help(context?: HelpContext): never;\n /** @deprecated since v7 */\n help(cb?: (str: string) => string): never;\n\n /**\n * Add additional text to be displayed with the built-in help.\n *\n * Position is 'before' or 'after' to affect just this command,\n * and 'beforeAll' or 'afterAll' to affect this command and all its subcommands.\n */\n addHelpText(position: AddHelpTextPosition, text: string): this;\n addHelpText(\n position: AddHelpTextPosition,\n text: (context: AddHelpTextContext) => string,\n ): this;\n\n /**\n * Add a listener (callback) for when events occur. (Implemented using EventEmitter.)\n */\n on(event: string | symbol, listener: (...args: any[]) => void): this;\n}\n\nexport interface CommandOptions {\n hidden?: boolean;\n isDefault?: boolean;\n /** @deprecated since v7, replaced by hidden */\n noHelp?: boolean;\n}\nexport interface ExecutableCommandOptions extends CommandOptions {\n executableFile?: string;\n}\n\nexport interface ParseOptionsResult {\n operands: string[];\n unknown: string[];\n}\n\nexport function createCommand(name?: string): Command;\nexport function createOption(flags: string, description?: string): Option;\nexport function createArgument(name: string, description?: string): Argument;\n\nexport const program: Command;\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;AAeA;AAwBA;AAQA;;KApCKA,YA0C2CU,CAAAA,WAAAA,EAAAA,iBAAAA,MAAAA,GAAAA,MAAAA,CAAAA,GAzC5CT,WAgEyCS,GAAMA,CA/D9CR,QA+D8CQ,GA/DnCP,MA+DmCO,CAAAA,KAAAA,EAAAA,KAAAA,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