Class: BundlerSkills::Command

Inherits:
Bundler::Plugin::API
  • Object
show all
Defined in:
lib/bundler_skills/command.rb

Overview

‘bundle skills [sync|list|clean] [–dry-run]`

The manual entry point. Unlike the hook, it ignores the production/CI disabling guard — running it is an explicit user action. It reuses the same Synchronizer logic the hook uses.

Defined Under Namespace

Classes: OverrideDryRun

Constant Summary collapse

INIT_TEMPLATE =
<<~YAML
  # bundler-skills.yml — all keys are optional
  #
  # enabled:                    # nil (auto) | false (off) | [development] (env list)
  # agents:                     # omit = auto-detect; or list: [claude, cursor]; or "*"
  #   - claude
  #   - cursor
  # gitignore: true             # manage .gitignore (default true)
  # cleanup: true               # prune stale gem-*--* links when a gem is removed (default true)
  # recursive: false            # also scan skills/**/SKILL.md (default false)
  # include:                    # only these gems (empty = all). fnmatch on "gem" or "gem/skill"
  #   - rubocop
  #   - "rails-*"
  # exclude:                    # exclude these (wins over include)
  #   - some-noisy-gem
YAML

Instance Method Summary collapse

Instance Method Details

#exec(_command_name, args) ⇒ Object



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/bundler_skills/command.rb', line 29

def exec(_command_name, args)
  dry_run = !!args.delete("--dry-run")
  subcommand = args.shift || "sync"

  case subcommand
  when "sync" then run_sync(dry_run)
  when "list" then run_list
  when "clean" then run_clean(dry_run)
  when "init" then run_init
  when "help", "-h", "--help" then print_help
  else
    Bundler.ui.error("[bundler-skills] unknown subcommand: #{subcommand}")
    print_help
  end
end