@alcyone-labs/arg-parser 2.2.0 → 2.3.0
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 +226 -20
- package/dist/assets/.dxtignore.template +0 -1
- package/dist/config/ConfigurationManager.d.ts.map +1 -1
- package/dist/config/plugins/ConfigPlugin.d.ts.map +1 -1
- package/dist/config/plugins/ConfigPluginRegistry.d.ts +1 -1
- package/dist/config/plugins/ConfigPluginRegistry.d.ts.map +1 -1
- package/dist/config/plugins/TomlConfigPlugin.d.ts +1 -1
- package/dist/config/plugins/TomlConfigPlugin.d.ts.map +1 -1
- package/dist/config/plugins/YamlConfigPlugin.d.ts +1 -1
- package/dist/config/plugins/YamlConfigPlugin.d.ts.map +1 -1
- package/dist/config/plugins/index.d.ts +4 -4
- package/dist/config/plugins/index.d.ts.map +1 -1
- package/dist/core/ArgParser.d.ts +14 -3
- package/dist/core/ArgParser.d.ts.map +1 -1
- package/dist/core/ArgParserBase.d.ts.map +1 -1
- package/dist/core/log-path-utils.d.ts +59 -0
- package/dist/core/log-path-utils.d.ts.map +1 -0
- package/dist/core/types.d.ts +1 -1
- package/dist/core/types.d.ts.map +1 -1
- package/dist/dxt/DxtGenerator-testUtils.d.ts +22 -0
- package/dist/dxt/DxtGenerator-testUtils.d.ts.map +1 -0
- package/dist/dxt/DxtGenerator.d.ts +11 -65
- package/dist/dxt/DxtGenerator.d.ts.map +1 -1
- package/dist/index.cjs +799 -1260
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +5 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.min.mjs +6303 -6736
- package/dist/index.min.mjs.map +1 -1
- package/dist/index.mjs +799 -1260
- package/dist/index.mjs.map +1 -1
- package/dist/mcp/ArgParserMcp.d.ts.map +1 -1
- package/dist/mcp/mcp-notifications.d.ts +4 -4
- package/dist/mcp/mcp-notifications.d.ts.map +1 -1
- package/dist/mcp/mcp-prompts.d.ts.map +1 -1
- package/dist/mcp/mcp-protocol-versions.d.ts +11 -11
- package/dist/mcp/mcp-protocol-versions.d.ts.map +1 -1
- package/dist/mcp/mcp-resources.d.ts.map +1 -1
- package/dist/testing/fuzzy-test-cli.d.ts.map +1 -1
- package/dist/testing/fuzzy-tester.d.ts.map +1 -1
- package/package.json +2 -3
- package/dist/assets/tsdown.dxt.config.ts +0 -37
package/README.md
CHANGED
|
@@ -10,6 +10,7 @@ A modern, type-safe command line argument parser with built-in MCP (Model Contex
|
|
|
10
10
|
- [How to Run It](#how-to-run-it)
|
|
11
11
|
- [Setting Up System-Wide CLI Access](#setting-up-system-wide-cli-access)
|
|
12
12
|
- [Parsing Command-Line Arguments](#parsing-command-line-arguments)
|
|
13
|
+
- [Automatic Argument Detection](#automatic-argument-detection)
|
|
13
14
|
- [Cannonical Usage Pattern](#cannonical-usage-pattern)
|
|
14
15
|
- [Top-level await](#top-level-await)
|
|
15
16
|
- [Promise-based parsing](#promise-based-parsing)
|
|
@@ -36,13 +37,20 @@ A modern, type-safe command line argument parser with built-in MCP (Model Contex
|
|
|
36
37
|
- [Common Pitfalls to Avoid](#common-pitfalls-to-avoid)
|
|
37
38
|
- [Automatic MCP Server Mode (`--s-mcp-serve`)](#automatic-mcp-server-mode---s-mcp-serve)
|
|
38
39
|
- [MCP Transports](#mcp-transports)
|
|
40
|
+
- [MCP Log Path Configuration](#mcp-log-path-configuration)
|
|
39
41
|
- [Automatic Console Safety](#automatic-console-safety)
|
|
40
42
|
- [Generating DXT Packages (`--s-build-dxt`)](#generating-dxt-packages---s-build-dxt)
|
|
41
43
|
- [Logo Configuration](#logo-configuration)
|
|
42
44
|
- [Supported Logo Sources](#supported-logo-sources)
|
|
43
45
|
- [How DXT Generation Works](#how-dxt-generation-works)
|
|
46
|
+
- [DXT Bundling Strategies](#dxt-bundling-strategies)
|
|
44
47
|
- [System Flags & Configuration](#system-flags--configuration)
|
|
45
48
|
- [Changelog](#changelog)
|
|
49
|
+
- [v2.3.0](#v230)
|
|
50
|
+
- [v2.2.1](#v221)
|
|
51
|
+
- [v2.2.0](#v220)
|
|
52
|
+
- [v2.1.1](#v211)
|
|
53
|
+
- [v2.1.0](#v210)
|
|
46
54
|
- [v2.0.0](#v200)
|
|
47
55
|
- [v1.3.0](#v130)
|
|
48
56
|
- [v1.2.0](#v120)
|
|
@@ -57,7 +65,7 @@ A modern, type-safe command line argument parser with built-in MCP (Model Contex
|
|
|
57
65
|
- **Automatic MCP Integration**: Transform any CLI into a compliant MCP server with a single command (`--s-mcp-serve`).
|
|
58
66
|
- **Console Safe**: `console.log` and other methods
|
|
59
67
|
are automatically handled in MCP mode to prevent protocol contamination, requiring no changes to your code.
|
|
60
|
-
- **DXT Package Generation**: Generate complete, ready-to-install Claude Desktop Extension (`.dxt`) packages with the `--s-build-dxt` command.
|
|
68
|
+
- **DXT Package Generation**: Generate complete, ready-to-install Claude Desktop Extension (`.dxt`) packages with the `--s-build-dxt` command and `--s-with-node-modules` for platform-dependent builds.
|
|
61
69
|
- **Hierarchical Sub-commands**: Create complex, nested sub-command structures (e.g., `git commit`, `docker container ls`) with flag inheritance.
|
|
62
70
|
- **Configuration Management**: Easily load (`--s-with-env`) and save (`--s-save-to-env`) configurations from/to `.env`, `.json`, `.yaml`, and `.toml` files.
|
|
63
71
|
- **Automatic Help & Error Handling**: Context-aware help text and user-friendly error messages are generated automatically.
|
|
@@ -162,6 +170,18 @@ mycli --s-mcp-serve
|
|
|
162
170
|
|
|
163
171
|
# 3. Generate a DXT package for Claude Desktop (2-steps)
|
|
164
172
|
mycli --s-build-dxt ./my-dxt-package
|
|
173
|
+
|
|
174
|
+
# If you use ML models or packages that include binaries such as Sqlite3 or sharp, etc...
|
|
175
|
+
# You need to bundle the node_modules folder with your DXT package
|
|
176
|
+
# In order to do this, you need to use the following flag:
|
|
177
|
+
# First hard-install all the packages
|
|
178
|
+
rm -rf node_moduels
|
|
179
|
+
pnpm install --prod --node-linker=hoisted
|
|
180
|
+
# Then bundle with node_modules
|
|
181
|
+
mycli --s-build-dxt ./my-dxt-package --s-with-node-modules
|
|
182
|
+
# then packages the dxt
|
|
183
|
+
npx @anthropic-ai/dxt pack ./my-dxt-package
|
|
184
|
+
# then upload the dxt bundle to Claude Desktop from the settings > extensions > advanced screen
|
|
165
185
|
```
|
|
166
186
|
|
|
167
187
|
Read more on generating the DXT package here: [Generating DXT Packages](#generating-dxt-packages---s-build-dxt)
|
|
@@ -957,6 +977,19 @@ my-cli-app --s-mcp-serve
|
|
|
957
977
|
|
|
958
978
|
# You can also override transports and ports using system flags
|
|
959
979
|
my-cli-app --s-mcp-serve --s-mcp-transport sse --s-mcp-port 3001
|
|
980
|
+
|
|
981
|
+
# Configure custom log file path for MCP server logs
|
|
982
|
+
my-cli-app --s-mcp-serve --s-mcp-log-path ./custom-logs/mcp-server.log
|
|
983
|
+
|
|
984
|
+
# Or configure log path programmatically in withMcp()
|
|
985
|
+
const cli = ArgParser.withMcp({
|
|
986
|
+
appName: 'My CLI App',
|
|
987
|
+
appCommandName: 'my-cli-app',
|
|
988
|
+
mcp: {
|
|
989
|
+
serverInfo: { name: 'my-server', version: '1.0.0' },
|
|
990
|
+
logPath: './my-logs/mcp-server.log' // Programmatic log path
|
|
991
|
+
}
|
|
992
|
+
});
|
|
960
993
|
```
|
|
961
994
|
|
|
962
995
|
### MCP Transports
|
|
@@ -973,11 +1006,23 @@ my-tool --s-mcp-serve --s-mcp-transports '[{"type":"stdio"},{"type":"sse","port"
|
|
|
973
1006
|
# Single transport with custom options
|
|
974
1007
|
my-tool --s-mcp-serve --s-mcp-transport sse --s-mcp-port 3000 --s-mcp-host 0.0.0.0
|
|
975
1008
|
|
|
976
|
-
#
|
|
1009
|
+
# Custom log path via CLI flag (logs to specified file instead of ./logs/mcp.log)
|
|
1010
|
+
my-tool --s-mcp-serve --s-mcp-log-path /var/log/my-mcp-server.log
|
|
1011
|
+
|
|
1012
|
+
# Custom log path via programmatic configuration
|
|
1013
|
+
const parser = ArgParser.withMcp({
|
|
1014
|
+
mcp: {
|
|
1015
|
+
serverInfo: { name: 'my-tool', version: '1.0.0' },
|
|
1016
|
+
logPath: '/var/log/my-mcp-server.log'
|
|
1017
|
+
}
|
|
1018
|
+
});
|
|
1019
|
+
|
|
1020
|
+
# Multiple transports and custom log path (configured via --s-mcp-serve system flag)
|
|
977
1021
|
const cli = ArgParser.withMcp({
|
|
978
1022
|
appName: 'multi-tool',
|
|
979
1023
|
appCommandName: 'multi-tool',
|
|
980
1024
|
mcp: {
|
|
1025
|
+
logPath: './logs/multi-tool-mcp.log', // Custom log path
|
|
981
1026
|
serverInfo: {
|
|
982
1027
|
name: 'multi-tool-mcp',
|
|
983
1028
|
version: '1.0.0'
|
|
@@ -993,6 +1038,50 @@ const cli = ArgParser.withMcp({
|
|
|
993
1038
|
});
|
|
994
1039
|
```
|
|
995
1040
|
|
|
1041
|
+
### MCP Log Path Configuration
|
|
1042
|
+
|
|
1043
|
+
MCP server logs can be configured through multiple methods with the following priority order:
|
|
1044
|
+
|
|
1045
|
+
1. **CLI Flag (Highest Priority)**: `--s-mcp-log-path <path>`
|
|
1046
|
+
2. **Programmatic Configuration**: `mcp.logPath` in `withMcp()`
|
|
1047
|
+
3. **Default Path (Fallback)**: `./logs/mcp.log`
|
|
1048
|
+
|
|
1049
|
+
#### Path Resolution Options
|
|
1050
|
+
|
|
1051
|
+
Log paths are resolved with smart defaults for better DXT package compatibility:
|
|
1052
|
+
|
|
1053
|
+
```typescript
|
|
1054
|
+
// Simple string paths (recommended)
|
|
1055
|
+
const parser = ArgParser.withMcp({
|
|
1056
|
+
appName: "My CLI",
|
|
1057
|
+
appCommandName: "my-cli",
|
|
1058
|
+
mcp: {
|
|
1059
|
+
serverInfo: { name: "my-server", version: "1.0.0" },
|
|
1060
|
+
logPath: "./logs/app.log", // Relative to entry point (default)
|
|
1061
|
+
// logPath: "/tmp/app.log", // Absolute paths work too
|
|
1062
|
+
// logPath: "cwd:./logs/app.log", // Explicit process.cwd() relative
|
|
1063
|
+
},
|
|
1064
|
+
});
|
|
1065
|
+
|
|
1066
|
+
// Object configuration for advanced use cases
|
|
1067
|
+
const parser = ArgParser.withMcp({
|
|
1068
|
+
// ... other config
|
|
1069
|
+
mcp: {
|
|
1070
|
+
// ... server info
|
|
1071
|
+
logPath: {
|
|
1072
|
+
path: "./logs/app.log",
|
|
1073
|
+
relativeTo: "entry", // "entry" | "cwd" | "absolute"
|
|
1074
|
+
basePath: "/custom/base", // Optional custom base path
|
|
1075
|
+
},
|
|
1076
|
+
},
|
|
1077
|
+
});
|
|
1078
|
+
|
|
1079
|
+
// CLI flag overrides programmatic setting
|
|
1080
|
+
// my-cli --s-mcp-serve --s-mcp-log-path ./override.log
|
|
1081
|
+
```
|
|
1082
|
+
|
|
1083
|
+
The CLI flag always takes precedence, allowing users to override the developer's programmatic configuration when needed. By default, relative paths resolve relative to the application's entry point, making logs predictably located near DXT packages.
|
|
1084
|
+
|
|
996
1085
|
### Automatic Console Safety
|
|
997
1086
|
|
|
998
1087
|
A major challenge in MCP is preventing `console.log` from corrupting the JSON-RPC communication over `STDOUT`. ArgParser solves this automatically.
|
|
@@ -1013,12 +1102,26 @@ my-cli-app --s-build-dxt ./my-dxt-package
|
|
|
1013
1102
|
# A default logo will be applied if you don't provide one.
|
|
1014
1103
|
|
|
1015
1104
|
# 2. (Optional) Pack the folder into a .dxt file for distribution
|
|
1105
|
+
# (you can install the unpacked folder) directly in Claude Desktop > Settings > Extensions > Advanced
|
|
1016
1106
|
npx @anthropic-ai/dxt pack ./my-dxt-package
|
|
1017
1107
|
|
|
1018
|
-
# 3. (Optional) Sign the DXT package
|
|
1108
|
+
# 3. (Optional) Sign the DXT package - this has not been well tested yet
|
|
1019
1109
|
npx @anthropic-ai/dxt sign ./my-dxt-package.dxt
|
|
1020
1110
|
|
|
1021
1111
|
# Then drag & drop the .dxt file into Claude Desktop to install it, in the Settings > Extensions screen.
|
|
1112
|
+
|
|
1113
|
+
# **IMPORTANT**:
|
|
1114
|
+
# If you use ML models or packages that include binaries such as Sqlite3 or sharp, etc...
|
|
1115
|
+
# You need to bundle the node_modules folder with your DXT package
|
|
1116
|
+
# In order to do this, you need to use the following flag:
|
|
1117
|
+
# First hard-install all the packages
|
|
1118
|
+
rm -rf node_moduels
|
|
1119
|
+
pnpm install --prod --linker hoisted
|
|
1120
|
+
# Then bundle with node_modules
|
|
1121
|
+
mycli --s-build-dxt ./my-dxt-package --s-with-node-modules
|
|
1122
|
+
# then build the dxt bundle
|
|
1123
|
+
npx @anthropic-ai/dxt pack ./my-dxt-package
|
|
1124
|
+
# then upload the dxt bundle to Claude Desktop from the settings > extensions > advanced
|
|
1022
1125
|
```
|
|
1023
1126
|
|
|
1024
1127
|
### Logo Configuration
|
|
@@ -1069,36 +1172,139 @@ When you run `--s-build-dxt`, ArgParser performs several steps to create a self-
|
|
|
1069
1172
|
2. **Manifest Generation**: It creates a `manifest.json` file.
|
|
1070
1173
|
- Tool flags are converted into a JSON Schema for the `input_schema`.
|
|
1071
1174
|
- Flags with an `env` property (e.g., `{ name: 'apiKey', env: 'API_KEY' }`) are automatically added to the `user_config` section, prompting the user for the value upon installation and making it available as an environment variable to your tool.
|
|
1072
|
-
3. **Autonomous Build**: It bundles your CLI's source code and its dependencies into a single entry point (e.g., `server.js`) that can run without `node_modules`. This ensures the DXT is portable and reliable.
|
|
1175
|
+
3. **Autonomous Build**: It bundles your CLI's source code and its dependencies into a single entry point (e.g., `server.js`) that can run without `node_modules`. This ensures the DXT is portable and reliable. If you have properly setup your node_modules (via `pnpm install --prod --node-linker=hoisted`) and pass `--s-with-node-nodules` to the bundling process, the resulting DXT will include all necessary dependencies, this is useful for projects that require native dependencies or have complex dependency trees.
|
|
1073
1176
|
4. **Packaging**: It assembles all necessary files (manifest, server bundle, logo, etc.) into the specified output directory, ready to be used by Claude Desktop or packed with `npx @anthropic-ai/dxt`.
|
|
1074
1177
|
|
|
1178
|
+
### DXT Bundling Strategies
|
|
1179
|
+
|
|
1180
|
+
ArgParser offers two approaches for handling dependencies in DXT packages, depending on your project's needs.
|
|
1181
|
+
|
|
1182
|
+
#### Standard Approach (Recommended for Most Projects)
|
|
1183
|
+
|
|
1184
|
+
```bash
|
|
1185
|
+
# For pure JavaScript/TypeScript projects
|
|
1186
|
+
your-cli --s-build-dxt
|
|
1187
|
+
```
|
|
1188
|
+
|
|
1189
|
+
- **Best for**: Pure JS/TS projects without native dependencies
|
|
1190
|
+
- **Bundle size**: Small (5-10MB typical)
|
|
1191
|
+
- **Build time**: Fast
|
|
1192
|
+
- **Dependencies**: Bundled automatically by TSDown
|
|
1193
|
+
|
|
1194
|
+
#### Native Dependencies Approach
|
|
1195
|
+
|
|
1196
|
+
```bash
|
|
1197
|
+
# For projects with native binaries (ONNX, Sharp, SQLite, etc.)
|
|
1198
|
+
rm -rf node_modules
|
|
1199
|
+
pnpm install --prod --node-linker=hoisted
|
|
1200
|
+
your-cli --s-build-dxt --s-with-node-modules
|
|
1201
|
+
```
|
|
1202
|
+
|
|
1203
|
+
- **Best for**: Projects using ONNX Runtime, Sharp, Canvas, SQLite, or other packages with `.node` binaries
|
|
1204
|
+
- **Bundle size**: Larger (50-200MB typical)
|
|
1205
|
+
- **Build time**: Longer (copies entire node_modules)
|
|
1206
|
+
- **Dependencies**: Complete autonomy - no installation needed by Claude
|
|
1207
|
+
|
|
1208
|
+
**When to use `--s-with-node-modules`:**
|
|
1209
|
+
|
|
1210
|
+
- ✅ Your project uses machine learning packages (ONNX Runtime, TensorFlow bindings)
|
|
1211
|
+
- ✅ You need image processing (Sharp, Canvas)
|
|
1212
|
+
- ✅ You use database packages with native binaries (better-sqlite3, sqlite3)
|
|
1213
|
+
- ✅ You want guaranteed compatibility without runtime installation
|
|
1214
|
+
- ✅ Bundle size is acceptable for your use case
|
|
1215
|
+
|
|
1216
|
+
**Required preparation steps:**
|
|
1217
|
+
|
|
1218
|
+
1. `rm -rf node_modules` - Clean slate for proper structure
|
|
1219
|
+
2. `pnpm install --prod --node-linker=hoisted` - Creates flat, symlink-free structure
|
|
1220
|
+
3. Add `--s-with-node-modules` flag to your build command
|
|
1221
|
+
|
|
1222
|
+
The system automatically validates your setup and provides guidance if issues are detected.
|
|
1223
|
+
|
|
1224
|
+
### Typical Errors
|
|
1225
|
+
|
|
1226
|
+
**Failed to run in Claude Desktop**:
|
|
1227
|
+
|
|
1228
|
+
Claude Desktop is pretty finicky (as of Claude 0.12.28), and the built-in Node.js does not work with extensions built with `--s-with-node-modules` and installed via ArgParser (and I have no idea why because there's no debug info).
|
|
1229
|
+
To resolve this, simply go to `Claude Desktop > Settings > Extensions > Advanced Settings` and turn **OFF** `Use Built-in Node.js for MCP`.
|
|
1230
|
+
|
|
1231
|
+
Note that there are _many_ reasons for extensions not to work, if it does not work with Built-in or System Node.js, then something in your app is wrong. Feel free to join Alcyone Labs' discord for support: [Alcyone Labs' Discord](https://discord.gg/rRHhpz5nS5)
|
|
1232
|
+
|
|
1233
|
+
**Failed to attach to MCP when downloading external assets**
|
|
1234
|
+
|
|
1235
|
+
Sometimes, the MCP client needs to install external files, for example an ML model from HuggingFace or some task that takes more than 10 seconds to run. While it's working, Claude Desktop will display a `Cannot attach to MCP`, simply ignore it, Claude Desktop runs a ping every X seconds, and when it is running a long-running task, the ping will fail, but the task itself will still finish correctly.
|
|
1236
|
+
|
|
1237
|
+
**Failed to generate DXT package**:
|
|
1238
|
+
|
|
1239
|
+
If you encounter the following error running a command such as:
|
|
1240
|
+
|
|
1241
|
+
```bash
|
|
1242
|
+
rm -rf node_modules
|
|
1243
|
+
pnpm install --prod --node-linker=hoisted
|
|
1244
|
+
bun src/index.ts --s-build-dxt ./dxt --s-with-node-modules
|
|
1245
|
+
|
|
1246
|
+
-- Error generating DXT package: TSDown DXT build failed: EEXIST: file already exists, mkdir
|
|
1247
|
+
```
|
|
1248
|
+
|
|
1249
|
+
Then run:
|
|
1250
|
+
|
|
1251
|
+
```bash
|
|
1252
|
+
rm -rf ./dxt
|
|
1253
|
+
bun src/index.ts --s-build-dxt ./dxt --s-with-node-modules
|
|
1254
|
+
```
|
|
1255
|
+
|
|
1256
|
+
And it should work. TSDown is tasked to clean the outputDir first, but it won't if some files have been manually changed.
|
|
1257
|
+
|
|
1075
1258
|
---
|
|
1076
1259
|
|
|
1077
1260
|
## System Flags & Configuration
|
|
1078
1261
|
|
|
1079
1262
|
ArgParser includes built-in `--s-*` flags for development, debugging, and configuration. They are processed before normal arguments and will cause the program to exit after their task is complete.
|
|
1080
1263
|
|
|
1081
|
-
| Flag | Description
|
|
1082
|
-
| --------------------------- |
|
|
1083
|
-
| **MCP & DXT** |
|
|
1084
|
-
| `--s-mcp-serve` | Starts the application in MCP server mode, exposing all tools.
|
|
1085
|
-
| `--s-build-dxt [dir]` | Generates a complete, autonomous DXT package for Claude Desktop in the specified directory.
|
|
1086
|
-
| `--s-
|
|
1087
|
-
| `--s-mcp-
|
|
1088
|
-
| `--s-mcp-
|
|
1089
|
-
| `--s-mcp-
|
|
1090
|
-
|
|
|
1091
|
-
| `--s-
|
|
1092
|
-
|
|
|
1093
|
-
|
|
|
1094
|
-
| `--s-
|
|
1095
|
-
|
|
|
1096
|
-
| `--s-
|
|
1264
|
+
| Flag | Description |
|
|
1265
|
+
| --------------------------- | -------------------------------------------------------------------------------------------------------------- |
|
|
1266
|
+
| **MCP & DXT** | |
|
|
1267
|
+
| `--s-mcp-serve` | Starts the application in MCP server mode, exposing all tools. |
|
|
1268
|
+
| `--s-build-dxt [dir]` | Generates a complete, autonomous DXT package for Claude Desktop in the specified directory. |
|
|
1269
|
+
| `--s-with-node-modules` | Use with `--s-build-dxt`. Includes complete node_modules in DXT package for projects with native dependencies. |
|
|
1270
|
+
| `--s-mcp-transport <type>` | Overrides the MCP transport (`stdio`, `sse`, `streamable-http`). |
|
|
1271
|
+
| `--s-mcp-transports <json>` | Overrides transports with a JSON array for multi-transport setups. |
|
|
1272
|
+
| `--s-mcp-port <number>` | Sets the port for HTTP-based transports (`sse`, `streamable-http`). |
|
|
1273
|
+
| `--s-mcp-host <string>` | Sets the host address for HTTP-based transports. |
|
|
1274
|
+
| `--s-mcp-log-path <path>` | Sets the file path for MCP server logs (default: `./logs/mcp.log`). Overrides programmatic setting. |
|
|
1275
|
+
| **Configuration** | |
|
|
1276
|
+
| `--s-with-env <file>` | Loads configuration from a file (`.env`, `.json`, `.yaml`, `.toml`). CLI args take precedence. |
|
|
1277
|
+
| `--s-save-to-env <file>` | Saves the current arguments to a configuration file, perfect for templates. |
|
|
1278
|
+
| **Debugging** | |
|
|
1279
|
+
| `--s-debug` | Prints a detailed, step-by-step log of the argument parsing process. |
|
|
1280
|
+
| `--s-debug-print` | Exports the entire parser configuration to a JSON file for inspection. |
|
|
1281
|
+
| `--s-enable-fuzzy` | Enables fuzzy testing mode—a dry run that parses args but skips handler execution. |
|
|
1097
1282
|
|
|
1098
1283
|
---
|
|
1099
1284
|
|
|
1100
1285
|
## Changelog
|
|
1101
1286
|
|
|
1287
|
+
### v2.3.0
|
|
1288
|
+
|
|
1289
|
+
The DXT bundling is working pretty well now, and we have had a lot of success building, bundling and running various extensions. If you see issues, feel free to open an Issue on GitHub with details, or ask about it on [Alcyone Labs' Discord](https://discord.gg/rRHhpz5nS5)
|
|
1290
|
+
|
|
1291
|
+
Make sure to clearly identify if you need to include the node_modules or not. In doubt, include them using `--s-with-node-modules`
|
|
1292
|
+
|
|
1293
|
+
**Feat**
|
|
1294
|
+
|
|
1295
|
+
- **New `--s-with-node-modules` flag**: Create fully autonomous DXT packages that include complete native dependencies. Perfect for projects using ONNX Runtime, Sharp, SQLite, or other packages with `.node` binaries. Use `rm -rf ./node_modules && pnpm install --prod --node-linker=hoisted` followed by `my-cli --s-build-dxt ./dxt --s-with-node-modules` to create self-contained packages that work without Claude needing to install dependencies.
|
|
1296
|
+
Note that when bundling with node_modules, it's likely that the built-in Node.js will not work with that extension, so go to `Claude Desktop > Settings > Extensions > Advanced Settings` and turn **OFF** `Use Built-in Node.js for MCP`.
|
|
1297
|
+
|
|
1298
|
+
### v2.2.1
|
|
1299
|
+
|
|
1300
|
+
**Feat**
|
|
1301
|
+
|
|
1302
|
+
- You can now specify logPath for the MCP output and easily disambiguate what the path is relative to (`__dirname` versus `process.cwd()` versus absolute)
|
|
1303
|
+
|
|
1304
|
+
**Fixes and changes**
|
|
1305
|
+
|
|
1306
|
+
- Fixes an issue where building a DXT package via `--s-build-dxt` would generate an invalid package if the entry_point was a TypeScript .ts file.
|
|
1307
|
+
|
|
1102
1308
|
### v2.2.0
|
|
1103
1309
|
|
|
1104
1310
|
**Feat**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigurationManager.d.ts","sourceRoot":"","sources":["../../src/config/ConfigurationManager.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAGhE;;;GAGG;AACH,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,iBAAiB,CAAM;gBAEnB,iBAAiB,EAAE,GAAG;IAOlC;;OAEG;IACI,0BAA0B,IAAI,MAAM;
|
|
1
|
+
{"version":3,"file":"ConfigurationManager.d.ts","sourceRoot":"","sources":["../../src/config/ConfigurationManager.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAGhE;;;GAGG;AACH,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,iBAAiB,CAAM;gBAEnB,iBAAiB,EAAE,GAAG;IAOlC;;OAEG;IACI,0BAA0B,IAAI,MAAM;IAwB3C;;OAEG;IACI,mBAAmB,CACxB,WAAW,EAAE,MAAM,EAAE,EACrB,WAAW,EAAE,GAAG,EAAE,GACjB,OAAO;IA2BV;;OAEG;IACI,aAAa,CAClB,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,MAAM,EAAE,EACtB,WAAW,EAAE,GAAG,EAAE,GACjB,IAAI;IAqEP;;OAEG;IACI,WAAW,CAChB,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE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AAG,CAAC,GAC3B,MAAM;IAqCT;;OAEG;IACH,OAAO,CAAC,aAAa;CAStB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigPlugin.d.ts","sourceRoot":"","sources":["../../../src/config/plugins/ConfigPlugin.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,QAAQ,CAAC,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAEvC;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB;;;;OAIG;IACH,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAE5C;;;;;;OAMG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,GAAG,GAAG,MAAM,CAAC;CAC9E;AAED;;GAEG;AACH,8BAAsB,YAAa,YAAW,aAAa;IACzD,QAAQ,CAAC,QAAQ,CAAC,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAChD,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAE/B,QAAQ,CAAC,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IACpD,QAAQ,CAAC,QAAQ,
|
|
1
|
+
{"version":3,"file":"ConfigPlugin.d.ts","sourceRoot":"","sources":["../../../src/config/plugins/ConfigPlugin.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,QAAQ,CAAC,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAEvC;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB;;;;OAIG;IACH,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EA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AAI,
|
|
1
|
+
{"version":3,"file":"ConfigPluginRegistry.d.ts","sourceRoot":"","sources":["../../../src/config/plugins/ConfigPluginRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAGpD;;;GAGG;AACH,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,OAAO,CAAyC;IACxD,OAAO,CAAC,YAAY,CAAyC;;IAQ7D;;OAEG;IACI,cAAc,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI;IASlD;;OAEG;IACI,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS;IAIzD;;OAEG;IACI,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS;IAIzE;;OAEG;IACI,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO;IAIvD;;OAEG;IACI,oBAAoB,IAAI,MAAM,EAAE;IAIvC;;OAEG;IACI,sBAAsB,IAAI,MAAM,EAAE;IAIzC;;OAEG;IACI,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAiB9C;;OAEG;IACI,KAAK,IAAI,IAAI;IAKpB;;;OAGG;IACI,2BAA2B,IAAI,IAAI;IAwB1C;;;OAGG;IACU,gCAAgC,IAAI,OAAO,CAAC,IAAI,CAAC;CAuB/D;AAED;;;GAGG;AACH,eAAO,MAAM,0BAA0B,sBAA6B,CAAC;AAErE;;;GAGG;AACH,wBAAgB,2BAA2B,IAAI,IAAI,CAElD;AAED;;;GAGG;AACH,wBAAsB,gCAAgC,IAAI,OAAO,CAAC,IAAI,CAAC,CAEtE;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG,IAAI,CAmC/D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TomlConfigPlugin.d.ts","sourceRoot":"","sources":["../../../src/config/plugins/TomlConfigPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C;;;GAGG;AACH,qBAAa,gBAAiB,SAAQ,YAAY;IAChD,QAAQ,CAAC,mBAAmB,WAAqB;IACjD,QAAQ,CAAC,IAAI,UAAU;IAEvB,OAAO,CAAC,UAAU,CAAa;gBAEnB,UAAU,CAAC,EAAE,GAAG;IAS5B,OAAO,CAAC,cAAc;IAkBtB,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;
|
|
1
|
+
{"version":3,"file":"TomlConfigPlugin.d.ts","sourceRoot":"","sources":["../../../src/config/plugins/TomlConfigPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C;;;GAGG;AACH,qBAAa,gBAAiB,SAAQ,YAAY;IAChD,QAAQ,CAAC,mBAAmB,WAAqB;IACjD,QAAQ,CAAC,IAAI,UAAU;IAEvB,OAAO,CAAC,UAAU,CAAa;gBAEnB,UAAU,CAAC,EAAE,GAAG;IAS5B,OAAO,CAAC,cAAc;IAkBtB,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAmB3C,QAAQ,CACN,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC5B,KAAK,EAAE,GAAG,EAAE,EACZ,UAAU,EAAE,GAAG,GACd,MAAM;IAsDT;;OAEG;IACH,OAAO,CAAC,eAAe;IA4BvB,OAAO,CAAC,aAAa;CAMtB;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,gBAAgB,GAAG,IAAI,CAU1D;AAED;;;GAGG;AACH,wBAAsB,qBAAqB,IAAI,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAsB9E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"YamlConfigPlugin.d.ts","sourceRoot":"","sources":["../../../src/config/plugins/YamlConfigPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C;;;GAGG;AACH,qBAAa,gBAAiB,SAAQ,YAAY;IAChD,QAAQ,CAAC,mBAAmB,WAAqB;IACjD,QAAQ,CAAC,IAAI,UAAU;IAEvB,OAAO,CAAC,UAAU,CAAa;gBAEnB,UAAU,CAAC,EAAE,GAAG;IAS5B,OAAO,CAAC,cAAc;IAgBtB,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;
|
|
1
|
+
{"version":3,"file":"YamlConfigPlugin.d.ts","sourceRoot":"","sources":["../../../src/config/plugins/YamlConfigPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C;;;GAGG;AACH,qBAAa,gBAAiB,SAAQ,YAAY;IAChD,QAAQ,CAAC,mBAAmB,WAAqB;IACjD,QAAQ,CAAC,IAAI,UAAU;IAEvB,OAAO,CAAC,UAAU,CAAa;gBAEnB,UAAU,CAAC,EAAE,GAAG;IAS5B,OAAO,CAAC,cAAc;IAgBtB,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAmB3C,QAAQ,CACN,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC5B,KAAK,EAAE,GAAG,EAAE,EACZ,UAAU,EAAE,GAAG,GACd,MAAM;IA6CT;;OAEG;IACH,OAAO,CAAC,eAAe;CA2BxB;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,gBAAgB,GAAG,IAAI,CAU1D;AAED;;;GAGG;AACH,wBAAsB,qBAAqB,IAAI,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAsB9E"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { type IConfigPlugin, ConfigPlugin, JsonConfigPlugin, EnvConfigPlugin } from
|
|
2
|
-
export { ConfigPluginRegistry, globalConfigPluginRegistry, enableOptionalConfigPlugins, enableOptionalConfigPluginsAsync, enableConfigPlugins } from
|
|
3
|
-
export { TomlConfigPlugin, createTomlPlugin, createTomlPluginAsync } from
|
|
4
|
-
export { YamlConfigPlugin, createYamlPlugin, createYamlPluginAsync } from
|
|
1
|
+
export { type IConfigPlugin, ConfigPlugin, JsonConfigPlugin, EnvConfigPlugin, } from "./ConfigPlugin";
|
|
2
|
+
export { ConfigPluginRegistry, globalConfigPluginRegistry, enableOptionalConfigPlugins, enableOptionalConfigPluginsAsync, enableConfigPlugins, } from "./ConfigPluginRegistry";
|
|
3
|
+
export { TomlConfigPlugin, createTomlPlugin, createTomlPluginAsync, } from "./TomlConfigPlugin";
|
|
4
|
+
export { YamlConfigPlugin, createYamlPlugin, createYamlPluginAsync, } from "./YamlConfigPlugin";
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/config/plugins/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,aAAa,EAClB,YAAY,EACZ,gBAAgB,EAChB,eAAe,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/config/plugins/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,aAAa,EAClB,YAAY,EACZ,gBAAgB,EAChB,eAAe,GAChB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,oBAAoB,EACpB,0BAA0B,EAC1B,2BAA2B,EAC3B,gCAAgC,EAChC,mBAAmB,GACpB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,oBAAoB,CAAC"}
|
package/dist/core/ArgParser.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { GenerateMcpToolsOptions, IMcpToolStructure } from "../mcp/mcp-integration";
|
|
2
2
|
import { ArgParserBase, type IArgParserParams } from "./ArgParserBase";
|
|
3
|
+
import { type LogPath } from "./log-path-utils";
|
|
3
4
|
import type { IFlag, IHandlerContext, OutputSchemaConfig } from "./types";
|
|
4
5
|
/**
|
|
5
6
|
* Configuration for a single MCP transport
|
|
@@ -68,6 +69,16 @@ export type McpServerOptions = {
|
|
|
68
69
|
defaultTransport?: McpTransportConfig;
|
|
69
70
|
/** Tool generation options for the MCP server */
|
|
70
71
|
toolOptions?: GenerateMcpToolsOptions;
|
|
72
|
+
/**
|
|
73
|
+
* Custom log file path for MCP server logs (default: "./logs/mcp.log" relative to entry point)
|
|
74
|
+
*
|
|
75
|
+
* Can be:
|
|
76
|
+
* - Simple string: "./logs/app.log" (relative to entry point)
|
|
77
|
+
* - Absolute path: "/tmp/app.log"
|
|
78
|
+
* - Explicit cwd: "cwd:./logs/app.log" (relative to process.cwd())
|
|
79
|
+
* - Config object: { path: "./logs/app.log", relativeTo: "entry" | "cwd" | "absolute" }
|
|
80
|
+
*/
|
|
81
|
+
logPath?: LogPath;
|
|
71
82
|
};
|
|
72
83
|
/**
|
|
73
84
|
* Combined options for withMcp() method
|
|
@@ -268,7 +279,7 @@ export declare class ArgParser<THandlerReturn = any> extends ArgParserBase<THand
|
|
|
268
279
|
* @param toolOptions Optional MCP tool generation options
|
|
269
280
|
* @returns Configured MCP server instance
|
|
270
281
|
*/
|
|
271
|
-
createMcpServer(serverInfo?: DxtServerInfo, toolOptions?: GenerateMcpToolsOptions): Promise<any>;
|
|
282
|
+
createMcpServer(serverInfo?: DxtServerInfo, toolOptions?: GenerateMcpToolsOptions, logPath?: LogPath): Promise<any>;
|
|
272
283
|
/**
|
|
273
284
|
* Set up change notifications for the MCP server
|
|
274
285
|
* @param _server The MCP server instance (unused for now, but reserved for future client connection tracking)
|
|
@@ -302,7 +313,7 @@ export declare class ArgParser<THandlerReturn = any> extends ArgParserBase<THand
|
|
|
302
313
|
host?: string;
|
|
303
314
|
path?: string;
|
|
304
315
|
sessionIdGenerator?: () => string;
|
|
305
|
-
}>, toolOptions?: GenerateMcpToolsOptions): Promise<void>;
|
|
316
|
+
}>, toolOptions?: GenerateMcpToolsOptions, logPath?: LogPath): Promise<void>;
|
|
306
317
|
/**
|
|
307
318
|
* Start an MCP server with a specific transport type
|
|
308
319
|
* @param serverInfo Server configuration
|
|
@@ -320,7 +331,7 @@ export declare class ArgParser<THandlerReturn = any> extends ArgParserBase<THand
|
|
|
320
331
|
host?: string;
|
|
321
332
|
path?: string;
|
|
322
333
|
sessionIdGenerator?: () => string;
|
|
323
|
-
}, toolOptions?: GenerateMcpToolsOptions): Promise<void>;
|
|
334
|
+
}, toolOptions?: GenerateMcpToolsOptions, logPath?: LogPath): Promise<void>;
|
|
324
335
|
parse(processArgs?: string[], options?: any): Promise<any>;
|
|
325
336
|
/**
|
|
326
337
|
* CLI-friendly parse method that automatically handles ParseResult objects
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArgParser.d.ts","sourceRoot":"","sources":["../../src/core/ArgParser.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,uBAAuB,EACvB,iBAAiB,EAClB,MAAM,wBAAwB,CAAC;AAKhC,OAAO,EAAE,aAAa,EAAE,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,KAAK,EACV,KAAK,EACL,eAAe,EACf,kBAAkB,EAEnB,MAAM,SAAS,CAAC;AAGjB;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,OAAO,GAAG,KAAK,GAAG,iBAAiB,CAAC;IAC1C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,kBAAkB,CAAC,EAAE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ACW,UAAU,CAAC,CAAC,GAAG,GAAG,EAC9B,OAAO,CAAC,EAAE,qBAAqB,CAAC,OAAO,aAAa,CAAC,CAAC,CAAC,CAAC,EACxD,YAAY,CAAC,EAAE,qBAAqB,CAAC,OAAO,aAAa,CAAC,CAAC,CAAC,CAAC,GAC5D,SAAS,CAAC,CAAC,CAAC;WASD,aAAa,CAAC,CAAC,GAAG,GAAG,EAAE,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC;CA+B7E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArgParserBase.d.ts","sourceRoot":"","sources":["../../src/core/ArgParserBase.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,aAAa,EACb,uBAAuB,EACxB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC3E,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACpB,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"ArgParserBase.d.ts","sourceRoot":"","sources":["../../src/core/ArgParserBase.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,aAAa,EACb,uBAAuB,EACxB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC3E,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACpB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,KAAK,EACV,KAAK,EACL,eAAe,EACf,WAAW,EACX,WAAW,EACX,aAAa,EACb,WAAW,EACZ,MAAM,SAAS,CAAC;AAEjB,qBAAa,cAAe,SAAQ,KAAK;IAI9B,QAAQ,EAAE,MAAM,EAAE;IAHpB,YAAY,EAAE,MAAM,EAAE,CAAC;gBAE5B,OAAO,EAAE,MAAM,EACR,QAAQ,GAAE,MAAM,EAAO;CAMjC;AAED,MAAM,WAAW,gBAAgB,CAAC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OAGG;YACW,eAAe;IA6L7B,QAAQ,IAAI,MAAM;IAiLX,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS;IAIpD,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAK9B,eAAe,IAAI,MAAM,EAAE;IAU3B,kBAAkB,IAAI,WAAW,CAAC,aAAa,EAAE,CAAC;IA+SzD;;OAEG;IACH,cAAc,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI;IAU/C;;OAEG;IACH,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAQrC;;OAEG;IACH,eAAe,IAAI,iBAAiB,EAAE;IAItC;;OAEG;IACH,YAAY,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI;IAM3C;;OAEG;IACH,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAQnC;;OAEG;IACH,aAAa,IAAI,eAAe,EAAE;IAIlC;;OAEG;IACH,WAAW,CACT,QAAQ,EAAE,CAAC,KAAK,EAAE;QAChB,IAAI,EAAE,aAAa,CAAC;QACpB,MAAM,EAAE,MAAM,CAAC;QACf,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,KAAK,IAAI,GACT,IAAI;IAKP;;OAEG;IACH,YAAY,CACV,QAAQ,EAAE,CAAC,KAAK,EAAE;QAChB,IAAI,EAAE,aAAa,CAAC;QACpB,MAAM,EAAE,MAAM,CAAC;QACf,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,KAAK,IAAI,GACT,IAAI;IAKP;;OAEG;IACH,0BAA0B,IAAI,uBAAuB;IAIrD;;OAEG;IACH,sBAAsB,IAAI,mBAAmB;IAI7C;;OAEG;IACH,oBAAoB,IAAI,iBAAiB;CA4Z1C"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration object for log path with explicit relative base
|
|
3
|
+
*/
|
|
4
|
+
export interface LogPathConfig {
|
|
5
|
+
/** The log file path */
|
|
6
|
+
path: string;
|
|
7
|
+
/** What the path should be relative to */
|
|
8
|
+
relativeTo?: "entry" | "cwd" | "absolute";
|
|
9
|
+
/** Manual base path override (used with relativeTo: 'absolute') */
|
|
10
|
+
basePath?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Log path can be a simple string or a configuration object
|
|
14
|
+
*/
|
|
15
|
+
export type LogPath = string | LogPathConfig;
|
|
16
|
+
/**
|
|
17
|
+
* Attempts to detect the entry point script using multiple methods
|
|
18
|
+
* @returns The detected entry point path or null if detection fails
|
|
19
|
+
*/
|
|
20
|
+
export declare function detectEntryPoint(): string | null;
|
|
21
|
+
/**
|
|
22
|
+
* Helper to get entry point from import.meta.url when in ES module context
|
|
23
|
+
* @param importMetaUrl The import.meta.url value
|
|
24
|
+
* @returns The file path
|
|
25
|
+
*/
|
|
26
|
+
export declare function getEntryPointFromImportMeta(importMetaUrl: string): string;
|
|
27
|
+
/**
|
|
28
|
+
* Resolves a log path configuration to an absolute file path
|
|
29
|
+
* @param logPath The log path configuration (string or object)
|
|
30
|
+
* @param fallbackEntryPoint Optional fallback entry point if detection fails
|
|
31
|
+
* @returns Absolute path to the log file
|
|
32
|
+
*/
|
|
33
|
+
export declare function resolveLogPath(logPath: LogPath, fallbackEntryPoint?: string): string;
|
|
34
|
+
/**
|
|
35
|
+
* Creates a log path configuration for entry-point relative logging
|
|
36
|
+
* @param path The relative path from the entry point
|
|
37
|
+
* @returns LogPathConfig object
|
|
38
|
+
*/
|
|
39
|
+
export declare function entryRelative(path: string): LogPathConfig;
|
|
40
|
+
/**
|
|
41
|
+
* Creates a log path configuration for process.cwd() relative logging
|
|
42
|
+
* @param path The relative path from process.cwd()
|
|
43
|
+
* @returns LogPathConfig object
|
|
44
|
+
*/
|
|
45
|
+
export declare function cwdRelative(path: string): LogPathConfig;
|
|
46
|
+
/**
|
|
47
|
+
* Creates a log path configuration for absolute path logging
|
|
48
|
+
* @param path The absolute path or relative path
|
|
49
|
+
* @param basePath Optional base path to resolve relative paths against
|
|
50
|
+
* @returns LogPathConfig object
|
|
51
|
+
*/
|
|
52
|
+
export declare function absolutePath(path: string, basePath?: string): LogPathConfig;
|
|
53
|
+
/**
|
|
54
|
+
* Utility to help migrate from old relative-to-cwd behavior
|
|
55
|
+
* @param path The path that was previously relative to cwd
|
|
56
|
+
* @returns String with explicit cwd: prefix
|
|
57
|
+
*/
|
|
58
|
+
export declare function legacyCwdPath(path: string): string;
|
|
59
|
+
//# sourceMappingURL=log-path-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log-path-utils.d.ts","sourceRoot":"","sources":["../../src/core/log-path-utils.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,wBAAwB;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,0CAA0C;IAC1C,UAAU,CAAC,EAAE,OAAO,GAAG,KAAK,GAAG,UAAU,CAAC;IAC1C,mEAAmE;IACnE,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,aAAa,CAAC;AAE7C;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,GAAG,IAAI,CA0BhD;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAMzE;AAYD;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,OAAO,EAChB,kBAAkB,CAAC,EAAE,MAAM,GAC1B,MAAM,CAkER;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,CAKzD;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,CAKvD;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,aAAa,CAM3E;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAElD"}
|
package/dist/core/types.d.ts
CHANGED
|
@@ -323,7 +323,7 @@ export interface ParseResult<T = any> {
|
|
|
323
323
|
/** Whether the process should exit (for help, version, etc.) */
|
|
324
324
|
shouldExit?: boolean;
|
|
325
325
|
/** Type of result for better handling */
|
|
326
|
-
type?:
|
|
326
|
+
type?: "success" | "error" | "help" | "version" | "debug";
|
|
327
327
|
}
|
|
328
328
|
/**
|
|
329
329
|
* Configuration options for ArgParser behavior
|