gunshi 0.35.3 → 0.37.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 +9 -8
- package/lib/agent.js +5 -6
- package/lib/{cli-DnXk5aCq.js → cli-C4_IDXMQ.js} +1 -1
- package/lib/generator.js +1 -1
- package/lib/index.js +2 -2
- package/lib/renderer.js +1 -1
- package/lib/{src-DbfZvEe0.js → src-DIz-QFuo.js} +2 -3
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ Gunshi is a modern javascript command-line library
|
|
|
17
17
|
|
|
18
18
|
<!-- eslint-enable markdown/no-missing-label-refs -->
|
|
19
19
|
|
|
20
|
-
##
|
|
20
|
+
## Features
|
|
21
21
|
|
|
22
22
|
Gunshi is designed to simplify the creation of modern command-line interfaces:
|
|
23
23
|
|
|
@@ -26,9 +26,10 @@ Gunshi is designed to simplify the creation of modern command-line interfaces:
|
|
|
26
26
|
- 🧩 **Composable & Lazy**: Create modular sub-commands with context sharing and lazy loading for better performance.
|
|
27
27
|
- 🎨 **Flexible Rendering**: Customize usage generation, validation errors, and help messages with pluggable renderers.
|
|
28
28
|
- 🌍 **Internationalization**: Built with global users in mind, featuring locale-aware design, resource management, and multi-language support.
|
|
29
|
+
- 🤖 **Agent-aware**: Detect AI coding-agent environments through the stable [`gunshi/agent`](https://gunshi.dev/guide/advanced/ai-agent-detection) utility without changing CLI behavior automatically.
|
|
29
30
|
- 🔌 **Pluggable**: Extensible plugin system with dependency management and lifecycle hooks for modular CLI development.
|
|
30
31
|
|
|
31
|
-
##
|
|
32
|
+
## Installation
|
|
32
33
|
|
|
33
34
|
```sh
|
|
34
35
|
# npm
|
|
@@ -47,7 +48,7 @@ deno add jsr:@gunshi/gunshi
|
|
|
47
48
|
bun add gunshi
|
|
48
49
|
```
|
|
49
50
|
|
|
50
|
-
##
|
|
51
|
+
## Usage
|
|
51
52
|
|
|
52
53
|
```js
|
|
53
54
|
import { cli } from 'gunshi'
|
|
@@ -94,7 +95,7 @@ await cli(process.argv.slice(2), command, {
|
|
|
94
95
|
|
|
95
96
|
About more details and usage, see [documentations](https://gunshi.dev)
|
|
96
97
|
|
|
97
|
-
##
|
|
98
|
+
## Showcases
|
|
98
99
|
|
|
99
100
|
- [pnpmc](https://github.com/kazupon/pnpmc): PNPM Catalogs Tooling
|
|
100
101
|
- [sourcemap-publisher](https://github.com/es-tooling/sourcemap-publisher): A tool to publish sourcemaps externally and rewrite sourcemap URLs at pre-publish time
|
|
@@ -103,11 +104,11 @@ About more details and usage, see [documentations](https://gunshi.dev)
|
|
|
103
104
|
- [ccusage](https://github.com/ryoppippi/ccusage): A CLI tool for analyzing Claude Code usage from local JSONL files
|
|
104
105
|
- [varlock](https://github.com/dmno-dev/varlock): Enhanced .env file loader, using @decorator style comments to add validation, type-safety, and more
|
|
105
106
|
|
|
106
|
-
##
|
|
107
|
+
## Contributing guidelines
|
|
107
108
|
|
|
108
109
|
If you are interested in contributing to `gunshi`, I highly recommend checking out [the contributing guidelines](/CONTRIBUTING.md) here. You'll find all the relevant information such as [how to make a PR](/CONTRIBUTING.md#pull-request-guidelines), [how to setup development](/CONTRIBUTING.md#development-setup)) etc., there.
|
|
109
110
|
|
|
110
|
-
##
|
|
111
|
+
## Credits
|
|
111
112
|
|
|
112
113
|
This project is inspired and powered by:
|
|
113
114
|
|
|
@@ -117,7 +118,7 @@ This project is inspired and powered by:
|
|
|
117
118
|
|
|
118
119
|
Thank you!
|
|
119
120
|
|
|
120
|
-
##
|
|
121
|
+
## Sponsors
|
|
121
122
|
|
|
122
123
|
The development of Gunshi is supported by my OSS sponsors!
|
|
123
124
|
|
|
@@ -127,7 +128,7 @@ The development of Gunshi is supported by my OSS sponsors!
|
|
|
127
128
|
</a>
|
|
128
129
|
</p>
|
|
129
130
|
|
|
130
|
-
##
|
|
131
|
+
## License
|
|
131
132
|
|
|
132
133
|
[MIT](http://opensource.org/licenses/MIT)
|
|
133
134
|
|
package/lib/agent.js
CHANGED
|
@@ -177,18 +177,17 @@ I()?.name;
|
|
|
177
177
|
//#endregion
|
|
178
178
|
//#region src/agent.ts
|
|
179
179
|
/**
|
|
180
|
-
* The entry point for AI agent detection
|
|
180
|
+
* The entry point for AI agent detection utilities.
|
|
181
|
+
*
|
|
182
|
+
* Detection is delegated to {@link https://github.com/unjs/std-env | std-env}.
|
|
183
|
+
* The `gunshi/agent` API exposes a stable, minimal profile while the recognized
|
|
184
|
+
* agent names and detection rules may evolve with the upstream detector.
|
|
181
185
|
*
|
|
182
186
|
* @example
|
|
183
187
|
* ```js
|
|
184
188
|
* import { getAgentProfile } from 'gunshi/agent'
|
|
185
189
|
* ```
|
|
186
190
|
*
|
|
187
|
-
* @experimental
|
|
188
|
-
* The `gunshi/agent` entry point is experimental. The agent detection rules
|
|
189
|
-
* are delegated to {@link https://github.com/unjs/std-env | std-env} and may
|
|
190
|
-
* change as the upstream detector list evolves.
|
|
191
|
-
*
|
|
192
191
|
* @author kazuya kawaguchi (a.k.a. kazupon)
|
|
193
192
|
* @license MIT
|
|
194
193
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as hasPriorityValidationError } from "./error-xSnOOdnr.js";
|
|
2
2
|
import { t as plugin } from "./plugin-DhJZVIbl.js";
|
|
3
|
-
import { a as namespacedId, o as COMMON_ARGS, t as renderer } from "./src-
|
|
3
|
+
import { a as namespacedId, o as COMMON_ARGS, t as renderer } from "./src-DIz-QFuo.js";
|
|
4
4
|
import { t as cliCore } from "./core-CbE1I4Jl.js";
|
|
5
5
|
//#region ../plugin-global/src/types.ts
|
|
6
6
|
/**
|
package/lib/generator.js
CHANGED
package/lib/index.js
CHANGED
|
@@ -2,8 +2,8 @@ import { n as ANONYMOUS_COMMAND_NAME, t as createCommandContext } from "./contex
|
|
|
2
2
|
import { a as parseArgs, i as resolveArgs, n as ArgsValidationErrorKeys, r as isArgsValidationError, t as ArgsValidationError } from "./resolver-UFOtObbe.js";
|
|
3
3
|
import { i as isCommandNotFoundError, n as CommandNotFoundErrorKeys, r as hasPriorityValidationError, t as CommandNotFoundError } from "./error-xSnOOdnr.js";
|
|
4
4
|
import { t as plugin } from "./plugin-DhJZVIbl.js";
|
|
5
|
-
import { a as namespacedId } from "./src-
|
|
6
|
-
import { t as cli } from "./cli-
|
|
5
|
+
import { a as namespacedId } from "./src-DIz-QFuo.js";
|
|
6
|
+
import { t as cli } from "./cli-C4_IDXMQ.js";
|
|
7
7
|
import { define, defineWithTypes, lazy, lazyWithTypes } from "./definition.js";
|
|
8
8
|
//#region ../plugin-i18n/src/translation.ts
|
|
9
9
|
/**
|
package/lib/renderer.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as renderHeader, n as renderValidationErrors, r as renderUsage } from "./src-
|
|
1
|
+
import { i as renderHeader, n as renderValidationErrors, r as renderUsage } from "./src-DIz-QFuo.js";
|
|
2
2
|
//#region src/renderer.ts
|
|
3
3
|
/**
|
|
4
4
|
* @author kazuya kawaguchi (a.k.a. kazupon)
|
|
@@ -29,7 +29,6 @@ const COMMON_ARGS = {
|
|
|
29
29
|
};
|
|
30
30
|
//#endregion
|
|
31
31
|
//#region ../resources/locales/en-US.json
|
|
32
|
-
var NEGATABLE = "Negatable of";
|
|
33
32
|
var en_US_default = {
|
|
34
33
|
COMMAND: "COMMAND",
|
|
35
34
|
COMMANDS: "COMMANDS",
|
|
@@ -39,7 +38,7 @@ var en_US_default = {
|
|
|
39
38
|
OPTIONS: "OPTIONS",
|
|
40
39
|
EXAMPLES: "EXAMPLES",
|
|
41
40
|
FORMORE: "For more info, run any command with the `--help` flag",
|
|
42
|
-
NEGATABLE,
|
|
41
|
+
NEGATABLE: "Negatable of",
|
|
43
42
|
DEFAULT: "default",
|
|
44
43
|
CHOICES: "choices",
|
|
45
44
|
help: "Display this help message",
|
|
@@ -172,7 +171,7 @@ function localizable(ctx, cmd, translate) {
|
|
|
172
171
|
}
|
|
173
172
|
const schema = ctx.args[argKey];
|
|
174
173
|
if (!schema) return argKey;
|
|
175
|
-
return negatable && schema.type === "boolean" && schema.negatable ? `${NEGATABLE} ${makeShortLongOptionPair(schema, argKey, ctx.toKebab)}` : schema.description || "";
|
|
174
|
+
return negatable && schema.type === "boolean" && schema.negatable ? `${en_US_default["NEGATABLE"]} ${makeShortLongOptionPair(schema, argKey, ctx.toKebab)}` : schema.description || "";
|
|
176
175
|
}
|
|
177
176
|
if (key === resolveKey("description", ctx.name)) return "";
|
|
178
177
|
else if (key === resolveKey("examples", ctx.name)) return await resolveExamples$1(ctx, cmd.examples);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gunshi",
|
|
3
3
|
"description": "Modern javascript command-line library",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.37.0",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "kazuya kawaguchi",
|
|
7
7
|
"email": "kawakazu80@gmail.com"
|
|
@@ -116,11 +116,11 @@
|
|
|
116
116
|
"std-env": "^4.1.0",
|
|
117
117
|
"tsdown": "0.21.0",
|
|
118
118
|
"zod": "^4.4.3",
|
|
119
|
-
"@gunshi/plugin-global": "0.
|
|
120
|
-
"@gunshi/resources": "0.
|
|
121
|
-
"@gunshi/plugin-i18n": "0.
|
|
122
|
-
"@gunshi/plugin-renderer": "0.
|
|
123
|
-
"@gunshi/shared": "0.
|
|
119
|
+
"@gunshi/plugin-global": "0.37.0",
|
|
120
|
+
"@gunshi/resources": "0.37.0",
|
|
121
|
+
"@gunshi/plugin-i18n": "0.37.0",
|
|
122
|
+
"@gunshi/plugin-renderer": "0.37.0",
|
|
123
|
+
"@gunshi/shared": "0.37.0"
|
|
124
124
|
},
|
|
125
125
|
"scripts": {
|
|
126
126
|
"build": "tsdown",
|