@gunshi/docs 0.27.3 → 0.27.5

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/bin/init.js CHANGED
@@ -39,25 +39,18 @@ When creating command-line interfaces, use the \`${SKILL_NAME}\` skill.
39
39
 
40
40
  const cwd = process.cwd()
41
41
  const CLAUDE_SKILL_PATH = path.join(cwd, `.claude/skills/${SKILL_NAME}/SKILL.md`)
42
- const CURSOR_RULES_PATH = path.join(cwd, `.cursor/rules/${SKILL_NAME}.mdc`)
43
42
  const CLAUDE_MD_FILEPATH = path.join(cwd, 'CLAUDE.md')
44
43
 
45
- const [hasClaudeCode, hasCursor, hasCursorCli] = await Promise.all(
46
- ['claude', 'cursor', 'cursor-agent'].map(cmd =>
47
- x('which', [cmd], { throwOnError: false })
48
- .then(({ stdout }) => stdout.trim().length > 0)
49
- .catch(() => false)
50
- )
51
- )
52
-
53
- const hasCursorEditors = hasCursor || hasCursorCli
44
+ const hasClaudeCode = await x('which', ['claude'], { throwOnError: false })
45
+ .then(({ stdout }) => stdout.trim().length > 0)
46
+ .catch(() => false)
54
47
 
55
48
  // Helper function to check if CLAUDE.md already contains Gunshi instructions
56
49
  async function hasGunshiInstruction(filePath) {
57
50
  try {
58
51
  const content = await fs.readFile(filePath, 'utf8')
59
52
  // Check for various patterns that indicate Gunshi is already mentioned
60
- const gunshiPatterns = [/\bgunshi\b/i, /\@gunshi\//i, /@kazupon\/gunshi/i]
53
+ const gunshiPatterns = [/\bgunshi\b/i, /@gunshi\//i, /@kazupon\/gunshi/i]
61
54
  return gunshiPatterns.some(pattern => pattern.test(content))
62
55
  } catch {
63
56
  return false
@@ -74,9 +67,7 @@ async function fileExists(filePath) {
74
67
  }
75
68
  }
76
69
 
77
- const isWindows = process.platform === 'win32'
78
-
79
- // Claude Code setup (always create as the master file):
70
+ // Claude Code setup:
80
71
  // - Create skill file at .claude/skills/use-gunshi-cli/SKILL.md
81
72
  // - Update or create CLAUDE.md with instruction to use the skill
82
73
  // (skip if Gunshi is already mentioned to avoid duplication)
@@ -105,26 +96,6 @@ if (hasClaudeCode) {
105
96
  }
106
97
  }
107
98
 
108
- // Cursor setup:
109
- // - On Linux/macOS: create symlink to Claude skill file
110
- // - On Windows: copy the file (symlinks require admin privileges)
111
- if (hasCursorEditors) {
112
- await x('mkdir', ['-p', path.dirname(CURSOR_RULES_PATH)])
113
-
114
- if (isWindows) {
115
- // On Windows, just copy the file (symlinks require admin privileges)
116
- await fs.writeFile(CURSOR_RULES_PATH, SKILL_CONTENT, 'utf8')
117
- console.log(`Created Cursor rule at ${CURSOR_RULES_PATH}`)
118
- } else {
119
- // Create relative symlink from Cursor rules to Claude skill
120
- const relativeTarget = path.relative(path.dirname(CURSOR_RULES_PATH), CLAUDE_SKILL_PATH)
121
- // Remove existing file/symlink if it exists
122
- await fs.rm(CURSOR_RULES_PATH, { force: true })
123
- await fs.symlink(relativeTarget, CURSOR_RULES_PATH)
124
- console.log(`Created Cursor rule symlink at ${CURSOR_RULES_PATH} -> ${relativeTarget}`)
125
- }
126
- }
127
-
128
99
  // Ask user if they want to install gunshi and @gunshi/docs
129
100
  const rl = readline.createInterface({
130
101
  input: process.stdin,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gunshi/docs",
3
3
  "description": "Documentation for gunshi",
4
- "version": "0.27.3",
4
+ "version": "0.27.5",
5
5
  "author": {
6
6
  "name": "kazuya kawaguchi",
7
7
  "email": "kawakazu80@gmail.com"
@@ -23,7 +23,7 @@ A [CLI options](../interfaces/CliOptions.md)
23
23
  ## Call Signature
24
24
 
25
25
  ```ts
26
- function cli(
26
+ function cli<G>(
27
27
  args,
28
28
  entry,
29
29
  options?): Promise<string | undefined>;
@@ -31,16 +31,19 @@ options?): Promise<string | undefined>;
31
31
 
32
32
  Run the command.
33
33
 
34
- This overload accepts any command-like object using a loose structural type.
35
- It bypasses TypeScript contravariance issues with callback properties.
34
+ ### Type Parameters
35
+
36
+ | Type Parameter | Description |
37
+ | ------ | ------ |
38
+ | `G` *extends* [`GunshiParamsConstraint`](../type-aliases/GunshiParamsConstraint.md) | A type extending [`GunshiParams`](../interfaces/GunshiParams.md) to specify the shape of command and cli options. |
36
39
 
37
40
  ### Parameters
38
41
 
39
42
  | Parameter | Type | Description |
40
43
  | ------ | ------ | ------ |
41
44
  | `args` | `string`[] | Command line arguments |
42
- | `entry` | [`SubCommandable`](../interfaces/SubCommandable.md) | A command-like object (command, command runner, or lazy command) |
43
- | `options?` | [`CliOptions`](../interfaces/CliOptions.md)\<[`DefaultGunshiParams`](../type-aliases/DefaultGunshiParams.md)\> | A [CLI options](../interfaces/CliOptions.md) |
45
+ | `entry` | \| [`Command`](../interfaces/Command.md)\<`G`\> \| [`CommandRunner`](../type-aliases/CommandRunner.md)\<`G`\> \| [`LazyCommand`](../type-aliases/LazyCommand.md)\<`G`\> | A [entry command](../interfaces/Command.md), an [inline command runner](../type-aliases/CommandRunner.md), or a [lazily-loaded command](../type-aliases/LazyCommand.md) |
46
+ | `options?` | [`CliOptions`](../interfaces/CliOptions.md)\<`G`\> | A [CLI options](../interfaces/CliOptions.md) |
44
47
 
45
48
  ### Returns
46
49
 
@@ -51,7 +54,7 @@ A rendered usage or undefined. if you will use [`CliOptions.usageSilent`](../int
51
54
  ## Call Signature
52
55
 
53
56
  ```ts
54
- function cli<G>(
57
+ function cli<A, G>(
55
58
  args,
56
59
  entry,
57
60
  options?): Promise<string | undefined>;
@@ -61,9 +64,10 @@ Run the command.
61
64
 
62
65
  ### Type Parameters
63
66
 
64
- | Type Parameter | Description |
65
- | ------ | ------ |
66
- | `G` *extends* [`GunshiParamsConstraint`](../type-aliases/GunshiParamsConstraint.md) | A type extending [`GunshiParams`](../interfaces/GunshiParams.md) to specify the shape of command and cli options. |
67
+ | Type Parameter | Default type | Description |
68
+ | ------ | ------ | ------ |
69
+ | `A` *extends* [`Args`](../interfaces/Args.md) | [`Args`](../interfaces/Args.md) | The type of [`arguments`](../interfaces/Args.md) defined in the command and cli options. |
70
+ | `G` *extends* [`GunshiParams`](../interfaces/GunshiParams.md)\<\{ `args`: [`Args`](../interfaces/Args.md); `extensions`: \{ \}; \}\> | `object` | - |
67
71
 
68
72
  ### Parameters
69
73
 
@@ -82,7 +86,7 @@ A rendered usage or undefined. if you will use [`CliOptions.usageSilent`](../int
82
86
  ## Call Signature
83
87
 
84
88
  ```ts
85
- function cli<A, G>(
89
+ function cli<E, G>(
86
90
  args,
87
91
  entry,
88
92
  options?): Promise<string | undefined>;
@@ -94,7 +98,7 @@ Run the command.
94
98
 
95
99
  | Type Parameter | Default type | Description |
96
100
  | ------ | ------ | ------ |
97
- | `A` *extends* [`Args`](../interfaces/Args.md) | [`Args`](../interfaces/Args.md) | The type of [`arguments`](../interfaces/Args.md) defined in the command and cli options. |
101
+ | `E` *extends* [`ExtendContext`](../type-aliases/ExtendContext.md) | [`ExtendContext`](../type-aliases/ExtendContext.md) | An [`ExtendContext`](../type-aliases/ExtendContext.md) type to specify the shape of command and cli options. |
98
102
  | `G` *extends* [`GunshiParams`](../interfaces/GunshiParams.md)\<\{ `args`: [`Args`](../interfaces/Args.md); `extensions`: \{ \}; \}\> | `object` | - |
99
103
 
100
104
  ### Parameters
@@ -114,7 +118,7 @@ A rendered usage or undefined. if you will use [`CliOptions.usageSilent`](../int
114
118
  ## Call Signature
115
119
 
116
120
  ```ts
117
- function cli<E, G>(
121
+ function cli<G>(
118
122
  args,
119
123
  entry,
120
124
  options?): Promise<string | undefined>;
@@ -126,8 +130,7 @@ Run the command.
126
130
 
127
131
  | Type Parameter | Default type | Description |
128
132
  | ------ | ------ | ------ |
129
- | `E` *extends* [`ExtendContext`](../type-aliases/ExtendContext.md) | [`ExtendContext`](../type-aliases/ExtendContext.md) | An [`ExtendContext`](../type-aliases/ExtendContext.md) type to specify the shape of command and cli options. |
130
- | `G` *extends* [`GunshiParams`](../interfaces/GunshiParams.md)\<\{ `args`: [`Args`](../interfaces/Args.md); `extensions`: \{ \}; \}\> | `object` | - |
133
+ | `G` *extends* [`GunshiParams`](../interfaces/GunshiParams.md)\<\{ `args`: [`Args`](../interfaces/Args.md); `extensions`: \{ \}; \}\> | [`DefaultGunshiParams`](../type-aliases/DefaultGunshiParams.md) | A type extending [`GunshiParams`](../interfaces/GunshiParams.md) to specify the shape of command and cli options. |
131
134
 
132
135
  ### Parameters
133
136
 
@@ -146,7 +149,7 @@ A rendered usage or undefined. if you will use [`CliOptions.usageSilent`](../int
146
149
  ## Call Signature
147
150
 
148
151
  ```ts
149
- function cli<G>(
152
+ function cli(
150
153
  args,
151
154
  entry,
152
155
  options?): Promise<string | undefined>;
@@ -154,19 +157,21 @@ options?): Promise<string | undefined>;
154
157
 
155
158
  Run the command.
156
159
 
157
- ### Type Parameters
160
+ This overload accepts any command-like object using a loose structural type.
161
+ It bypasses TypeScript contravariance issues with callback properties.
158
162
 
159
- | Type Parameter | Default type | Description |
160
- | ------ | ------ | ------ |
161
- | `G` *extends* [`GunshiParams`](../interfaces/GunshiParams.md)\<\{ `args`: [`Args`](../interfaces/Args.md); `extensions`: \{ \}; \}\> | [`DefaultGunshiParams`](../type-aliases/DefaultGunshiParams.md) | A type extending [`GunshiParams`](../interfaces/GunshiParams.md) to specify the shape of command and cli options. |
163
+ Note: This overload MUST be last in the overload list. TypeScript checks overloads
164
+ in declaration order and selects the first matching one. The SubCommandable type
165
+ is intentionally loose and would match any command, so placing it first would
166
+ prevent proper type inference for more specific command types.
162
167
 
163
168
  ### Parameters
164
169
 
165
170
  | Parameter | Type | Description |
166
171
  | ------ | ------ | ------ |
167
172
  | `args` | `string`[] | Command line arguments |
168
- | `entry` | \| [`Command`](../interfaces/Command.md)\<`G`\> \| [`CommandRunner`](../type-aliases/CommandRunner.md)\<`G`\> \| [`LazyCommand`](../type-aliases/LazyCommand.md)\<`G`\> | A [entry command](../interfaces/Command.md), an [inline command runner](../type-aliases/CommandRunner.md), or a [lazily-loaded command](../type-aliases/LazyCommand.md) |
169
- | `options?` | [`CliOptions`](../interfaces/CliOptions.md)\<`G`\> | A [CLI options](../interfaces/CliOptions.md) |
173
+ | `entry` | [`SubCommandable`](../interfaces/SubCommandable.md) | A command-like object (command, command runner, or lazy command) |
174
+ | `options?` | [`CliOptions`](../interfaces/CliOptions.md)\<[`DefaultGunshiParams`](../type-aliases/DefaultGunshiParams.md)\> | A [CLI options](../interfaces/CliOptions.md) |
170
175
 
171
176
  ### Returns
172
177
 
@@ -23,13 +23,13 @@ Index signature to allow additional properties
23
23
 
24
24
  | Property | Type | Description |
25
25
  | ------ | ------ | ------ |
26
- | <a id="args"></a> `args?` | [`Args`](Args.md) \| `Record`\<`string`, `any`\> | Command arguments - accepts any args structure |
27
- | <a id="commandname"></a> `commandName?` | `string` | Command name for lazy commands |
28
- | <a id="description"></a> `description?` | `string` | Command description |
29
- | <a id="entry"></a> `entry?` | `boolean` | Whether this is an entry command |
30
- | <a id="examples"></a> `examples?` | `string` \| (...`args`) => `any` | Command examples |
31
- | <a id="internal"></a> `internal?` | `boolean` | Whether this is an internal command |
32
- | <a id="name"></a> `name?` | `string` | Command name |
33
- | <a id="rendering"></a> `rendering?` | `any` | Rendering options |
34
- | <a id="run"></a> `run?` | (...`args`) => `any` | Command runner |
35
- | <a id="tokebab"></a> `toKebab?` | `boolean` | Whether to convert camelCase to kebab-case |
26
+ | <a id="args"></a> `args?` | [`Args`](Args.md) \| `Record`\<`string`, `any`\> | see [Command.args](Command.md#args) |
27
+ | <a id="commandname"></a> `commandName?` | `string` | see LazyCommand.commandName |
28
+ | <a id="description"></a> `description?` | `string` | see [Command.description](Command.md#description) |
29
+ | <a id="entry"></a> `entry?` | `boolean` | see [Command.entry](Command.md#entry) |
30
+ | <a id="examples"></a> `examples?` | `string` \| (...`args`) => `any` | see [Command.examples](Command.md#examples) |
31
+ | <a id="internal"></a> `internal?` | `boolean` | see [Command.internal](Command.md#internal) |
32
+ | <a id="name"></a> `name?` | `string` | see [Command.name](Command.md#name) |
33
+ | <a id="rendering"></a> `rendering?` | `any` | see [Command.rendering](Command.md#rendering) |
34
+ | <a id="run"></a> `run?` | (...`args`) => `any` | see [Command.run](Command.md#run) |
35
+ | <a id="tokebab"></a> `toKebab?` | `boolean` | see [Command.toKebab](Command.md#tokebab) |
@@ -33,7 +33,7 @@ bun add gunshi
33
33
 
34
34
  ## LLM-Assisted Development
35
35
 
36
- Gunshi provides tooling to integrate with AI coding assistants such as [Claude Code](https://claude.ai/code) and [Cursor](https://cursor.com/).
36
+ Gunshi provides tooling to integrate with AI coding assistants such as [Claude Code](https://claude.ai/code).
37
37
 
38
38
  ### Automatic Setup (Recommended)
39
39
 
@@ -59,10 +59,7 @@ bun x @gunshi/docs
59
59
 
60
60
  :::
61
61
 
62
- This command automatically configures:
63
-
64
- - [Claude Code skills](https://docs.anthropic.com/en/docs/claude-code/skills) for Claude Code
65
- - [Cursor rules](https://docs.cursor.com/context/rules-for-ai) for Cursor
62
+ This command automatically configures [Claude Code skills](https://docs.anthropic.com/en/docs/claude-code/skills) for Claude Code.
66
63
 
67
64
  ### Manual Setup
68
65
 
@@ -90,7 +87,7 @@ bun add -D @gunshi/docs
90
87
 
91
88
  This package includes guide content and API references as markdown files in [llms.txt](https://llmstxt.org/) format.
92
89
 
93
- Then add the following to your AI agent's configuration file (e.g., `CLAUDE.md` and `.cursor/rules/use-gunshi-cli.md`):
90
+ Then add the following to your AI agent's configuration file (e.g., `CLAUDE.md`):
94
91
 
95
92
  ```md
96
93
  # CLI Development with Gunshi
@@ -182,7 +182,7 @@ Use cases:
182
182
 
183
183
  ### `@gunshi/docs` - LLM-Assisted Development (Experimental)
184
184
 
185
- New package for integrating with AI coding assistants such as [Claude Code](https://claude.ai/code) and [Cursor](https://cursor.com/):
185
+ New package for integrating with AI coding assistants such as [Claude Code](https://claude.ai/code):
186
186
 
187
187
  ```sh
188
188
  npx @gunshi/docs
@@ -191,7 +191,6 @@ npx @gunshi/docs
191
191
  This command automatically configures:
192
192
 
193
193
  - [Claude Code skills](https://docs.anthropic.com/en/docs/claude-code/skills) at `.claude/skills/use-gunshi-cli/SKILL.md`
194
- - [Cursor rules](https://docs.cursor.com/context/rules-for-ai) at `.cursor/rules/use-gunshi-cli.mdc`
195
194
  - Updates `CLAUDE.md` with instructions to use the Gunshi skill
196
195
 
197
196
  Optionally, it can also install `gunshi` and `@gunshi/docs` packages for you.