Skip to content

feat: completion plugin - #219

Merged
kazupon merged 22 commits into
mainfrom
feat/completion
Jul 15, 2025
Merged

kazupon merged 22 commits into
mainfrom
feat/completion

Conversation

@kazupon

@kazupon kazupon commented Jul 7, 2025

Copy link
Copy Markdown
Owner

Description

Linked Issues

Additional context

Summary by CodeRabbit

  • New Features

    • Introduced a comprehensive CLI completion plugin with dynamic suggestion support for commands, options, and arguments.
    • Added an example script demonstrating CLI completion capabilities.
    • Provided a new utility for quoting CLI execution commands based on runtime.
    • Added a new build script for the completion plugin.
  • Improvements

    • Enhanced localization support with a new localizable utility and improved type safety for translation functions.
    • Streamlined renderer and i18n plugin integration for localization.
    • Updated CLI core logic to better handle entry commands and options.
    • Refined command context and plugin exports for improved extensibility.
  • Bug Fixes

    • Adjusted publishing and linting configurations to exclude example files and directories.
  • Tests

    • Added extensive tests for CLI completion and localization features.
  • Chores

    • Updated dependencies and build scripts.
    • Improved TypeScript and build tool configurations for new features.
    • Updated workspace and lint ignore settings for example files.

@coderabbitai

coderabbitai Bot commented Jul 7, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

This update introduces a comprehensive CLI completion plugin with configuration and runtime support, adds localization utilities and tests, and refactors core CLI logic to unify entry command handling and option defaults. It includes new example and test files, updates TypeScript types, adds exports, and adjusts build and configuration files for improved extensibility and integration.

Changes

File(s) Change Summary
eslint.config.ts, packages/shared/jsr.json, knip.config.ts Added ignore/exclude patterns for examples/** in ESLint, JSR publish config, and knip workspace config
package.json, tsconfig.json Added build script for plugin-completion; introduced path aliases for plugin-completion and new dependency paths
packages/gunshi/src/constants.ts, .../context.ts, .../core.ts, .../plugin.ts Renamed COMMAND_OPTIONS_DEFAULT to CLI_OPTIONS_DEFAULT; updated imports/exports and unified entry command logic
packages/gunshi/src/cli.test.ts Updated CLI usage test to include CLI name and disable header rendering in metadata
packages/gunshi/src/types.ts Added optional entry?: boolean property to Command interface
packages/gunshi/src/definition.ts, .../utils.ts, .../core.ts Propagated and handled entry property for commands and lazy commands
packages/plugin-completion/package.json, .../tsdown.config.ts Added runtime and dev dependencies, import map for Deno, and build config for plugin-completion
packages/plugin-completion/examples/demo.node.ts Added new CLI example demonstrating completion plugin usage
packages/plugin-completion/src/index.ts, .../types.ts, .../utils.ts Implemented completion plugin with extension support, configuration types, runtime detection, and quoting utility
packages/plugin-completion/src/index.test.ts Added test suite covering CLI completion plugin scenarios
packages/plugin-global/src/decorator.ts Corrected import alias for plugin ID from I18n to Global
packages/plugin-i18n/src/types.ts Refactored translation typing and consolidated imports
packages/plugin-renderer/src/index.ts, .../usage.ts, .../types.ts Replaced local localization logic with shared localizable utility; updated usage rendering
packages/shared/src/index.ts, .../localize.ts, .../localize.test.ts, .../types.ts, .../utils.ts Added and tested localization utilities; exported new helpers; added makeShortLongOptionPair function
scripts/jsr.ts Updated dependency assignment logic to include @gunshi/shared for plugin-completion

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CLI (Gunshi)
    participant CompletionPlugin
    participant Shell

    User->>CLI (Gunshi): Run CLI with completion command
    CLI (Gunshi)->>CompletionPlugin: Register completion extension
    CompletionPlugin->>CLI (Gunshi): Add root and subcommands for completion
    User->>Shell: Request completion (e.g., TAB)
    Shell->>CLI (Gunshi): Invoke completion command
    CLI (Gunshi)->>CompletionPlugin: Generate suggestions
    CompletionPlugin-->>Shell: Return completion suggestions
Loading

Possibly related PRs

  • kazupon/gunshi#116: Refactored lazy command handling and entry command logic in CLI core and tests, which directly relates to the changes in command entry detection and lazy command support in this PR.
  • kazupon/gunshi#177: Extensive refactoring of CLI and plugin typings and normalization of CLI options, related to improvements in this PR.

Poem

🐇
A hop, a skip, some code anew—
Now CLI completes for you!
With localize and entry clear,
Commands and help are crystal here.
From plugins, tests, and docs that grow,
The rabbit’s joy is sure to show!
— Happy coding, let completions flow!


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b359fc6 and 55e5a98.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (3)
  • packages/plugin-completion/package.json (1 hunks)
  • packages/plugin-completion/src/utils.ts (1 hunks)
  • tsconfig.json (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • tsconfig.json
  • packages/plugin-completion/package.json
  • packages/plugin-completion/src/utils.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Cloudflare Pages
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@kazupon kazupon changed the title Feat/completion feat: completion plugin Jul 7, 2025
@kazupon kazupon added the feature Includes new features label Jul 7, 2025
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 7, 2025

Copy link
Copy Markdown

Deploying gunshi with  Cloudflare Pages  Cloudflare Pages

Latest commit: 55e5a98
Status: ✅  Deploy successful!
Preview URL: https://34af5670.gunshi.pages.dev
Branch Preview URL: https://feat-completion.gunshi.pages.dev

View logs

@pkg-pr-new

pkg-pr-new Bot commented Jul 7, 2025

Copy link
Copy Markdown

Open in StackBlitz

@gunshi/bone

npm i https://pkg.pr.new/@gunshi/bone@219

@gunshi/definition

npm i https://pkg.pr.new/@gunshi/definition@219

gunshi

npm i https://pkg.pr.new/gunshi@219

@gunshi/plugin

npm i https://pkg.pr.new/@gunshi/plugin@219

@gunshi/plugin-completion

npm i https://pkg.pr.new/@gunshi/plugin-completion@219

@gunshi/plugin-dryrun

npm i https://pkg.pr.new/@gunshi/plugin-dryrun@219

@gunshi/plugin-global

npm i https://pkg.pr.new/@gunshi/plugin-global@219

@gunshi/plugin-i18n

npm i https://pkg.pr.new/@gunshi/plugin-i18n@219

@gunshi/plugin-renderer

npm i https://pkg.pr.new/@gunshi/plugin-renderer@219

@gunshi/resources

npm i https://pkg.pr.new/@gunshi/resources@219

@gunshi/shared

npm i https://pkg.pr.new/@gunshi/shared@219

commit: 55e5a98

@kazupon
kazupon marked this pull request as ready for review July 10, 2025 14:50

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

🧹 Nitpick comments (4)
packages/plugin-global/src/decorator.ts (1)

24-26: Computed-property destructuring looks correct but double-check runtime key

The computed property [Global] correctly matches the plugin-id constant, so type safety is preserved. Just make sure pluginId is a const string literal (or unique symbol) and not a runtime generated value; otherwise destructuring will fail if the value differs at runtime.

If pluginId is dynamic, switch to safe access (extensions?.[Global]) or add an early guard.

packages/plugin-completion/src/utils.ts (1)

6-25: Remove commented out code

The extensive commented out code should be removed to improve code cleanliness. If this code might be needed in the future, consider creating a separate issue to track it.

-// NOTE(kazupon): comment out, because it is not used yet.
-// import { CLI_OPTIONS_DEFAULT, createCommandContext as _createCommandContext } from '@gunshi/plugin'
-//
-// import type { Args, Command, CommandContext, LazyCommand } from '@gunshi/plugin'
-//
-// async function createCommandContext(cmd: Command | LazyCommand): Promise<CommandContext> {
-//   return await _createCommandContext({
-//     args: cmd.args || (Object.create(null) as Args),
-//     values: Object.create(null),
-//     positionals: [],
-//     rest: [],
-//     argv: [],
-//     tokens: [],
-//     omitted: false,
-//     callMode: cmd.entry ? 'entry' : 'subCommand',
-//     command: cmd,
-//     extensions: Object.create(null),
-//     cliOptions: CLI_OPTIONS_DEFAULT
-//   })
-// }
packages/plugin-completion/src/types.ts (1)

26-26: Replace empty interface with type alias

The empty interface should be replaced with a type alias as recommended by the static analysis tool.

-export interface CompletionCommandContext {}
+export type CompletionCommandContext = Record<string, never>
packages/plugin-completion/src/index.ts (1)

24-25: Consider cleaning up i18n-related commented code.

There are many TODO comments and commented-out code blocks related to i18n support. Consider either:

  1. Removing the commented code and keeping only the TODO comments
  2. Moving the commented code to a separate tracking issue

This would improve code readability while still tracking the future i18n work.

Also applies to: 40-41, 91-92, 101-107, 115-116, 131-132, 147-148, 156-158, 165-166, 181-182

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 91748d6 and 2aa2796.

⛔ Files ignored due to path filters (3)
  • packages/gunshi/src/__snapshots__/cli.test.ts.snap is excluded by !**/*.snap
  • packages/plugin-completion/src/__snapshots__/index.test.ts.snap is excluded by !**/*.snap
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (30)
  • eslint.config.ts (1 hunks)
  • package.json (1 hunks)
  • packages/gunshi/src/cli.test.ts (3 hunks)
  • packages/gunshi/src/cli/core.ts (5 hunks)
  • packages/gunshi/src/constants.ts (1 hunks)
  • packages/gunshi/src/context.ts (2 hunks)
  • packages/gunshi/src/definition.ts (1 hunks)
  • packages/gunshi/src/plugin.ts (1 hunks)
  • packages/gunshi/src/types.ts (1 hunks)
  • packages/gunshi/src/utils.ts (2 hunks)
  • packages/plugin-completion/examples/demo.node.ts (1 hunks)
  • packages/plugin-completion/package.json (1 hunks)
  • packages/plugin-completion/src/index.test.ts (1 hunks)
  • packages/plugin-completion/src/index.ts (1 hunks)
  • packages/plugin-completion/src/types.ts (1 hunks)
  • packages/plugin-completion/src/utils.ts (1 hunks)
  • packages/plugin-completion/tsdown.config.ts (1 hunks)
  • packages/plugin-global/src/decorator.ts (2 hunks)
  • packages/plugin-i18n/src/types.ts (2 hunks)
  • packages/plugin-renderer/src/index.ts (3 hunks)
  • packages/plugin-renderer/src/types.ts (2 hunks)
  • packages/plugin-renderer/src/usage.ts (1 hunks)
  • packages/shared/jsr.json (1 hunks)
  • packages/shared/src/index.ts (1 hunks)
  • packages/shared/src/localize.test.ts (1 hunks)
  • packages/shared/src/localize.ts (1 hunks)
  • packages/shared/src/types.ts (2 hunks)
  • packages/shared/src/utils.ts (2 hunks)
  • scripts/jsr.ts (2 hunks)
  • tsconfig.json (1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
`packages/gunshi/src/**/*.ts`: All source code is in TypeScript with strict mode...

packages/gunshi/src/**/*.ts: All source code is in TypeScript with strict mode enabled
Ensure changes work across Node.js, Deno, and Bun
Type safety is a core feature - maintain strict TypeScript types throughout

📄 Source: CodeRabbit Inference Engine (CLAUDE.md)

List of files the instruction was applied to:

  • packages/gunshi/src/context.ts
  • packages/gunshi/src/constants.ts
  • packages/gunshi/src/types.ts
  • packages/gunshi/src/definition.ts
  • packages/gunshi/src/plugin.ts
  • packages/gunshi/src/cli.test.ts
  • packages/gunshi/src/utils.ts
  • packages/gunshi/src/cli/core.ts
`**/*.{js,ts,tsx,mjs}`: Use ES modules throughout the codebase

**/*.{js,ts,tsx,mjs}: Use ES modules throughout the codebase

📄 Source: CodeRabbit Inference Engine (CLAUDE.md)

List of files the instruction was applied to:

  • packages/gunshi/src/context.ts
  • eslint.config.ts
  • packages/gunshi/src/constants.ts
  • packages/plugin-global/src/decorator.ts
  • packages/gunshi/src/types.ts
  • packages/plugin-renderer/src/usage.ts
  • packages/shared/src/index.ts
  • packages/gunshi/src/definition.ts
  • packages/plugin-completion/tsdown.config.ts
  • packages/gunshi/src/plugin.ts
  • packages/plugin-renderer/src/types.ts
  • scripts/jsr.ts
  • packages/shared/src/types.ts
  • packages/plugin-completion/src/utils.ts
  • packages/plugin-renderer/src/index.ts
  • packages/plugin-completion/src/index.test.ts
  • packages/shared/src/localize.test.ts
  • packages/gunshi/src/cli.test.ts
  • packages/shared/src/utils.ts
  • packages/gunshi/src/utils.ts
  • packages/plugin-completion/src/types.ts
  • packages/plugin-i18n/src/types.ts
  • packages/plugin-completion/examples/demo.node.ts
  • packages/shared/src/localize.ts
  • packages/plugin-completion/src/index.ts
  • packages/gunshi/src/cli/core.ts
`**/*.{js,ts,tsx}`: Follow existing code style (enforced by ESLint and Prettier)

**/*.{js,ts,tsx}: Follow existing code style (enforced by ESLint and Prettier)

📄 Source: CodeRabbit Inference Engine (CLAUDE.md)

List of files the instruction was applied to:

  • packages/gunshi/src/context.ts
  • eslint.config.ts
  • packages/gunshi/src/constants.ts
  • packages/plugin-global/src/decorator.ts
  • packages/gunshi/src/types.ts
  • packages/plugin-renderer/src/usage.ts
  • packages/shared/src/index.ts
  • packages/gunshi/src/definition.ts
  • packages/plugin-completion/tsdown.config.ts
  • packages/gunshi/src/plugin.ts
  • packages/plugin-renderer/src/types.ts
  • scripts/jsr.ts
  • packages/shared/src/types.ts
  • packages/plugin-completion/src/utils.ts
  • packages/plugin-renderer/src/index.ts
  • packages/plugin-completion/src/index.test.ts
  • packages/shared/src/localize.test.ts
  • packages/gunshi/src/cli.test.ts
  • packages/shared/src/utils.ts
  • packages/gunshi/src/utils.ts
  • packages/plugin-completion/src/types.ts
  • packages/plugin-i18n/src/types.ts
  • packages/plugin-completion/examples/demo.node.ts
  • packages/shared/src/localize.ts
  • packages/plugin-completion/src/index.ts
  • packages/gunshi/src/cli/core.ts
🧠 Learnings (30)
packages/gunshi/src/context.ts (7)
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Ensure changes work across Node.js, Deno, and Bun
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : All source code is in TypeScript with strict mode enabled
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Type safety is a core feature - maintain strict TypeScript types throughout
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Add tests for new features in the corresponding test file
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Mock external dependencies when needed in tests
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Test files are in 'packages/gunshi/test/' with '.test.ts' extension
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : The project uses snapshot testing for renderer output - update snapshots when renderer behavior changes
eslint.config.ts (8)
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to **/*.{js,ts,tsx} : Follow existing code style (enforced by ESLint and Prettier)
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Ensure changes work across Node.js, Deno, and Bun
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to **/*.{js,ts,tsx,mjs} : Use ES modules throughout the codebase
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Test files are in 'packages/gunshi/test/' with '.test.ts' extension
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Add tests for new features in the corresponding test file
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : All source code is in TypeScript with strict mode enabled
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Mock external dependencies when needed in tests
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Use 'describe' and 'it' blocks for test organization
packages/gunshi/src/constants.ts (3)
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : All source code is in TypeScript with strict mode enabled
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Ensure changes work across Node.js, Deno, and Bun
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Type safety is a core feature - maintain strict TypeScript types throughout
packages/plugin-global/src/decorator.ts (6)
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : All source code is in TypeScript with strict mode enabled
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Ensure changes work across Node.js, Deno, and Bun
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Type safety is a core feature - maintain strict TypeScript types throughout
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Test files are in 'packages/gunshi/test/' with '.test.ts' extension
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Mock external dependencies when needed in tests
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Add tests for new features in the corresponding test file
packages/shared/jsr.json (8)
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Test files are in 'packages/gunshi/test/' with '.test.ts' extension
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Ensure changes work across Node.js, Deno, and Bun
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to **/*.{js,ts,tsx,mjs} : Use ES modules throughout the codebase
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to **/*.{js,ts,tsx} : Follow existing code style (enforced by ESLint and Prettier)
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Add tests for new features in the corresponding test file
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Type safety is a core feature - maintain strict TypeScript types throughout
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : All source code is in TypeScript with strict mode enabled
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : The project uses snapshot testing for renderer output - update snapshots when renderer behavior changes
packages/gunshi/src/types.ts (4)
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : All source code is in TypeScript with strict mode enabled
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Ensure changes work across Node.js, Deno, and Bun
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Add tests for new features in the corresponding test file
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Type safety is a core feature - maintain strict TypeScript types throughout
packages/plugin-renderer/src/usage.ts (3)
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Ensure changes work across Node.js, Deno, and Bun
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : The project uses snapshot testing for renderer output - update snapshots when renderer behavior changes
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : All source code is in TypeScript with strict mode enabled
tsconfig.json (9)
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Ensure changes work across Node.js, Deno, and Bun
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Test files are in 'packages/gunshi/test/' with '.test.ts' extension
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Add tests for new features in the corresponding test file
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : All source code is in TypeScript with strict mode enabled
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Type safety is a core feature - maintain strict TypeScript types throughout
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to **/*.{js,ts,tsx,mjs} : Use ES modules throughout the codebase
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : The project uses snapshot testing for renderer output - update snapshots when renderer behavior changes
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Mock external dependencies when needed in tests
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to **/*.{js,ts,tsx} : Follow existing code style (enforced by ESLint and Prettier)
packages/shared/src/index.ts (9)
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Ensure changes work across Node.js, Deno, and Bun
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to **/*.{js,ts,tsx,mjs} : Use ES modules throughout the codebase
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Add tests for new features in the corresponding test file
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : All source code is in TypeScript with strict mode enabled
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Mock external dependencies when needed in tests
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Test files are in 'packages/gunshi/test/' with '.test.ts' extension
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Type safety is a core feature - maintain strict TypeScript types throughout
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Use 'describe' and 'it' blocks for test organization
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : The project uses snapshot testing for renderer output - update snapshots when renderer behavior changes
packages/gunshi/src/definition.ts (2)
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Ensure changes work across Node.js, Deno, and Bun
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : All source code is in TypeScript with strict mode enabled
packages/plugin-completion/tsdown.config.ts (9)
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Ensure changes work across Node.js, Deno, and Bun
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Mock external dependencies when needed in tests
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : All source code is in TypeScript with strict mode enabled
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Type safety is a core feature - maintain strict TypeScript types throughout
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Test files are in 'packages/gunshi/test/' with '.test.ts' extension
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : The project uses snapshot testing for renderer output - update snapshots when renderer behavior changes
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Add tests for new features in the corresponding test file
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to **/*.{js,ts,tsx,mjs} : Use ES modules throughout the codebase
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to **/*.{js,ts,tsx} : Follow existing code style (enforced by ESLint and Prettier)
package.json (4)
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Ensure changes work across Node.js, Deno, and Bun
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Add tests for new features in the corresponding test file
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Test files are in 'packages/gunshi/test/' with '.test.ts' extension
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : All source code is in TypeScript with strict mode enabled
packages/gunshi/src/plugin.ts (6)
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Ensure changes work across Node.js, Deno, and Bun
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : All source code is in TypeScript with strict mode enabled
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Add tests for new features in the corresponding test file
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Type safety is a core feature - maintain strict TypeScript types throughout
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Test files are in 'packages/gunshi/test/' with '.test.ts' extension
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to **/*.{js,ts,tsx,mjs} : Use ES modules throughout the codebase
packages/plugin-renderer/src/types.ts (4)
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Ensure changes work across Node.js, Deno, and Bun
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Type safety is a core feature - maintain strict TypeScript types throughout
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : The project uses snapshot testing for renderer output - update snapshots when renderer behavior changes
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : All source code is in TypeScript with strict mode enabled
scripts/jsr.ts (9)
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Ensure changes work across Node.js, Deno, and Bun
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : All source code is in TypeScript with strict mode enabled
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Type safety is a core feature - maintain strict TypeScript types throughout
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Add tests for new features in the corresponding test file
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Test files are in 'packages/gunshi/test/' with '.test.ts' extension
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : The project uses snapshot testing for renderer output - update snapshots when renderer behavior changes
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Mock external dependencies when needed in tests
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to **/*.{js,ts,tsx,mjs} : Use ES modules throughout the codebase
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to **/*.{js,ts,tsx} : Follow existing code style (enforced by ESLint and Prettier)
packages/plugin-completion/package.json (7)
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Ensure changes work across Node.js, Deno, and Bun
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : All source code is in TypeScript with strict mode enabled
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Type safety is a core feature - maintain strict TypeScript types throughout
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Add tests for new features in the corresponding test file
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Test files are in 'packages/gunshi/test/' with '.test.ts' extension
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to **/*.{js,ts,tsx,mjs} : Use ES modules throughout the codebase
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to **/*.{js,ts,tsx} : Follow existing code style (enforced by ESLint and Prettier)
packages/shared/src/types.ts (7)
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Type safety is a core feature - maintain strict TypeScript types throughout
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : All source code is in TypeScript with strict mode enabled
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Ensure changes work across Node.js, Deno, and Bun
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Add tests for new features in the corresponding test file
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Test files are in 'packages/gunshi/test/' with '.test.ts' extension
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Mock external dependencies when needed in tests
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : The project uses snapshot testing for renderer output - update snapshots when renderer behavior changes
packages/plugin-completion/src/utils.ts (2)
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Ensure changes work across Node.js, Deno, and Bun
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : All source code is in TypeScript with strict mode enabled
packages/plugin-renderer/src/index.ts (5)
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Ensure changes work across Node.js, Deno, and Bun
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : The project uses snapshot testing for renderer output - update snapshots when renderer behavior changes
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : All source code is in TypeScript with strict mode enabled
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Type safety is a core feature - maintain strict TypeScript types throughout
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Test files are in 'packages/gunshi/test/' with '.test.ts' extension
packages/plugin-completion/src/index.test.ts (6)
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Add tests for new features in the corresponding test file
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : The project uses snapshot testing for renderer output - update snapshots when renderer behavior changes
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Test files are in 'packages/gunshi/test/' with '.test.ts' extension
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Use 'describe' and 'it' blocks for test organization
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Mock external dependencies when needed in tests
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Ensure changes work across Node.js, Deno, and Bun
packages/shared/src/localize.test.ts (7)
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Add tests for new features in the corresponding test file
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Use 'describe' and 'it' blocks for test organization
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Test files are in 'packages/gunshi/test/' with '.test.ts' extension
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Mock external dependencies when needed in tests
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : The project uses snapshot testing for renderer output - update snapshots when renderer behavior changes
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Ensure changes work across Node.js, Deno, and Bun
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : All source code is in TypeScript with strict mode enabled
packages/gunshi/src/cli.test.ts (8)
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : The project uses snapshot testing for renderer output - update snapshots when renderer behavior changes
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Add tests for new features in the corresponding test file
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Test files are in 'packages/gunshi/test/' with '.test.ts' extension
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Use 'describe' and 'it' blocks for test organization
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Ensure changes work across Node.js, Deno, and Bun
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Mock external dependencies when needed in tests
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : All source code is in TypeScript with strict mode enabled
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Type safety is a core feature - maintain strict TypeScript types throughout
packages/shared/src/utils.ts (7)
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : All source code is in TypeScript with strict mode enabled
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Ensure changes work across Node.js, Deno, and Bun
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Type safety is a core feature - maintain strict TypeScript types throughout
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Test files are in 'packages/gunshi/test/' with '.test.ts' extension
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Add tests for new features in the corresponding test file
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Mock external dependencies when needed in tests
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Use 'describe' and 'it' blocks for test organization
packages/gunshi/src/utils.ts (7)
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Ensure changes work across Node.js, Deno, and Bun
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Add tests for new features in the corresponding test file
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : All source code is in TypeScript with strict mode enabled
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Type safety is a core feature - maintain strict TypeScript types throughout
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Test files are in 'packages/gunshi/test/' with '.test.ts' extension
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Mock external dependencies when needed in tests
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : The project uses snapshot testing for renderer output - update snapshots when renderer behavior changes
packages/plugin-completion/src/types.ts (2)
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Type safety is a core feature - maintain strict TypeScript types throughout
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : All source code is in TypeScript with strict mode enabled
packages/plugin-i18n/src/types.ts (3)
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Ensure changes work across Node.js, Deno, and Bun
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Type safety is a core feature - maintain strict TypeScript types throughout
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : All source code is in TypeScript with strict mode enabled
packages/plugin-completion/examples/demo.node.ts (5)
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Ensure changes work across Node.js, Deno, and Bun
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Add tests for new features in the corresponding test file
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : All source code is in TypeScript with strict mode enabled
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Test files are in 'packages/gunshi/test/' with '.test.ts' extension
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Use 'describe' and 'it' blocks for test organization
packages/shared/src/localize.ts (3)
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Ensure changes work across Node.js, Deno, and Bun
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : All source code is in TypeScript with strict mode enabled
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Add tests for new features in the corresponding test file
packages/plugin-completion/src/index.ts (5)
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : All source code is in TypeScript with strict mode enabled
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Ensure changes work across Node.js, Deno, and Bun
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Add tests for new features in the corresponding test file
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Type safety is a core feature - maintain strict TypeScript types throughout
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Test files are in 'packages/gunshi/test/' with '.test.ts' extension
packages/gunshi/src/cli/core.ts (5)
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Ensure changes work across Node.js, Deno, and Bun
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : All source code is in TypeScript with strict mode enabled
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Type safety is a core feature - maintain strict TypeScript types throughout
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Add tests for new features in the corresponding test file
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Test files are in 'packages/gunshi/test/' with '.test.ts' extension
🧬 Code Graph Analysis (8)
packages/gunshi/src/context.ts (3)
packages/gunshi/src/utils.ts (1)
  • create (76-78)
packages/gunshi/src/types.ts (1)
  • CommandEnvironment (87-179)
packages/gunshi/src/constants.ts (1)
  • CLI_OPTIONS_DEFAULT (12-27)
packages/gunshi/src/constants.ts (1)
packages/gunshi/src/types.ts (2)
  • CliOptions (185-266)
  • DefaultGunshiParams (47-47)
packages/plugin-renderer/src/types.ts (2)
packages/shared/src/localize.ts (1)
  • Localization (17-26)
packages/shared/src/types.ts (1)
  • CommandBuiltinKeys (59-62)
packages/gunshi/src/cli.test.ts (2)
packages/gunshi/src/cli/builtin.ts (1)
  • cli (74-81)
packages/gunshi/src/cli/bone.ts (1)
  • cli (71-77)
packages/shared/src/utils.ts (1)
packages/gunshi/src/utils.ts (1)
  • kebabnize (14-14)
packages/plugin-completion/src/types.ts (3)
packages/shared/src/types.ts (1)
  • GenerateNamespacedKey (34-37)
packages/shared/src/constants.ts (1)
  • PLUGIN_PREFIX (8-8)
packages/shared/src/utils.ts (1)
  • namespacedId (49-53)
packages/plugin-i18n/src/types.ts (1)
packages/shared/src/types.ts (2)
  • Translation (76-85)
  • CommandBuiltinKeys (59-62)
packages/gunshi/src/cli/core.ts (4)
packages/gunshi/src/types.ts (5)
  • Command (380-423)
  • CommandRunner (465-467)
  • LazyCommand (430-439)
  • CliOptions (185-266)
  • GunshiParamsConstraint (55-55)
packages/gunshi/src/plugin/context.ts (1)
  • subCommands (157-159)
packages/gunshi/src/utils.ts (2)
  • isLazyCommand (16-20)
  • create (76-78)
packages/gunshi/src/constants.ts (2)
  • CLI_OPTIONS_DEFAULT (12-27)
  • ANONYMOUS_COMMAND_NAME (8-8)
🪛 Biome (1.9.4)
packages/plugin-completion/src/types.ts

[error] 26-26: An empty interface is equivalent to {}.

Safe fix: Use a type alias instead.

(lint/suspicious/noEmptyInterface)

🪛 GitHub Actions: CI
packages/plugin-completion/src/types.ts

[error] 8-8: TypeCheckError: Could not find a declaration file for module '@bombsh/tab'. Try npm i --save-dev @types/tab or add a declaration file with declare module '@bombsh/tab';.

packages/plugin-completion/examples/demo.node.ts

[warning] 1-1: Knip reported unused file: packages/plugin-completion/examples/demo.node.ts

packages/plugin-completion/src/index.ts

[error] 6-6: TypeCheckError: Could not find a declaration file for module '@bombsh/tab'. Try npm i --save-dev @types/tab or add a declaration file with declare module '@bombsh/tab';.


[error] 12-12: TypeCheckError: Could not find a declaration file for module '@bombsh/tab'. Try npm i --save-dev @types/tab or add a declaration file with declare module '@bombsh/tab';.

🔇 Additional comments (57)
packages/gunshi/src/constants.ts (2)

12-27: Consider freezing / as const for a truly read-only default object

CLI_OPTIONS_DEFAULT is intended to be used as a canonical default.
Declaring it const alone does not prevent accidental mutation at run-time. Two lightweight options:

-export const CLI_OPTIONS_DEFAULT: CliOptions<DefaultGunshiParams> = {
+export const CLI_OPTIONS_DEFAULT = Object.freeze({
   /* … */
-  plugins: undefined
-}
+  plugins: undefined
+} as const) satisfies CliOptions<DefaultGunshiParams>

Either Object.freeze or a plain as const satisfies CliOptions<…> guards consumers (incl. plugins) from mutating defaults and preserves literal type information without sacrificing ergonomics.
[ suggest_optional_refactor ]


17-24: Omit explicitly undefined optional fields for clarity

All listed properties are optional in CliOptions, therefore assigning undefined is redundant (and still emits the key).
Removing them keeps the object terse and avoids surprising Object.keys(CLI_OPTIONS_DEFAULT) results.

-  description: undefined,
-  version: undefined,
-  cwd: undefined,
   usageSilent: false,
-  subCommands: undefined,
   leftMargin: 2,
   middleMargin: 10,
   usageOptionType: false,
   usageOptionValue: true,
-  renderHeader: undefined,
-  renderUsage: undefined,
-  renderValidationErrors: undefined,
-  plugins: undefined

[ suggest_nitpick ]

eslint.config.ts (1)

36-37: LGTM – example sources correctly excluded from lint comments

Adding ./packages/**/examples/** matches the pattern used elsewhere (publish excludes etc.) and avoids false positives on illustrative code.
[ approve_code_changes ]

packages/shared/jsr.json (1)

10-12: LGTM – keep examples out of published artifact

The new exclude keeps the npm/JSR bundle lean and avoids shipping non-prod material.
[ approve_code_changes ]

packages/shared/src/index.ts (1)

8-10: Check for possible re-export cycles

localize.ts pulls utilities from utils.ts, while index.ts now re-exports both modules. Circular references are unlikely but worth a quick check (especially for CJS interop in Node ≤​16).
If any runtime issues emerge, consider using explicit export lists or a barrel abstraction that groups pure types only.
[ request_verification ]

package.json (1)

33-34: Script naming stays consistent – no further action

build:plugin:completion follows the existing pattern (build:plugin:*). Confirmed that the package name matches workspace filter @gunshi/plugin-completion.
[ approve_code_changes ]

packages/gunshi/src/context.ts (1)

18-18: LGTM: Consistent constant renaming applied correctly.

The renaming from COMMAND_OPTIONS_DEFAULT to CLI_OPTIONS_DEFAULT improves naming clarity and is consistently applied across both the import and usage.

Also applies to: 151-151

tsconfig.json (1)

47-47: LGTM: Standard package path mapping addition.

The new path mapping for @gunshi/plugin-completion follows the established pattern and enables proper module resolution for the completion plugin package.

packages/gunshi/src/types.ts (1)

417-422: Confirmed: entry property is properly integrated across the codebase

All references to the new entry flag—assignments in packages/gunshi/src/definition.ts and utils.ts, initialization in packages/gunshi/src/cli/core.ts, and its use in plugin-completion utilities—have been verified. No missing handlers or checks were found.

packages/gunshi/src/plugin.ts (1)

26-27: LGTM: Appropriate plugin API enhancements.

Adding CLI_OPTIONS_DEFAULT and createCommandContext exports enhances the plugin API by providing access to default CLI options and context creation functionality, which are valuable for plugin development.

packages/gunshi/src/definition.ts (1)

172-172: LGTM: Consistent property copying for lazy commands.

The addition of entry property assignment follows the established pattern of copying command properties to lazy commands, ensuring consistent behavior between regular and lazy commands.

packages/plugin-completion/tsdown.config.ts (1)

10-10: LGTM - Proper bundling configuration for completion dependency.

The noExternal configuration correctly ensures that the @bombsh/tab completion library is bundled with the plugin rather than treated as an external dependency. This is the right approach for a specialized completion utility.

packages/plugin-completion/package.json (2)

58-58: LGTM - Proper Deno compatibility enhancement.

Adding the import map to the Deno typecheck script correctly supports the project's goal of ensuring changes work across Node.js, Deno, and Bun.


65-66: LGTM - Proper workspace and catalog dependency usage.

The additions of @gunshi/shared as a workspace dependency and @types/node from the catalog follow the monorepo patterns and support the completion plugin development workflow.

packages/plugin-renderer/src/usage.ts (1)

11-11: LGTM - Good refactoring to use shared utility.

Moving from a local implementation to importing makeShortLongOptionPair from @gunshi/shared eliminates code duplication and promotes consistency across packages. This aligns with the broader modularization effort in this PR.

packages/gunshi/src/utils.ts (2)

34-36: LGTM - Proper extension of lazy command resolution for entry property.

The addition of the entry property to the base command object correctly extends the lazy command resolution to support entry command identification, which is essential for the completion plugin functionality.


56-56: LGTM - Consistent entry property handling in command loading.

Properly preserves the entry property when loading from resolved lazy commands, maintaining consistency with the command interface and supporting completion plugin requirements.

packages/gunshi/src/cli.test.ts (3)

393-396: LGTM - Proper test metadata for CLI context.

The meta object correctly provides test context for CLI naming and header rendering configuration, ensuring the usage generation tests exercise the enhanced CLI functionality properly.


405-405: LGTM - Explicit command naming supports entry identification.

Adding an explicit name property to the entry command aligns with the broader changes that enhance entry command identification, which is essential for the completion plugin functionality.


425-428: LGTM - Consistent test invocation with metadata.

The updated CLI calls properly spread the meta object to include CLI naming and header configuration, ensuring the tests validate the enhanced usage generation features while maintaining snapshot consistency.

scripts/jsr.ts (1)

50-62: LGTM: Dependency update aligns with localization refactoring.

The move of 'packages/plugin-completion' to include both '@gunshi/plugin' and '@gunshi/shared' dependencies correctly reflects the plugin's new requirement for shared localization utilities.

packages/plugin-renderer/src/types.ts (2)

9-9: LGTM: Proper import for shared localization type.

The import of Localization type from @gunshi/shared is correctly added to support the type abstraction.


31-31: LGTM: Type abstraction improves consistency.

Replacing the explicit function signature with Localization<CommandBuiltinKeys, G> centralizes the localization type definition and improves consistency across the codebase.

packages/shared/src/utils.ts (3)

6-6: LGTM: Proper import for kebab-case conversion utility.

The import of kebabnize from gunshi/utils is correctly added to support the new option formatting function.


11-11: LGTM: Type import for function parameter.

The ArgSchema type import is properly added for the new utility function's parameter typing.


55-67: LGTM: Well-implemented utility function for option formatting.

The makeShortLongOptionPair function correctly:

  • Handles kebab-case conversion based on schema or parameter
  • Formats option pairs with proper prefixes and separators
  • Maintains clean, readable logic
  • Centralizes option formatting logic from the renderer plugin
packages/shared/src/localize.test.ts (4)

1-11: LGTM: Proper test setup with mock data.

The test file imports and language resources setup are correctly structured for testing localization functionality.


12-48: LGTM: Comprehensive test setup function.

The setup function properly creates:

  • A command definition with various argument types
  • A command context with all required properties
  • Good coverage of different argument scenarios including negatable options

50-63: LGTM: Translation function test with proper mocking.

The test correctly:

  • Mocks the translation function with vi.fn()
  • Tests both existing and non-existent keys
  • Verifies fallback behavior for missing translations

65-101: LGTM: Comprehensive test coverage for localization without translation.

The test suite thoroughly covers:

  • Built-in keys with proper resolution
  • Argument keys including negatable options
  • Fallback behavior for non-existent keys
  • Edge cases like description and examples keys
packages/plugin-completion/src/index.test.ts (5)

4-14: LGTM: Proper utility function for command execution.

The runCommand function correctly:

  • Uses Promise-based async execution
  • Handles both success and error cases
  • Properly rejects with stderr on error

16-21: LGTM: Basic completion test with snapshot verification.

The test correctly uses the demo script path and verifies output with snapshots.


23-53: LGTM: Comprehensive default command completion tests.

The test suite thoroughly covers:

  • Basic option suggestion
  • Long option completion
  • Duplicate option handling
  • Option value suggestions
  • Short option completion

55-105: LGTM: Thorough subcommand completion testing.

The test suite covers:

  • Command-only completion
  • Option suggestion for subcommands
  • Long and short option completion
  • Unknown option handling
  • Option value resolution
  • Edge cases with equals signs and partial inputs

The TODO test is acceptable for future implementation.


107-122: LGTM: Complete positional argument testing.

The test suite covers:

  • Multiple positional arguments
  • Partial input completion
  • Single positional argument scenarios
packages/plugin-completion/examples/demo.node.ts (1)

1-127: Example file appropriately demonstrates completion plugin usage

The example effectively showcases the completion plugin with comprehensive configuration for root arguments and subcommands. The pipeline failure reporting this as unused is expected for example files.

packages/shared/src/types.ts (2)

8-8: LGTM - Proper extension of imports for enhanced type safety

The additional imports from 'gunshi' support the new Translation interface and maintain strict TypeScript types throughout the codebase.


73-85: Well-designed Translation interface with appropriate generic constraints

The interface effectively handles localization keys and values with proper TypeScript generics. The eslint-disable for any type is acceptable given the generic nature of translation functions.

packages/plugin-completion/src/utils.ts (1)

27-41: LGTM - Proper runtime detection with necessary type ignores

The runtime detection function correctly identifies Node.js, Deno, and Bun environments. The @ts-ignore comments are necessary for cross-runtime compatibility as mentioned in the retrieved learnings.

packages/plugin-renderer/src/index.ts (2)

33-33: LGTM - Proper import of shared localization utilities

The import of localizable from @gunshi/shared aligns with the refactoring to use centralized localization logic.


107-107: Excellent refactoring to use shared localization utilities

The change from custom text function to shared localizable function improves code maintainability and consistency across the codebase while maintaining type safety.

packages/plugin-completion/src/types.ts (2)

14-15: LGTM - Proper plugin ID generation using shared utilities

The plugin ID is correctly generated using the shared namespacedId function with appropriate typing.


31-50: Well-structured configuration interfaces

The CompletionConfig and CompletionOptions interfaces provide a clear and flexible structure for configuring completion handlers.

packages/plugin-i18n/src/types.ts (6)

16-16: Good import consolidation.

Consolidating multiple imports from the same module into a single import statement follows ES module best practices and improves code readability.


22-24: Necessary type imports added.

The addition of RemovedIndex and Translation types supports the centralization of type definitions across the codebase.


54-54: Excellent type centralization.

Using the shared Translation type improves consistency and maintainability across the codebase while preserving the same type safety guarantees.


16-16: LGTM: Import consolidation improves readability.

The consolidation of imports from @gunshi/shared into a single import statement is a good practice that improves code readability and maintainability.


22-24: LGTM: Good addition of shared types.

The import of RemovedIndex and Translation types from the shared package promotes type consistency across the codebase and follows the standardization effort mentioned in the AI summary.


54-54: LGTM: Excellent type refactoring using shared definition.

The replacement of the inline generic function signature with the shared Translation<CommandBuiltinKeys, G> type alias is a significant improvement that:

  • Promotes type consistency across the codebase
  • Reduces code duplication
  • Makes the interface more maintainable
  • Aligns with the broader localization standardization effort

The shared Translation interface (from packages/shared/src/types.ts) provides the same functionality as the previous inline definition while ensuring consistency with other parts of the codebase.

packages/gunshi/src/cli/core.ts (5)

7-7: Consistent constant naming.

The rename to CLI_OPTIONS_DEFAULT better reflects that these are CLI-level options rather than command-specific options.


134-145: Well-implemented entry command handling.

The logic correctly handles all command types and properly sets the entry flag, ensuring entry commands are included in the subcommands map when appropriate.


158-158: Consistent constant usage.

Correctly uses the renamed CLI_OPTIONS_DEFAULT constant.


212-212: Proper entry flag for inline commands.

Setting entry: true for inline command runners ensures consistent behavior across all command types.


254-260: Robust entry name resolution.

The function properly handles both Command and LazyCommand types with appropriate type guards and fallback logic.

packages/plugin-completion/src/index.ts (1)

30-141: Well-structured completion plugin implementation.

The plugin provides comprehensive shell completion support with:

  • Proper command and option handling
  • Recursive subcommand processing
  • Clean separation of concerns
  • Appropriate filtering of internal/entry commands

The architecture is solid and extensible.

packages/shared/src/localize.ts (2)

17-26: Well-designed localization interface.

The Localization interface properly defines an async localization function with flexible generic types, enabling type-safe localization across different contexts.


28-68: Excellent localization implementation.

The localizable function provides comprehensive handling for:

  • Built-in resource keys with proper prefix checking
  • Argument keys with negatable boolean support
  • Special keys like 'description' and 'examples'
  • Graceful fallbacks when translation isn't available

The implementation is robust and well-thought-out.

*/

import { pluginId as I18n } from './types.ts'
import { pluginId as Global } from './types.ts'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Check alias naming for clarity & search for stale I18n usages

Renaming the alias from I18n to Global is fine type-wise, but the very generic identifier Global can be mistaken for the built-in global object in several runtimes. Consider using a more explicit name (globalPluginId or similar) to avoid mental clashes.

Also verify that no other files still reference the old I18n key; a stray reference will cause a runtime undefined destructuring error.


🏁 Script executed:

#!/bin/bash
# Ensure no stale `[I18n]` destructuring remains
rg -n "\[I18n\]" --glob "*.ts"

Length of output: 32


🏁 Script executed:

#!/bin/bash
# Verify no remaining import alias or identifier named I18n across the TS codebase

# 1. Check for any residual import alias: `pluginId as I18n`
rg -n "pluginId as I18n" --glob "*.ts"

# 2. Look for any standalone references to the old `I18n` identifier
rg -n "\bI18n\b" --glob "*.ts"

Length of output: 195


Rename Global alias for clarity & confirm no stale I18n references

The generic alias Global can be mistaken for the built-in global object at runtime. Please rename it to a more explicit identifier (for example, globalPluginId) to avoid confusion.

A code-wide search found no remaining uses of the old I18n identifier (aside from a comment in packages/plugin-i18n/src/types.ts), so there are no stale references that would cause runtime errors.

Files to update:

  • packages/plugin-global/src/decorator.ts (line 6: import { pluginId as Global } from './types.ts')
🤖 Prompt for AI Agents
In packages/plugin-global/src/decorator.ts at line 6, rename the imported alias
from `Global` to a more explicit name like `globalPluginId` to avoid confusion
with the built-in global object. Update the import statement accordingly to
`import { pluginId as globalPluginId } from './types.ts'`. Also, verify that all
references in this file use the new alias name to maintain consistency.

Comment thread packages/plugin-completion/package.json Outdated
Comment thread packages/plugin-completion/src/utils.ts Outdated

import { namespacedId, PLUGIN_PREFIX } from '@gunshi/shared'

import type { Handler } from '@bombsh/tab'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Add type declaration for '@bombsh/tab' dependency

The TypeScript compiler cannot find a declaration file for the '@bombsh/tab' module. This needs to be resolved for proper type safety.

Add a type declaration file or install the types package:

// Option 1: Create a declaration file (e.g., types/bombsh-tab.d.ts)
declare module '@bombsh/tab' {
  export interface Handler {
    // Define the Handler interface based on bombsh/tab documentation
  }
}

// Option 2: Install types if available
// npm install --save-dev @types/tab
🧰 Tools
🪛 GitHub Actions: CI

[error] 8-8: TypeCheckError: Could not find a declaration file for module '@bombsh/tab'. Try npm i --save-dev @types/tab or add a declaration file with declare module '@bombsh/tab';.

🤖 Prompt for AI Agents
In packages/plugin-completion/src/types.ts at line 8, the TypeScript compiler
cannot find type declarations for the '@bombsh/tab' module. To fix this, either
create a custom declaration file (e.g., types/bombsh-tab.d.ts) defining the
Handler interface according to the module's documentation, or check if a types
package exists and install it using npm (e.g., npm install --save-dev
@types/tab) to provide proper type safety.

Comment on lines +80 to +82
extension: (_ctx, _cmd): CompletionCommandContext => {
return {} as CompletionCommandContext
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Incomplete extension implementation.

The extension function returns an empty object cast to CompletionCommandContext. This appears to be placeholder code that should either be properly implemented or removed if extensions aren't needed for this plugin.

Do you want me to help implement the proper extension context or remove it if it's not needed?

🤖 Prompt for AI Agents
In packages/plugin-completion/src/index.ts at lines 80 to 82, the extension
function returns an empty object cast as CompletionCommandContext, which is
incomplete. You should either implement the extension function to return a
properly constructed CompletionCommandContext object with the necessary
properties and methods or remove the extension function entirely if this plugin
does not require any extension context.

* @license MIT
*/

import { Completion, script } from '@bombsh/tab'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Missing TypeScript declarations for '@bombsh/tab'.

The pipeline is failing because TypeScript cannot find type declarations for the '@bombsh/tab' module.

Either:

  1. Install type definitions if available: npm install --save-dev @types/bombsh__tab
  2. Or create a local declaration file types/bombsh-tab.d.ts:
declare module '@bombsh/tab' {
  export interface Handler {
    (args: string[]): string[]
  }
  
  export class Completion {
    addCommand(name: string, description: string, args: any[], handler: Handler): string
    addOption(command: string, option: string, description: string, handler: Handler, short?: string): void
    parse(args: string[]): Promise<void>
  }
  
  export function script(shell: string, name: string, exec: string): void
}

Also applies to: 12-12


🏁 Script executed:

#!/bin/bash
# Display dependencies in root package.json
jq '{dependencies: .dependencies, devDependencies: .devDependencies}' package.json || true

# Search for any existing TypeScript declaration files or references for '@bombsh/tab'
rg "bombsh/tab" -g "*.d.ts" -g "*.ts" -g "*.json" || true

Length of output: 1946


Add TypeScript declarations for ‘@bombsh/tab’ in plugin-completion

The build is failing because the git-sourced package ‘@bombsh/tab’ doesn’t expose any .d.ts files. You have two options:

  1. Upstream fix:

    • In the bombshell-dev/tab repo, add a types field in its package.json pointing to declaration files (e.g. "types": "dist/index.d.ts"), and commit the generated .d.ts outputs.
    • Re-publish or push tags so that the git URL carries the declarations.
  2. Local workaround:

    • Create an ambient declaration under your plugin:
      • File: packages/plugin-completion/types/bombsh-tab.d.ts
      declare module '@bombsh/tab' {
        export type Handler = (args: string[]) => string[];
        export class Completion {
          addCommand(
            name: string,
            description: string,
            args: unknown[],
            handler: Handler
          ): string;
          addOption(
            command: string,
            option: string,
            description: string,
            handler: Handler,
            short?: string
          ): void;
          parse(args: string[]): Promise<void>;
        }
        export function script(shell: string, name: string, exec: string): void;
      }
    • Update packages/plugin-completion/tsconfig.json to include your types folder:
      {
        "compilerOptions": {
          // …existing options…
          "typeRoots": ["./types", "../node_modules/@types"]
        }
      }

Either approach will satisfy the imports in packages/plugin-completion/src/index.ts (lines 6 & 12) and restore type-checking.

🧰 Tools
🪛 GitHub Actions: CI

[error] 6-6: TypeCheckError: Could not find a declaration file for module '@bombsh/tab'. Try npm i --save-dev @types/tab or add a declaration file with declare module '@bombsh/tab';.

🤖 Prompt for AI Agents
In packages/plugin-completion/src/index.ts at line 6, the import from
'@bombsh/tab' fails due to missing TypeScript declarations. To fix this, either
update the upstream 'bombshell-dev/tab' repo to include and publish proper .d.ts
files with a "types" field in package.json, or locally create an ambient
declaration file at packages/plugin-completion/types/bombsh-tab.d.ts with the
necessary type definitions. Then, update
packages/plugin-completion/tsconfig.json to include the new types folder in
"typeRoots" so the compiler recognizes these declarations and restores
type-checking.

@kazupon
kazupon merged commit fcb2f05 into main Jul 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Includes new features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant