@camaradesuk/git-worktree-tools 1.9.0 → 1.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +52 -31
- package/dist/cli/cleanpr.js +74 -53
- package/dist/cli/cleanpr.js.map +1 -1
- package/dist/cli/lswt.js +32 -56
- package/dist/cli/lswt.js.map +1 -1
- package/dist/cli/newpr.d.ts +13 -1
- package/dist/cli/newpr.d.ts.map +1 -1
- package/dist/cli/newpr.js +159 -153
- package/dist/cli/newpr.js.map +1 -1
- package/dist/cli/prs.d.ts +3 -10
- package/dist/cli/prs.d.ts.map +1 -1
- package/dist/cli/prs.js +6 -168
- package/dist/cli/prs.js.map +1 -1
- package/dist/cli/wt/clean.d.ts +6 -2
- package/dist/cli/wt/clean.d.ts.map +1 -1
- package/dist/cli/wt/clean.js +401 -20
- package/dist/cli/wt/clean.js.map +1 -1
- package/dist/cli/wt/completion.d.ts +3 -0
- package/dist/cli/wt/completion.d.ts.map +1 -1
- package/dist/cli/wt/completion.js +80 -9
- package/dist/cli/wt/completion.js.map +1 -1
- package/dist/cli/wt/config.d.ts +3 -1
- package/dist/cli/wt/config.d.ts.map +1 -1
- package/dist/cli/wt/config.js +323 -32
- package/dist/cli/wt/config.js.map +1 -1
- package/dist/cli/wt/interactive-menu.d.ts +2 -0
- package/dist/cli/wt/interactive-menu.d.ts.map +1 -1
- package/dist/cli/wt/interactive-menu.js +346 -73
- package/dist/cli/wt/interactive-menu.js.map +1 -1
- package/dist/cli/wt/link.d.ts +3 -1
- package/dist/cli/wt/link.d.ts.map +1 -1
- package/dist/cli/wt/link.js +125 -38
- package/dist/cli/wt/link.js.map +1 -1
- package/dist/cli/wt/list.d.ts +4 -1
- package/dist/cli/wt/list.d.ts.map +1 -1
- package/dist/cli/wt/list.js +85 -16
- package/dist/cli/wt/list.js.map +1 -1
- package/dist/cli/wt/new.d.ts +8 -2
- package/dist/cli/wt/new.d.ts.map +1 -1
- package/dist/cli/wt/new.js +91 -46
- package/dist/cli/wt/new.js.map +1 -1
- package/dist/cli/wt/prs.d.ts +2 -1
- package/dist/cli/wt/prs.d.ts.map +1 -1
- package/dist/cli/wt/prs.js +3 -164
- package/dist/cli/wt/prs.js.map +1 -1
- package/dist/cli/wt/run-command.d.ts +4 -2
- package/dist/cli/wt/run-command.d.ts.map +1 -1
- package/dist/cli/wt/run-command.js +6 -4
- package/dist/cli/wt/run-command.js.map +1 -1
- package/dist/cli/wt/state.d.ts +3 -1
- package/dist/cli/wt/state.d.ts.map +1 -1
- package/dist/cli/wt/state.js +74 -10
- package/dist/cli/wt/state.js.map +1 -1
- package/dist/cli/wt.d.ts.map +1 -1
- package/dist/cli/wt.js +50 -36
- package/dist/cli/wt.js.map +1 -1
- package/dist/cli/wtconfig.js +99 -22
- package/dist/cli/wtconfig.js.map +1 -1
- package/dist/cli/wtlink.js +85 -61
- package/dist/cli/wtlink.js.map +1 -1
- package/dist/cli/wtstate.js +21 -2
- package/dist/cli/wtstate.js.map +1 -1
- package/dist/lib/cleanpr/args.d.ts.map +1 -1
- package/dist/lib/cleanpr/args.js +20 -0
- package/dist/lib/cleanpr/args.js.map +1 -1
- package/dist/lib/cleanpr/types.d.ts +6 -0
- package/dist/lib/cleanpr/types.d.ts.map +1 -1
- package/dist/lib/colors.d.ts +5 -0
- package/dist/lib/colors.d.ts.map +1 -1
- package/dist/lib/colors.js +13 -6
- package/dist/lib/colors.js.map +1 -1
- package/dist/lib/constants.d.ts +12 -4
- package/dist/lib/constants.d.ts.map +1 -1
- package/dist/lib/constants.js +24 -5
- package/dist/lib/constants.js.map +1 -1
- package/dist/lib/deprecation.d.ts +18 -0
- package/dist/lib/deprecation.d.ts.map +1 -0
- package/dist/lib/deprecation.js +28 -0
- package/dist/lib/deprecation.js.map +1 -0
- package/dist/lib/logger.d.ts +40 -155
- package/dist/lib/logger.d.ts.map +1 -1
- package/dist/lib/logger.js +349 -420
- package/dist/lib/logger.js.map +1 -1
- package/dist/lib/lswt/args.d.ts.map +1 -1
- package/dist/lib/lswt/args.js +15 -1
- package/dist/lib/lswt/args.js.map +1 -1
- package/dist/lib/lswt/index.d.ts +1 -0
- package/dist/lib/lswt/index.d.ts.map +1 -1
- package/dist/lib/lswt/index.js +2 -0
- package/dist/lib/lswt/index.js.map +1 -1
- package/dist/lib/lswt/table.d.ts +15 -0
- package/dist/lib/lswt/table.d.ts.map +1 -0
- package/dist/lib/lswt/table.js +61 -0
- package/dist/lib/lswt/table.js.map +1 -0
- package/dist/lib/lswt/types.d.ts +4 -0
- package/dist/lib/lswt/types.d.ts.map +1 -1
- package/dist/lib/newpr/args.d.ts.map +1 -1
- package/dist/lib/newpr/args.js +21 -0
- package/dist/lib/newpr/args.js.map +1 -1
- package/dist/lib/newpr/types.d.ts +6 -0
- package/dist/lib/newpr/types.d.ts.map +1 -1
- package/dist/lib/prs/command.d.ts +21 -0
- package/dist/lib/prs/command.d.ts.map +1 -0
- package/dist/lib/prs/command.js +175 -0
- package/dist/lib/prs/command.js.map +1 -0
- package/dist/lib/prs/interactive.d.ts.map +1 -1
- package/dist/lib/prs/interactive.js +15 -2
- package/dist/lib/prs/interactive.js.map +1 -1
- package/dist/lib/prs/types.d.ts +15 -0
- package/dist/lib/prs/types.d.ts.map +1 -1
- package/dist/lib/ui/error.d.ts +31 -0
- package/dist/lib/ui/error.d.ts.map +1 -0
- package/dist/lib/ui/error.js +47 -0
- package/dist/lib/ui/error.js.map +1 -0
- package/dist/lib/ui/index.d.ts +15 -0
- package/dist/lib/ui/index.d.ts.map +1 -0
- package/dist/lib/ui/index.js +19 -0
- package/dist/lib/ui/index.js.map +1 -0
- package/dist/lib/ui/output.d.ts +18 -0
- package/dist/lib/ui/output.d.ts.map +1 -0
- package/dist/lib/ui/output.js +31 -0
- package/dist/lib/ui/output.js.map +1 -0
- package/dist/lib/ui/spinner.d.ts +10 -0
- package/dist/lib/ui/spinner.d.ts.map +1 -0
- package/dist/lib/ui/spinner.js +10 -0
- package/dist/lib/ui/spinner.js.map +1 -0
- package/dist/lib/ui/status.d.ts +65 -0
- package/dist/lib/ui/status.d.ts.map +1 -0
- package/dist/lib/ui/status.js +100 -0
- package/dist/lib/ui/status.js.map +1 -0
- package/dist/lib/ui/table.d.ts +39 -0
- package/dist/lib/ui/table.d.ts.map +1 -0
- package/dist/lib/ui/table.js +45 -0
- package/dist/lib/ui/table.js.map +1 -0
- package/dist/lib/ui/theme.d.ts +34 -0
- package/dist/lib/ui/theme.d.ts.map +1 -0
- package/dist/lib/ui/theme.js +37 -0
- package/dist/lib/ui/theme.js.map +1 -0
- package/dist/lib/wtlink/link-configs.js +7 -7
- package/dist/lib/wtlink/link-configs.js.map +1 -1
- package/dist/lib/wtlink/validate-manifest.d.ts.map +1 -1
- package/dist/lib/wtlink/validate-manifest.js +5 -5
- package/dist/lib/wtlink/validate-manifest.js.map +1 -1
- package/dist/lib/wtstate/args.d.ts.map +1 -1
- package/dist/lib/wtstate/args.js +2 -0
- package/dist/lib/wtstate/args.js.map +1 -1
- package/dist/mcp/server.d.ts +2 -1
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +264 -44
- package/dist/mcp/server.js.map +1 -1
- package/package.json +13 -3
- package/dist/api/list.test.d.ts +0 -5
- package/dist/api/list.test.d.ts.map +0 -1
- package/dist/api/list.test.js +0 -390
- package/dist/api/list.test.js.map +0 -1
- package/dist/cli/cleanpr.test.d.ts +0 -2
- package/dist/cli/cleanpr.test.d.ts.map +0 -1
- package/dist/cli/cleanpr.test.js +0 -954
- package/dist/cli/cleanpr.test.js.map +0 -1
- package/dist/cli/lswt.test.d.ts +0 -2
- package/dist/cli/lswt.test.d.ts.map +0 -1
- package/dist/cli/lswt.test.js +0 -386
- package/dist/cli/lswt.test.js.map +0 -1
- package/dist/cli/newpr.test.d.ts +0 -2
- package/dist/cli/newpr.test.d.ts.map +0 -1
- package/dist/cli/newpr.test.js +0 -1182
- package/dist/cli/newpr.test.js.map +0 -1
- package/dist/cli/prs.test.d.ts +0 -8
- package/dist/cli/prs.test.d.ts.map +0 -1
- package/dist/cli/prs.test.js +0 -410
- package/dist/cli/prs.test.js.map +0 -1
- package/dist/cli/wt/completion.test.d.ts +0 -5
- package/dist/cli/wt/completion.test.d.ts.map +0 -1
- package/dist/cli/wt/completion.test.js +0 -173
- package/dist/cli/wt/completion.test.js.map +0 -1
- package/dist/cli/wt/config.test.d.ts +0 -5
- package/dist/cli/wt/config.test.d.ts.map +0 -1
- package/dist/cli/wt/config.test.js +0 -260
- package/dist/cli/wt/config.test.js.map +0 -1
- package/dist/cli/wt/entry.test.d.ts +0 -8
- package/dist/cli/wt/entry.test.d.ts.map +0 -1
- package/dist/cli/wt/entry.test.js +0 -201
- package/dist/cli/wt/entry.test.js.map +0 -1
- package/dist/cli/wt/init.test.d.ts +0 -5
- package/dist/cli/wt/init.test.d.ts.map +0 -1
- package/dist/cli/wt/init.test.js +0 -165
- package/dist/cli/wt/init.test.js.map +0 -1
- package/dist/cli/wt/init.unit.test.d.ts +0 -5
- package/dist/cli/wt/init.unit.test.d.ts.map +0 -1
- package/dist/cli/wt/init.unit.test.js +0 -432
- package/dist/cli/wt/init.unit.test.js.map +0 -1
- package/dist/cli/wt/interactive-menu.test.d.ts +0 -10
- package/dist/cli/wt/interactive-menu.test.d.ts.map +0 -1
- package/dist/cli/wt/interactive-menu.test.js +0 -739
- package/dist/cli/wt/interactive-menu.test.js.map +0 -1
- package/dist/cli/wt/prs.test.d.ts +0 -5
- package/dist/cli/wt/prs.test.d.ts.map +0 -1
- package/dist/cli/wt/prs.test.js +0 -410
- package/dist/cli/wt/prs.test.js.map +0 -1
- package/dist/cli/wt/run-command.test.d.ts +0 -5
- package/dist/cli/wt/run-command.test.d.ts.map +0 -1
- package/dist/cli/wt/run-command.test.js +0 -88
- package/dist/cli/wt/run-command.test.js.map +0 -1
- package/dist/cli/wt/wt.test.d.ts +0 -8
- package/dist/cli/wt/wt.test.d.ts.map +0 -1
- package/dist/cli/wt/wt.test.js +0 -521
- package/dist/cli/wt/wt.test.js.map +0 -1
- package/dist/cli/wt.unit.test.d.ts +0 -7
- package/dist/cli/wt.unit.test.d.ts.map +0 -1
- package/dist/cli/wt.unit.test.js +0 -182
- package/dist/cli/wt.unit.test.js.map +0 -1
- package/dist/cli/wtconfig.test.d.ts +0 -5
- package/dist/cli/wtconfig.test.d.ts.map +0 -1
- package/dist/cli/wtconfig.test.js +0 -1289
- package/dist/cli/wtconfig.test.js.map +0 -1
- package/dist/cli/wtlink.test.d.ts +0 -2
- package/dist/cli/wtlink.test.d.ts.map +0 -1
- package/dist/cli/wtlink.test.js +0 -249
- package/dist/cli/wtlink.test.js.map +0 -1
- package/dist/cli/wtstate.test.d.ts +0 -5
- package/dist/cli/wtstate.test.d.ts.map +0 -1
- package/dist/cli/wtstate.test.js +0 -193
- package/dist/cli/wtstate.test.js.map +0 -1
- package/dist/e2e/cleanpr/cleanpr.e2e.test.d.ts +0 -2
- package/dist/e2e/cleanpr/cleanpr.e2e.test.d.ts.map +0 -1
- package/dist/e2e/cleanpr/cleanpr.e2e.test.js +0 -326
- package/dist/e2e/cleanpr/cleanpr.e2e.test.js.map +0 -1
- package/dist/e2e/cli.e2e.test.d.ts +0 -2
- package/dist/e2e/cli.e2e.test.d.ts.map +0 -1
- package/dist/e2e/cli.e2e.test.js +0 -417
- package/dist/e2e/cli.e2e.test.js.map +0 -1
- package/dist/e2e/lswt/lswt.e2e.test.d.ts +0 -2
- package/dist/e2e/lswt/lswt.e2e.test.d.ts.map +0 -1
- package/dist/e2e/lswt/lswt.e2e.test.js +0 -361
- package/dist/e2e/lswt/lswt.e2e.test.js.map +0 -1
- package/dist/e2e/newpr/newpr.e2e.test.d.ts +0 -2
- package/dist/e2e/newpr/newpr.e2e.test.d.ts.map +0 -1
- package/dist/e2e/newpr/newpr.e2e.test.js +0 -286
- package/dist/e2e/newpr/newpr.e2e.test.js.map +0 -1
- package/dist/e2e/newpr/scenarios.e2e.test.d.ts +0 -2
- package/dist/e2e/newpr/scenarios.e2e.test.d.ts.map +0 -1
- package/dist/e2e/newpr/scenarios.e2e.test.js +0 -426
- package/dist/e2e/newpr/scenarios.e2e.test.js.map +0 -1
- package/dist/e2e/newpr-full-flow.e2e.test.d.ts +0 -2
- package/dist/e2e/newpr-full-flow.e2e.test.d.ts.map +0 -1
- package/dist/e2e/newpr-full-flow.e2e.test.js +0 -280
- package/dist/e2e/newpr-full-flow.e2e.test.js.map +0 -1
- package/dist/e2e/prs/prs.e2e.test.d.ts +0 -7
- package/dist/e2e/prs/prs.e2e.test.d.ts.map +0 -1
- package/dist/e2e/prs/prs.e2e.test.js +0 -606
- package/dist/e2e/prs/prs.e2e.test.js.map +0 -1
- package/dist/e2e/workflows/pr-lifecycle.e2e.test.d.ts +0 -2
- package/dist/e2e/workflows/pr-lifecycle.e2e.test.d.ts.map +0 -1
- package/dist/e2e/workflows/pr-lifecycle.e2e.test.js +0 -298
- package/dist/e2e/workflows/pr-lifecycle.e2e.test.js.map +0 -1
- package/dist/e2e/wt/interactive-menu.e2e.test.d.ts +0 -8
- package/dist/e2e/wt/interactive-menu.e2e.test.d.ts.map +0 -1
- package/dist/e2e/wt/interactive-menu.e2e.test.js +0 -583
- package/dist/e2e/wt/interactive-menu.e2e.test.js.map +0 -1
- package/dist/e2e/wt/wt.e2e.test.d.ts +0 -9
- package/dist/e2e/wt/wt.e2e.test.d.ts.map +0 -1
- package/dist/e2e/wt/wt.e2e.test.js +0 -597
- package/dist/e2e/wt/wt.e2e.test.js.map +0 -1
- package/dist/e2e/wtlink/wtlink.e2e.test.d.ts +0 -2
- package/dist/e2e/wtlink/wtlink.e2e.test.d.ts.map +0 -1
- package/dist/e2e/wtlink/wtlink.e2e.test.js +0 -416
- package/dist/e2e/wtlink/wtlink.e2e.test.js.map +0 -1
- package/dist/integration/git.integration.test.d.ts +0 -2
- package/dist/integration/git.integration.test.d.ts.map +0 -1
- package/dist/integration/git.integration.test.js +0 -336
- package/dist/integration/git.integration.test.js.map +0 -1
- package/dist/integration/lswt-remote-pr.integration.test.d.ts +0 -2
- package/dist/integration/lswt-remote-pr.integration.test.d.ts.map +0 -1
- package/dist/integration/lswt-remote-pr.integration.test.js +0 -222
- package/dist/integration/lswt-remote-pr.integration.test.js.map +0 -1
- package/dist/integration/newpr-branchfrom-head.integration.test.d.ts +0 -2
- package/dist/integration/newpr-branchfrom-head.integration.test.d.ts.map +0 -1
- package/dist/integration/newpr-branchfrom-head.integration.test.js +0 -498
- package/dist/integration/newpr-branchfrom-head.integration.test.js.map +0 -1
- package/dist/integration/newpr.integration.test.d.ts +0 -2
- package/dist/integration/newpr.integration.test.d.ts.map +0 -1
- package/dist/integration/newpr.integration.test.js +0 -460
- package/dist/integration/newpr.integration.test.js.map +0 -1
- package/dist/integration/prs.integration.test.d.ts +0 -8
- package/dist/integration/prs.integration.test.d.ts.map +0 -1
- package/dist/integration/prs.integration.test.js +0 -478
- package/dist/integration/prs.integration.test.js.map +0 -1
- package/dist/lib/ai/base-provider.test.d.ts +0 -7
- package/dist/lib/ai/base-provider.test.d.ts.map +0 -1
- package/dist/lib/ai/base-provider.test.js +0 -319
- package/dist/lib/ai/base-provider.test.js.map +0 -1
- package/dist/lib/ai/cli-provider.test.d.ts +0 -5
- package/dist/lib/ai/cli-provider.test.d.ts.map +0 -1
- package/dist/lib/ai/cli-provider.test.js +0 -460
- package/dist/lib/ai/cli-provider.test.js.map +0 -1
- package/dist/lib/ai/fallback-provider.test.d.ts +0 -7
- package/dist/lib/ai/fallback-provider.test.d.ts.map +0 -1
- package/dist/lib/ai/fallback-provider.test.js +0 -165
- package/dist/lib/ai/fallback-provider.test.js.map +0 -1
- package/dist/lib/ai/generation-service.test.d.ts +0 -7
- package/dist/lib/ai/generation-service.test.d.ts.map +0 -1
- package/dist/lib/ai/generation-service.test.js +0 -213
- package/dist/lib/ai/generation-service.test.js.map +0 -1
- package/dist/lib/ai/provider-manager.test.d.ts +0 -5
- package/dist/lib/ai/provider-manager.test.d.ts.map +0 -1
- package/dist/lib/ai/provider-manager.test.js +0 -312
- package/dist/lib/ai/provider-manager.test.js.map +0 -1
- package/dist/lib/ai/repo-docs.test.d.ts +0 -5
- package/dist/lib/ai/repo-docs.test.d.ts.map +0 -1
- package/dist/lib/ai/repo-docs.test.js +0 -357
- package/dist/lib/ai/repo-docs.test.js.map +0 -1
- package/dist/lib/cleanpr/args.test.d.ts +0 -2
- package/dist/lib/cleanpr/args.test.d.ts.map +0 -1
- package/dist/lib/cleanpr/args.test.js +0 -269
- package/dist/lib/cleanpr/args.test.js.map +0 -1
- package/dist/lib/cleanpr/cleanup.test.d.ts +0 -2
- package/dist/lib/cleanpr/cleanup.test.d.ts.map +0 -1
- package/dist/lib/cleanpr/cleanup.test.js +0 -296
- package/dist/lib/cleanpr/cleanup.test.js.map +0 -1
- package/dist/lib/cleanpr/worktree-info.test.d.ts +0 -2
- package/dist/lib/cleanpr/worktree-info.test.d.ts.map +0 -1
- package/dist/lib/cleanpr/worktree-info.test.js +0 -228
- package/dist/lib/cleanpr/worktree-info.test.js.map +0 -1
- package/dist/lib/colors.test.d.ts +0 -2
- package/dist/lib/colors.test.d.ts.map +0 -1
- package/dist/lib/colors.test.js +0 -142
- package/dist/lib/colors.test.js.map +0 -1
- package/dist/lib/config-editor.test.d.ts +0 -11
- package/dist/lib/config-editor.test.d.ts.map +0 -1
- package/dist/lib/config-editor.test.js +0 -526
- package/dist/lib/config-editor.test.js.map +0 -1
- package/dist/lib/config-migration/detector.test.d.ts +0 -5
- package/dist/lib/config-migration/detector.test.d.ts.map +0 -1
- package/dist/lib/config-migration/detector.test.js +0 -201
- package/dist/lib/config-migration/detector.test.js.map +0 -1
- package/dist/lib/config-migration/reporter.test.d.ts +0 -5
- package/dist/lib/config-migration/reporter.test.d.ts.map +0 -1
- package/dist/lib/config-migration/reporter.test.js +0 -305
- package/dist/lib/config-migration/reporter.test.js.map +0 -1
- package/dist/lib/config-migration/runner.test.d.ts +0 -5
- package/dist/lib/config-migration/runner.test.d.ts.map +0 -1
- package/dist/lib/config-migration/runner.test.js +0 -235
- package/dist/lib/config-migration/runner.test.js.map +0 -1
- package/dist/lib/config-validation.test.d.ts +0 -5
- package/dist/lib/config-validation.test.d.ts.map +0 -1
- package/dist/lib/config-validation.test.js +0 -423
- package/dist/lib/config-validation.test.js.map +0 -1
- package/dist/lib/config.test.d.ts +0 -2
- package/dist/lib/config.test.d.ts.map +0 -1
- package/dist/lib/config.test.js +0 -566
- package/dist/lib/config.test.js.map +0 -1
- package/dist/lib/constants.test.d.ts +0 -5
- package/dist/lib/constants.test.d.ts.map +0 -1
- package/dist/lib/constants.test.js +0 -121
- package/dist/lib/constants.test.js.map +0 -1
- package/dist/lib/errors.test.d.ts +0 -2
- package/dist/lib/errors.test.d.ts.map +0 -1
- package/dist/lib/errors.test.js +0 -117
- package/dist/lib/errors.test.js.map +0 -1
- package/dist/lib/git.test.d.ts +0 -2
- package/dist/lib/git.test.d.ts.map +0 -1
- package/dist/lib/git.test.js +0 -608
- package/dist/lib/git.test.js.map +0 -1
- package/dist/lib/github.test.d.ts +0 -2
- package/dist/lib/github.test.d.ts.map +0 -1
- package/dist/lib/github.test.js +0 -441
- package/dist/lib/github.test.js.map +0 -1
- package/dist/lib/global-check.test.d.ts +0 -5
- package/dist/lib/global-check.test.d.ts.map +0 -1
- package/dist/lib/global-check.test.js +0 -150
- package/dist/lib/global-check.test.js.map +0 -1
- package/dist/lib/global-config.test.d.ts +0 -5
- package/dist/lib/global-config.test.d.ts.map +0 -1
- package/dist/lib/global-config.test.js +0 -282
- package/dist/lib/global-config.test.js.map +0 -1
- package/dist/lib/hooks/confirmation.test.d.ts +0 -7
- package/dist/lib/hooks/confirmation.test.d.ts.map +0 -1
- package/dist/lib/hooks/confirmation.test.js +0 -300
- package/dist/lib/hooks/confirmation.test.js.map +0 -1
- package/dist/lib/hooks/executor.test.d.ts +0 -5
- package/dist/lib/hooks/executor.test.d.ts.map +0 -1
- package/dist/lib/hooks/executor.test.js +0 -648
- package/dist/lib/hooks/executor.test.js.map +0 -1
- package/dist/lib/hooks/templates.test.d.ts +0 -5
- package/dist/lib/hooks/templates.test.d.ts.map +0 -1
- package/dist/lib/hooks/templates.test.js +0 -163
- package/dist/lib/hooks/templates.test.js.map +0 -1
- package/dist/lib/hooks/types.test.d.ts +0 -5
- package/dist/lib/hooks/types.test.d.ts.map +0 -1
- package/dist/lib/hooks/types.test.js +0 -132
- package/dist/lib/hooks/types.test.js.map +0 -1
- package/dist/lib/json-output.test.d.ts +0 -5
- package/dist/lib/json-output.test.d.ts.map +0 -1
- package/dist/lib/json-output.test.js +0 -261
- package/dist/lib/json-output.test.js.map +0 -1
- package/dist/lib/logger.test.d.ts +0 -5
- package/dist/lib/logger.test.d.ts.map +0 -1
- package/dist/lib/logger.test.js +0 -292
- package/dist/lib/logger.test.js.map +0 -1
- package/dist/lib/lswt/action-executors.test.d.ts +0 -2
- package/dist/lib/lswt/action-executors.test.d.ts.map +0 -1
- package/dist/lib/lswt/action-executors.test.js +0 -1127
- package/dist/lib/lswt/action-executors.test.js.map +0 -1
- package/dist/lib/lswt/actions.test.d.ts +0 -2
- package/dist/lib/lswt/actions.test.d.ts.map +0 -1
- package/dist/lib/lswt/actions.test.js +0 -497
- package/dist/lib/lswt/actions.test.js.map +0 -1
- package/dist/lib/lswt/args.test.d.ts +0 -2
- package/dist/lib/lswt/args.test.d.ts.map +0 -1
- package/dist/lib/lswt/args.test.js +0 -195
- package/dist/lib/lswt/args.test.js.map +0 -1
- package/dist/lib/lswt/environment.test.d.ts +0 -2
- package/dist/lib/lswt/environment.test.d.ts.map +0 -1
- package/dist/lib/lswt/environment.test.js +0 -544
- package/dist/lib/lswt/environment.test.js.map +0 -1
- package/dist/lib/lswt/formatters.test.d.ts +0 -2
- package/dist/lib/lswt/formatters.test.d.ts.map +0 -1
- package/dist/lib/lswt/formatters.test.js +0 -323
- package/dist/lib/lswt/formatters.test.js.map +0 -1
- package/dist/lib/lswt/fuzzy-search.test.d.ts +0 -5
- package/dist/lib/lswt/fuzzy-search.test.d.ts.map +0 -1
- package/dist/lib/lswt/fuzzy-search.test.js +0 -207
- package/dist/lib/lswt/fuzzy-search.test.js.map +0 -1
- package/dist/lib/lswt/interactive.test.d.ts +0 -2
- package/dist/lib/lswt/interactive.test.d.ts.map +0 -1
- package/dist/lib/lswt/interactive.test.js +0 -771
- package/dist/lib/lswt/interactive.test.js.map +0 -1
- package/dist/lib/lswt/worktree-info.test.d.ts +0 -2
- package/dist/lib/lswt/worktree-info.test.d.ts.map +0 -1
- package/dist/lib/lswt/worktree-info.test.js +0 -484
- package/dist/lib/lswt/worktree-info.test.js.map +0 -1
- package/dist/lib/newpr/action-deps.test.d.ts +0 -5
- package/dist/lib/newpr/action-deps.test.d.ts.map +0 -1
- package/dist/lib/newpr/action-deps.test.js +0 -111
- package/dist/lib/newpr/action-deps.test.js.map +0 -1
- package/dist/lib/newpr/actions.test.d.ts +0 -2
- package/dist/lib/newpr/actions.test.d.ts.map +0 -1
- package/dist/lib/newpr/actions.test.js +0 -254
- package/dist/lib/newpr/actions.test.js.map +0 -1
- package/dist/lib/newpr/args.test.d.ts +0 -2
- package/dist/lib/newpr/args.test.d.ts.map +0 -1
- package/dist/lib/newpr/args.test.js +0 -479
- package/dist/lib/newpr/args.test.js.map +0 -1
- package/dist/lib/newpr/hook-runner.test.d.ts +0 -7
- package/dist/lib/newpr/hook-runner.test.d.ts.map +0 -1
- package/dist/lib/newpr/hook-runner.test.js +0 -422
- package/dist/lib/newpr/hook-runner.test.js.map +0 -1
- package/dist/lib/newpr/plan-generator.test.d.ts +0 -7
- package/dist/lib/newpr/plan-generator.test.d.ts.map +0 -1
- package/dist/lib/newpr/plan-generator.test.js +0 -387
- package/dist/lib/newpr/plan-generator.test.js.map +0 -1
- package/dist/lib/newpr/scenario-handler.test.d.ts +0 -2
- package/dist/lib/newpr/scenario-handler.test.d.ts.map +0 -1
- package/dist/lib/newpr/scenario-handler.test.js +0 -256
- package/dist/lib/newpr/scenario-handler.test.js.map +0 -1
- package/dist/lib/prompts.test.d.ts +0 -2
- package/dist/lib/prompts.test.d.ts.map +0 -1
- package/dist/lib/prompts.test.js +0 -807
- package/dist/lib/prompts.test.js.map +0 -1
- package/dist/lib/prs/actions.test.d.ts +0 -5
- package/dist/lib/prs/actions.test.d.ts.map +0 -1
- package/dist/lib/prs/actions.test.js +0 -356
- package/dist/lib/prs/actions.test.js.map +0 -1
- package/dist/lib/prs/data.test.d.ts +0 -5
- package/dist/lib/prs/data.test.d.ts.map +0 -1
- package/dist/lib/prs/data.test.js +0 -417
- package/dist/lib/prs/data.test.js.map +0 -1
- package/dist/lib/prs/details.test.d.ts +0 -5
- package/dist/lib/prs/details.test.d.ts.map +0 -1
- package/dist/lib/prs/details.test.js +0 -325
- package/dist/lib/prs/details.test.js.map +0 -1
- package/dist/lib/prs/filters.test.d.ts +0 -5
- package/dist/lib/prs/filters.test.d.ts.map +0 -1
- package/dist/lib/prs/filters.test.js +0 -312
- package/dist/lib/prs/filters.test.js.map +0 -1
- package/dist/lib/prs/formatters.test.d.ts +0 -2
- package/dist/lib/prs/formatters.test.d.ts.map +0 -1
- package/dist/lib/prs/formatters.test.js +0 -387
- package/dist/lib/prs/formatters.test.js.map +0 -1
- package/dist/lib/prs/interactive.test.d.ts +0 -5
- package/dist/lib/prs/interactive.test.d.ts.map +0 -1
- package/dist/lib/prs/interactive.test.js +0 -364
- package/dist/lib/prs/interactive.test.js.map +0 -1
- package/dist/lib/schema.test.d.ts +0 -10
- package/dist/lib/schema.test.d.ts.map +0 -1
- package/dist/lib/schema.test.js +0 -309
- package/dist/lib/schema.test.js.map +0 -1
- package/dist/lib/state-detection.test.d.ts +0 -2
- package/dist/lib/state-detection.test.d.ts.map +0 -1
- package/dist/lib/state-detection.test.js +0 -451
- package/dist/lib/state-detection.test.js.map +0 -1
- package/dist/lib/wtconfig/config-manager.test.d.ts +0 -5
- package/dist/lib/wtconfig/config-manager.test.d.ts.map +0 -1
- package/dist/lib/wtconfig/config-manager.test.js +0 -501
- package/dist/lib/wtconfig/config-manager.test.js.map +0 -1
- package/dist/lib/wtconfig/environment.test.d.ts +0 -5
- package/dist/lib/wtconfig/environment.test.d.ts.map +0 -1
- package/dist/lib/wtconfig/environment.test.js +0 -285
- package/dist/lib/wtconfig/environment.test.js.map +0 -1
- package/dist/lib/wtlink/config-manifest.test.d.ts +0 -2
- package/dist/lib/wtlink/config-manifest.test.d.ts.map +0 -1
- package/dist/lib/wtlink/config-manifest.test.js +0 -486
- package/dist/lib/wtlink/config-manifest.test.js.map +0 -1
- package/dist/lib/wtlink/link-configs.test.d.ts +0 -2
- package/dist/lib/wtlink/link-configs.test.d.ts.map +0 -1
- package/dist/lib/wtlink/link-configs.test.js +0 -612
- package/dist/lib/wtlink/link-configs.test.js.map +0 -1
- package/dist/lib/wtlink/main-menu.test.d.ts +0 -5
- package/dist/lib/wtlink/main-menu.test.d.ts.map +0 -1
- package/dist/lib/wtlink/main-menu.test.js +0 -126
- package/dist/lib/wtlink/main-menu.test.js.map +0 -1
- package/dist/lib/wtlink/manage-manifest.test.d.ts +0 -2
- package/dist/lib/wtlink/manage-manifest.test.d.ts.map +0 -1
- package/dist/lib/wtlink/manage-manifest.test.js +0 -714
- package/dist/lib/wtlink/manage-manifest.test.js.map +0 -1
- package/dist/lib/wtlink/validate-manifest.test.d.ts +0 -2
- package/dist/lib/wtlink/validate-manifest.test.d.ts.map +0 -1
- package/dist/lib/wtlink/validate-manifest.test.js +0 -220
- package/dist/lib/wtlink/validate-manifest.test.js.map +0 -1
- package/dist/lib/wtstate/analyze.test.d.ts +0 -5
- package/dist/lib/wtstate/analyze.test.d.ts.map +0 -1
- package/dist/lib/wtstate/analyze.test.js +0 -282
- package/dist/lib/wtstate/analyze.test.js.map +0 -1
- package/dist/lib/wtstate/args.test.d.ts +0 -5
- package/dist/lib/wtstate/args.test.d.ts.map +0 -1
- package/dist/lib/wtstate/args.test.js +0 -120
- package/dist/lib/wtstate/args.test.js.map +0 -1
- package/dist/mcp/server.test.d.ts +0 -9
- package/dist/mcp/server.test.d.ts.map +0 -1
- package/dist/mcp/server.test.js +0 -439
- package/dist/mcp/server.test.js.map +0 -1
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Generates shell completion scripts for bash, zsh, and fish.
|
|
5
5
|
*/
|
|
6
|
-
const BASH_COMPLETION = `###-begin-wt-completions-###
|
|
6
|
+
export const BASH_COMPLETION = `###-begin-wt-completions-###
|
|
7
7
|
#
|
|
8
8
|
# wt bash completion script
|
|
9
9
|
#
|
|
@@ -32,7 +32,7 @@ _wt_yargs_completions()
|
|
|
32
32
|
}
|
|
33
33
|
complete -o bashdefault -o default -F _wt_yargs_completions wt
|
|
34
34
|
###-end-wt-completions-###`;
|
|
35
|
-
const ZSH_COMPLETION = `#compdef wt
|
|
35
|
+
export const ZSH_COMPLETION = `#compdef wt
|
|
36
36
|
###-begin-wt-completions-###
|
|
37
37
|
#
|
|
38
38
|
# wt zsh completion script
|
|
@@ -58,6 +58,8 @@ _wt() {
|
|
|
58
58
|
's:Query git worktree state'
|
|
59
59
|
'config:Configuration management'
|
|
60
60
|
'cfg:Configuration management'
|
|
61
|
+
'prs:Browse repository pull requests'
|
|
62
|
+
'init:Initialize configuration'
|
|
61
63
|
'completion:Generate shell completion scripts'
|
|
62
64
|
)
|
|
63
65
|
|
|
@@ -78,8 +80,16 @@ _wt() {
|
|
|
78
80
|
'--draft[Create as draft PR]' \\
|
|
79
81
|
'--json[Output result as JSON]' \\
|
|
80
82
|
'--non-interactive[Run without prompts]' \\
|
|
81
|
-
'--action[Action to take]:action:(
|
|
82
|
-
'--
|
|
83
|
+
'--action[Action to take]:action:(empty_commit commit_staged commit_all stash_and_empty use_commits push_then_branch use_commits_and_commit_all use_commits_and_stash create_pr_for_branch pr_for_branch_commit_all pr_for_branch_stash branch_from_detached)' \\
|
|
84
|
+
'--no-wtlink[Skip wtlink config sync]' \\
|
|
85
|
+
'--no-hooks[Disable lifecycle hooks]' \\
|
|
86
|
+
'--confirm-hooks[Prompt before running hooks]' \\
|
|
87
|
+
'--plan[Generate AI plan document]' \\
|
|
88
|
+
'--no-plan[Skip plan generation]' \\
|
|
89
|
+
'--ready[Create PR as ready for review]' \\
|
|
90
|
+
'--install[Install dependencies after setup]' \\
|
|
91
|
+
'--code[Open editor to the new worktree]' \\
|
|
92
|
+
'--base[Base branch for PR]:branch:'
|
|
83
93
|
;;
|
|
84
94
|
list|ls)
|
|
85
95
|
_arguments \\
|
|
@@ -87,7 +97,8 @@ _wt() {
|
|
|
87
97
|
'--json[Output as JSON]' \\
|
|
88
98
|
'--no-status[Skip GitHub PR status lookup]' \\
|
|
89
99
|
'--no-interactive[Disable interactive mode]' \\
|
|
90
|
-
'--filter[Filter worktrees by type]:filter:(pr main feature)'
|
|
100
|
+
'--filter[Filter worktrees by type]:filter:(pr main feature)' \\
|
|
101
|
+
'--refresh[Force refresh PR status from GitHub]'
|
|
91
102
|
;;
|
|
92
103
|
clean|c)
|
|
93
104
|
_arguments \\
|
|
@@ -95,6 +106,7 @@ _wt() {
|
|
|
95
106
|
'--all[Clean all merged/closed worktrees]' \\
|
|
96
107
|
'--dry-run[Show what would be cleaned]' \\
|
|
97
108
|
'--force[Force cleanup even with uncommitted changes]' \\
|
|
109
|
+
'--delete-remote[Delete remote branches after cleaning]' \\
|
|
98
110
|
'--json[Output result as JSON]'
|
|
99
111
|
;;
|
|
100
112
|
link|l)
|
|
@@ -105,13 +117,35 @@ _wt() {
|
|
|
105
117
|
state|s)
|
|
106
118
|
_arguments \\
|
|
107
119
|
'--json[Output as JSON]' \\
|
|
120
|
+
'--verbose[Show detailed state information]' \\
|
|
121
|
+
'--base-branch[Base branch to compare against]:branch:' \\
|
|
108
122
|
'--quiet[Only output state name]'
|
|
109
123
|
;;
|
|
110
124
|
config|cfg)
|
|
111
125
|
_arguments \\
|
|
112
|
-
'1:command:(
|
|
126
|
+
'1:command:(interactive init show set get edit validate migrate schema)' \\
|
|
127
|
+
'--json[Output as JSON]' \\
|
|
113
128
|
'--help[Show help]'
|
|
114
129
|
;;
|
|
130
|
+
prs)
|
|
131
|
+
_arguments \\
|
|
132
|
+
'--state[Filter by PR state]:state:(open closed merged all)' \\
|
|
133
|
+
'--author[Filter by author]:author:' \\
|
|
134
|
+
'--label[Filter by label]:label:' \\
|
|
135
|
+
'--draft[Show only draft PRs]' \\
|
|
136
|
+
'--no-draft[Exclude draft PRs]' \\
|
|
137
|
+
'--with-worktree[Show only PRs with local worktrees]' \\
|
|
138
|
+
'--limit[Maximum PRs to fetch]:number:' \\
|
|
139
|
+
'--json[Output as JSON]' \\
|
|
140
|
+
'--no-interactive[Disable interactive mode]' \\
|
|
141
|
+
'--refresh[Force refresh from GitHub]'
|
|
142
|
+
;;
|
|
143
|
+
init)
|
|
144
|
+
_arguments \\
|
|
145
|
+
'--local[Create local config]' \\
|
|
146
|
+
'--global[Create global config]' \\
|
|
147
|
+
'--force[Overwrite existing config]'
|
|
148
|
+
;;
|
|
115
149
|
completion)
|
|
116
150
|
_arguments \\
|
|
117
151
|
'1:shell:(bash zsh fish)'
|
|
@@ -123,7 +157,7 @@ _wt() {
|
|
|
123
157
|
|
|
124
158
|
_wt "$@"
|
|
125
159
|
###-end-wt-completions-###`;
|
|
126
|
-
const FISH_COMPLETION = `# wt fish completion script
|
|
160
|
+
export const FISH_COMPLETION = `# wt fish completion script
|
|
127
161
|
#
|
|
128
162
|
# Installation:
|
|
129
163
|
# wt completion fish > ~/.config/fish/completions/wt.fish
|
|
@@ -145,15 +179,27 @@ complete -c wt -n '__fish_use_subcommand' -a 'state' -d 'Query git worktree stat
|
|
|
145
179
|
complete -c wt -n '__fish_use_subcommand' -a 's' -d 'Query state (alias)'
|
|
146
180
|
complete -c wt -n '__fish_use_subcommand' -a 'config' -d 'Configuration management'
|
|
147
181
|
complete -c wt -n '__fish_use_subcommand' -a 'cfg' -d 'Config (alias)'
|
|
182
|
+
complete -c wt -n '__fish_use_subcommand' -a 'prs' -d 'Browse repository pull requests'
|
|
183
|
+
complete -c wt -n '__fish_use_subcommand' -a 'init' -d 'Initialize configuration'
|
|
148
184
|
complete -c wt -n '__fish_use_subcommand' -a 'completion' -d 'Generate shell completion scripts'
|
|
149
185
|
|
|
150
186
|
# new/n options
|
|
151
187
|
complete -c wt -n '__fish_seen_subcommand_from new n' -l pr -s p -d 'Existing PR number' -r
|
|
188
|
+
complete -c wt -n '__fish_seen_subcommand_from new n' -l branch -s B -d 'Create PR for existing branch' -r
|
|
189
|
+
complete -c wt -n '__fish_seen_subcommand_from new n' -l base -s b -d 'Base branch for PR' -r
|
|
152
190
|
complete -c wt -n '__fish_seen_subcommand_from new n' -l draft -s d -d 'Create as draft PR'
|
|
191
|
+
complete -c wt -n '__fish_seen_subcommand_from new n' -l ready -s r -d 'Create PR as ready for review'
|
|
192
|
+
complete -c wt -n '__fish_seen_subcommand_from new n' -l install -s i -d 'Install dependencies after setup'
|
|
193
|
+
complete -c wt -n '__fish_seen_subcommand_from new n' -l code -s c -d 'Open editor to the new worktree'
|
|
194
|
+
complete -c wt -n '__fish_seen_subcommand_from new n' -l no-wtlink -d 'Skip wtlink config sync'
|
|
195
|
+
complete -c wt -n '__fish_seen_subcommand_from new n' -l no-hooks -d 'Disable lifecycle hooks'
|
|
196
|
+
complete -c wt -n '__fish_seen_subcommand_from new n' -l confirm-hooks -d 'Prompt before running hooks'
|
|
197
|
+
complete -c wt -n '__fish_seen_subcommand_from new n' -l plan -d 'Generate AI plan document'
|
|
198
|
+
complete -c wt -n '__fish_seen_subcommand_from new n' -l no-plan -d 'Skip plan generation'
|
|
153
199
|
complete -c wt -n '__fish_seen_subcommand_from new n' -l json -d 'Output result as JSON'
|
|
154
200
|
complete -c wt -n '__fish_seen_subcommand_from new n' -l non-interactive -s n -d 'Run without prompts'
|
|
155
|
-
complete -c wt -n '__fish_seen_subcommand_from new n' -l
|
|
156
|
-
complete -c wt -n '__fish_seen_subcommand_from new n' -l
|
|
201
|
+
complete -c wt -n '__fish_seen_subcommand_from new n' -l yes -s y -d 'Run without prompts'
|
|
202
|
+
complete -c wt -n '__fish_seen_subcommand_from new n' -l action -s a -d 'Action to take' -ra 'empty_commit commit_staged commit_all stash_and_empty use_commits push_then_branch use_commits_and_commit_all use_commits_and_stash create_pr_for_branch pr_for_branch_commit_all pr_for_branch_stash branch_from_detached'
|
|
157
203
|
|
|
158
204
|
# list/ls options
|
|
159
205
|
complete -c wt -n '__fish_seen_subcommand_from list ls' -l verbose -s v -d 'Show full paths'
|
|
@@ -161,13 +207,32 @@ complete -c wt -n '__fish_seen_subcommand_from list ls' -l json -d 'Output as JS
|
|
|
161
207
|
complete -c wt -n '__fish_seen_subcommand_from list ls' -l no-status -s s -d 'Skip GitHub PR status'
|
|
162
208
|
complete -c wt -n '__fish_seen_subcommand_from list ls' -l no-interactive -s n -d 'Disable interactive mode'
|
|
163
209
|
complete -c wt -n '__fish_seen_subcommand_from list ls' -l filter -s f -d 'Filter by type' -ra 'pr main feature'
|
|
210
|
+
complete -c wt -n '__fish_seen_subcommand_from list ls' -l refresh -d 'Force refresh PR status from GitHub'
|
|
164
211
|
|
|
165
212
|
# clean/c options
|
|
166
213
|
complete -c wt -n '__fish_seen_subcommand_from clean c' -l all -s a -d 'Clean all merged/closed'
|
|
167
214
|
complete -c wt -n '__fish_seen_subcommand_from clean c' -l dry-run -s d -d 'Preview only'
|
|
168
215
|
complete -c wt -n '__fish_seen_subcommand_from clean c' -l force -s f -d 'Force cleanup'
|
|
216
|
+
complete -c wt -n '__fish_seen_subcommand_from clean c' -l delete-remote -s r -d 'Delete remote branches'
|
|
169
217
|
complete -c wt -n '__fish_seen_subcommand_from clean c' -l json -d 'Output as JSON'
|
|
170
218
|
|
|
219
|
+
# prs options
|
|
220
|
+
complete -c wt -n '__fish_seen_subcommand_from prs' -l state -s s -d 'Filter by PR state' -ra 'open closed merged all'
|
|
221
|
+
complete -c wt -n '__fish_seen_subcommand_from prs' -l author -s a -d 'Filter by author' -r
|
|
222
|
+
complete -c wt -n '__fish_seen_subcommand_from prs' -l label -s l -d 'Filter by label' -r
|
|
223
|
+
complete -c wt -n '__fish_seen_subcommand_from prs' -l draft -d 'Show only draft PRs'
|
|
224
|
+
complete -c wt -n '__fish_seen_subcommand_from prs' -l no-draft -d 'Exclude draft PRs'
|
|
225
|
+
complete -c wt -n '__fish_seen_subcommand_from prs' -l with-worktree -d 'Only PRs with local worktrees'
|
|
226
|
+
complete -c wt -n '__fish_seen_subcommand_from prs' -l limit -s n -d 'Maximum PRs to fetch' -r
|
|
227
|
+
complete -c wt -n '__fish_seen_subcommand_from prs' -l json -s j -d 'Output as JSON'
|
|
228
|
+
complete -c wt -n '__fish_seen_subcommand_from prs' -l no-interactive -d 'Disable interactive mode'
|
|
229
|
+
complete -c wt -n '__fish_seen_subcommand_from prs' -l refresh -s r -d 'Force refresh from GitHub'
|
|
230
|
+
|
|
231
|
+
# init options
|
|
232
|
+
complete -c wt -n '__fish_seen_subcommand_from init' -l local -s l -d 'Create local config'
|
|
233
|
+
complete -c wt -n '__fish_seen_subcommand_from init' -l global -s g -d 'Create global config'
|
|
234
|
+
complete -c wt -n '__fish_seen_subcommand_from init' -l force -s f -d 'Overwrite existing config'
|
|
235
|
+
|
|
171
236
|
# link/l subcommands
|
|
172
237
|
complete -c wt -n '__fish_seen_subcommand_from link l' -a 'link' -d 'Create hard links'
|
|
173
238
|
complete -c wt -n '__fish_seen_subcommand_from link l' -a 'manage' -d 'Manage manifest'
|
|
@@ -175,12 +240,18 @@ complete -c wt -n '__fish_seen_subcommand_from link l' -a 'validate' -d 'Validat
|
|
|
175
240
|
|
|
176
241
|
# state/s options
|
|
177
242
|
complete -c wt -n '__fish_seen_subcommand_from state s' -l json -d 'Output as JSON'
|
|
243
|
+
complete -c wt -n '__fish_seen_subcommand_from state s' -l verbose -s v -d 'Show detailed state'
|
|
244
|
+
complete -c wt -n '__fish_seen_subcommand_from state s' -l base-branch -s b -d 'Base branch to compare against' -r
|
|
178
245
|
complete -c wt -n '__fish_seen_subcommand_from state s' -l quiet -s q -d 'Only output state name'
|
|
179
246
|
|
|
180
247
|
# config/cfg subcommands
|
|
181
248
|
complete -c wt -n '__fish_seen_subcommand_from config cfg' -a 'show' -d 'Show config'
|
|
182
249
|
complete -c wt -n '__fish_seen_subcommand_from config cfg' -a 'init' -d 'Initialize config'
|
|
250
|
+
complete -c wt -n '__fish_seen_subcommand_from config cfg' -a 'set' -d 'Set config value'
|
|
251
|
+
complete -c wt -n '__fish_seen_subcommand_from config cfg' -a 'get' -d 'Get config value'
|
|
183
252
|
complete -c wt -n '__fish_seen_subcommand_from config cfg' -a 'edit' -d 'Edit config'
|
|
253
|
+
complete -c wt -n '__fish_seen_subcommand_from config cfg' -a 'validate' -d 'Validate config'
|
|
254
|
+
complete -c wt -n '__fish_seen_subcommand_from config cfg' -a 'migrate' -d 'Migrate legacy config'
|
|
184
255
|
|
|
185
256
|
# completion shells
|
|
186
257
|
complete -c wt -n '__fish_seen_subcommand_from completion' -a 'bash' -d 'Bash completion'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"completion.js","sourceRoot":"","sources":["../../../src/cli/wt/completion.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAQH,MAAM,eAAe,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"completion.js","sourceRoot":"","sources":["../../../src/cli/wt/completion.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAQH,MAAM,CAAC,MAAM,eAAe,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BA4BJ,CAAC;AAE5B,MAAM,CAAC,MAAM,cAAc,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BA4HH,CAAC;AAE5B,MAAM,CAAC,MAAM,eAAe,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoG9B,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAA0C;IACtE,OAAO,EAAE,oBAAoB;IAC7B,QAAQ,EAAE,mCAAmC;IAC7C,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;QACjB,OAAO,KAAK;aACT,UAAU,CAAC,OAAO,EAAE;YACnB,QAAQ,EAAE,YAAY;YACtB,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC;SACjC,CAAC;aACD,OAAO,CAAC,iCAAiC,EAAE,qCAAqC,CAAC;aACjF,OAAO,CAAC,4CAA4C,EAAE,4BAA4B,CAAC;aACnF,OAAO,CACN,yDAAyD,EACzD,6BAA6B,CAC9B,CAAC;IACN,CAAC;IACD,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE;QAChB,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;YAChB,OAAO,CAAC,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;CAwBjB,CAAC,CAAC;YACG,OAAO;QACT,CAAC;QAED,QAAQ,IAAI,CAAC,KAAK,EAAE,CAAC;YACnB,KAAK,MAAM;gBACT,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;gBAC7B,MAAM;YACR,KAAK,KAAK;gBACR,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;gBAC5B,MAAM;YACR,KAAK,MAAM;gBACT,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;gBAC7B,MAAM;QACV,CAAC;IACH,CAAC;CACF,CAAC"}
|
package/dist/cli/wt/config.d.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* wt config - Configuration management
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Direct library call handler - no subprocess spawning.
|
|
5
|
+
* Handles all config subcommands in-process via library imports.
|
|
5
6
|
*/
|
|
6
7
|
import type { CommandModule } from 'yargs';
|
|
7
8
|
interface ConfigArgs {
|
|
8
9
|
subcommand?: string;
|
|
9
10
|
args?: string[];
|
|
11
|
+
json?: boolean;
|
|
10
12
|
}
|
|
11
13
|
export declare const configCommand: CommandModule<object, ConfigArgs>;
|
|
12
14
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/cli/wt/config.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/cli/wt/config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAmC3C,UAAU,UAAU;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAaD,eAAO,MAAM,aAAa,EAAE,aAAa,CAAC,MAAM,EAAE,UAAU,CA0E3D,CAAC"}
|
package/dist/cli/wt/config.js
CHANGED
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* wt config - Configuration management
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Direct library call handler - no subprocess spawning.
|
|
5
|
+
* Handles all config subcommands in-process via library imports.
|
|
5
6
|
*/
|
|
6
|
-
import
|
|
7
|
+
import * as fs from 'fs';
|
|
8
|
+
import { spawnSync } from 'child_process';
|
|
7
9
|
import * as git from '../../lib/git.js';
|
|
8
10
|
import { runConfigEditor, quickEditConfig } from '../../lib/config-editor.js';
|
|
9
|
-
import { loadConfigWithValidation, getConfigPath } from '../../lib/config.js';
|
|
11
|
+
import { loadConfigWithValidation, getConfigPath, getDefaultConfig } from '../../lib/config.js';
|
|
10
12
|
import { formatValidationErrors } from '../../lib/config-validation.js';
|
|
11
13
|
import { getSchemaUrl } from '../../lib/global-config.js';
|
|
12
14
|
import * as colors from '../../lib/colors.js';
|
|
15
|
+
import { getConfigSource, loadMergedConfig, getConfigValue, setConfigValue, validateConfig, loadRepoConfig, saveRepoConfig, getGlobalConfigPath, findRepoConfigPath, } from '../../lib/wtconfig/index.js';
|
|
16
|
+
import { detectMigrationIssues, runMigration, formatMigrationReport, } from '../../lib/config-migration/index.js';
|
|
17
|
+
import { createSuccessResult, createErrorResult, formatJsonResult, ErrorCode, } from '../../lib/json-output.js';
|
|
18
|
+
import { printError, printStatus } from '../../lib/ui/index.js';
|
|
13
19
|
/**
|
|
14
20
|
* Get repo root safely
|
|
15
21
|
*/
|
|
@@ -27,7 +33,7 @@ export const configCommand = {
|
|
|
27
33
|
builder: (yargs) => {
|
|
28
34
|
return yargs
|
|
29
35
|
.positional('subcommand', {
|
|
30
|
-
describe: 'Subcommand: interactive, init, show, set, get, edit, validate, schema',
|
|
36
|
+
describe: 'Subcommand: interactive, init, show, set, get, edit, validate, migrate, schema',
|
|
31
37
|
type: 'string',
|
|
32
38
|
default: 'interactive',
|
|
33
39
|
})
|
|
@@ -35,6 +41,11 @@ export const configCommand = {
|
|
|
35
41
|
describe: 'Additional arguments (e.g., key value for set)',
|
|
36
42
|
type: 'string',
|
|
37
43
|
array: true,
|
|
44
|
+
})
|
|
45
|
+
.option('json', {
|
|
46
|
+
type: 'boolean',
|
|
47
|
+
description: 'Output as JSON (for show, get, validate, migrate)',
|
|
48
|
+
default: false,
|
|
38
49
|
})
|
|
39
50
|
.example('$0 config', 'Open interactive config editor')
|
|
40
51
|
.example('$0 cfg i', 'Open interactive config editor')
|
|
@@ -44,38 +55,51 @@ export const configCommand = {
|
|
|
44
55
|
.example('$0 config get ai.provider', 'Get a config value')
|
|
45
56
|
.example('$0 cfg edit', 'Open config in text editor')
|
|
46
57
|
.example('$0 config validate', 'Validate configuration')
|
|
58
|
+
.example('$0 config migrate', 'Migrate legacy config to latest version')
|
|
59
|
+
.example('$0 config migrate --json', 'Migrate with JSON output')
|
|
47
60
|
.example('$0 config schema', 'Show JSON schema URL');
|
|
48
61
|
},
|
|
49
62
|
handler: async (argv) => {
|
|
50
63
|
const subcommand = argv.subcommand || 'interactive';
|
|
51
64
|
const args = argv.args || [];
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
65
|
+
switch (subcommand) {
|
|
66
|
+
case 'interactive':
|
|
67
|
+
case 'i':
|
|
68
|
+
await handleInteractive();
|
|
69
|
+
return;
|
|
70
|
+
case 'show':
|
|
71
|
+
handleShow(!!argv.json);
|
|
72
|
+
return;
|
|
73
|
+
case 'get':
|
|
74
|
+
handleGet(args, !!argv.json);
|
|
75
|
+
return;
|
|
76
|
+
case 'set':
|
|
77
|
+
if (args.length === 1) {
|
|
78
|
+
await handleQuickEdit(args[0]);
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
handleSet(args);
|
|
82
|
+
}
|
|
83
|
+
return;
|
|
84
|
+
case 'edit':
|
|
85
|
+
handleEdit();
|
|
86
|
+
return;
|
|
87
|
+
case 'init':
|
|
88
|
+
handleInit();
|
|
89
|
+
return;
|
|
90
|
+
case 'validate':
|
|
91
|
+
handleValidate(!!argv.json);
|
|
92
|
+
return;
|
|
93
|
+
case 'migrate':
|
|
94
|
+
await handleMigrate(!!argv.json);
|
|
95
|
+
return;
|
|
96
|
+
case 'schema':
|
|
97
|
+
handleSchema();
|
|
98
|
+
return;
|
|
99
|
+
default:
|
|
100
|
+
printError({ title: `Unknown config subcommand: ${subcommand}` });
|
|
101
|
+
process.exit(1);
|
|
77
102
|
}
|
|
78
|
-
runSubcommand('wtconfig', wtconfigArgs);
|
|
79
103
|
},
|
|
80
104
|
};
|
|
81
105
|
/**
|
|
@@ -104,6 +128,138 @@ async function handleInteractive() {
|
|
|
104
128
|
throw error;
|
|
105
129
|
}
|
|
106
130
|
}
|
|
131
|
+
/**
|
|
132
|
+
* Handle show subcommand - display current configuration
|
|
133
|
+
*/
|
|
134
|
+
function handleShow(json) {
|
|
135
|
+
const repoRoot = getRepoRoot();
|
|
136
|
+
const source = getConfigSource(repoRoot ?? undefined);
|
|
137
|
+
const config = loadMergedConfig(repoRoot ?? undefined);
|
|
138
|
+
if (json) {
|
|
139
|
+
const result = createSuccessResult('wtconfig', {
|
|
140
|
+
subcommand: 'show',
|
|
141
|
+
source: source.type === 'none' ? null : source.path,
|
|
142
|
+
config,
|
|
143
|
+
});
|
|
144
|
+
console.log(formatJsonResult(result));
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
const defaults = getDefaultConfig();
|
|
148
|
+
console.log(colors.info('Current Configuration'));
|
|
149
|
+
console.log();
|
|
150
|
+
if (source.type === 'none') {
|
|
151
|
+
console.log(colors.dim('No configuration file found. Using defaults.'));
|
|
152
|
+
console.log(colors.dim('Run "wt init" to create a configuration file.'));
|
|
153
|
+
console.log();
|
|
154
|
+
}
|
|
155
|
+
else {
|
|
156
|
+
console.log(colors.dim(`Source: ${source.path}`));
|
|
157
|
+
console.log();
|
|
158
|
+
}
|
|
159
|
+
const lines = ['{'];
|
|
160
|
+
const addLine = (key, value, defaultValue) => {
|
|
161
|
+
const isDefault = JSON.stringify(value) === JSON.stringify(defaultValue);
|
|
162
|
+
const valueStr = JSON.stringify(value);
|
|
163
|
+
if (isDefault) {
|
|
164
|
+
lines.push(` ${key}: ${valueStr} ${colors.dim('(default)')}`);
|
|
165
|
+
}
|
|
166
|
+
else {
|
|
167
|
+
lines.push(` ${colors.success(key + ':')} ${valueStr}`);
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
addLine('baseBranch', config.baseBranch ?? defaults.baseBranch, defaults.baseBranch);
|
|
171
|
+
addLine('draftPr', config.draftPr ?? defaults.draftPr, defaults.draftPr);
|
|
172
|
+
addLine('branchPrefix', config.branchPrefix ?? defaults.branchPrefix, defaults.branchPrefix);
|
|
173
|
+
addLine('worktreePattern', config.worktreePattern ?? defaults.worktreePattern, defaults.worktreePattern);
|
|
174
|
+
addLine('worktreeParent', config.worktreeParent ?? defaults.worktreeParent, defaults.worktreeParent);
|
|
175
|
+
addLine('preferredEditor', config.preferredEditor ?? defaults.preferredEditor, defaults.preferredEditor);
|
|
176
|
+
if (config.sharedRepos && config.sharedRepos.length > 0) {
|
|
177
|
+
addLine('sharedRepos', config.sharedRepos, defaults.sharedRepos);
|
|
178
|
+
}
|
|
179
|
+
if (config.ai) {
|
|
180
|
+
lines.push(` ${colors.info('ai:')} ${JSON.stringify(config.ai)}`);
|
|
181
|
+
}
|
|
182
|
+
if (config.hooks && Object.keys(config.hooks).length > 0) {
|
|
183
|
+
lines.push(` ${colors.info('hooks:')} ${JSON.stringify(config.hooks)}`);
|
|
184
|
+
}
|
|
185
|
+
lines.push('}');
|
|
186
|
+
console.log(lines.join('\n'));
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Handle get subcommand - get a specific config value
|
|
190
|
+
*/
|
|
191
|
+
function handleGet(args, json) {
|
|
192
|
+
if (args.length === 0) {
|
|
193
|
+
printError({ title: 'Missing key argument', hint: 'Usage: wt config get <key>' });
|
|
194
|
+
process.exit(1);
|
|
195
|
+
}
|
|
196
|
+
const key = args[0];
|
|
197
|
+
const repoRoot = getRepoRoot();
|
|
198
|
+
const config = loadMergedConfig(repoRoot ?? undefined);
|
|
199
|
+
const defaults = getDefaultConfig();
|
|
200
|
+
let value = getConfigValue(config, key);
|
|
201
|
+
if (value === undefined) {
|
|
202
|
+
value = getConfigValue(defaults, key);
|
|
203
|
+
}
|
|
204
|
+
if (value === undefined) {
|
|
205
|
+
if (json) {
|
|
206
|
+
const errorResult = createErrorResult('wtconfig', ErrorCode.INVALID_ARGUMENT, `Unknown configuration key: ${key}`);
|
|
207
|
+
console.log(formatJsonResult(errorResult));
|
|
208
|
+
}
|
|
209
|
+
else {
|
|
210
|
+
printError({ title: `Key "${key}" not found in configuration` });
|
|
211
|
+
}
|
|
212
|
+
process.exit(1);
|
|
213
|
+
}
|
|
214
|
+
if (json) {
|
|
215
|
+
const result = createSuccessResult('wtconfig', { subcommand: 'get', key, value });
|
|
216
|
+
console.log(formatJsonResult(result));
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
if (typeof value === 'object') {
|
|
220
|
+
console.log(JSON.stringify(value, null, 2));
|
|
221
|
+
}
|
|
222
|
+
else {
|
|
223
|
+
console.log(String(value));
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Handle set subcommand with key and value
|
|
228
|
+
*/
|
|
229
|
+
function handleSet(args) {
|
|
230
|
+
if (args.length < 2) {
|
|
231
|
+
printError({ title: 'Usage: wt config set <key> <value>' });
|
|
232
|
+
process.exit(1);
|
|
233
|
+
}
|
|
234
|
+
const key = args[0];
|
|
235
|
+
const value = args[1];
|
|
236
|
+
const repoRoot = getRepoRoot();
|
|
237
|
+
if (!repoRoot) {
|
|
238
|
+
console.error(colors.error('Not in a git repository.'));
|
|
239
|
+
process.exit(1);
|
|
240
|
+
}
|
|
241
|
+
const currentConfig = loadRepoConfig(repoRoot) || {};
|
|
242
|
+
try {
|
|
243
|
+
const newConfig = setConfigValue(currentConfig, key, value);
|
|
244
|
+
const validation = validateConfig(newConfig);
|
|
245
|
+
if (!validation.valid) {
|
|
246
|
+
console.error(colors.error('Configuration validation failed:'));
|
|
247
|
+
for (const error of validation.errors) {
|
|
248
|
+
console.error(colors.error(` ${error.path}: ${error.message}`));
|
|
249
|
+
}
|
|
250
|
+
process.exit(1);
|
|
251
|
+
}
|
|
252
|
+
for (const warning of validation.warnings) {
|
|
253
|
+
console.warn(colors.warning(`Warning: ${warning.path}: ${warning.message}`));
|
|
254
|
+
}
|
|
255
|
+
saveRepoConfig(repoRoot, newConfig);
|
|
256
|
+
console.log(colors.success(`Set ${key} = ${value}`));
|
|
257
|
+
}
|
|
258
|
+
catch (error) {
|
|
259
|
+
console.error(colors.error(`Failed to set value: ${error instanceof Error ? error.message : String(error)}`));
|
|
260
|
+
process.exit(1);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
107
263
|
/**
|
|
108
264
|
* Handle quick edit of a single property
|
|
109
265
|
*/
|
|
@@ -125,9 +281,80 @@ async function handleQuickEdit(key) {
|
|
|
125
281
|
}
|
|
126
282
|
}
|
|
127
283
|
/**
|
|
128
|
-
* Handle config
|
|
284
|
+
* Handle edit subcommand - open config in editor
|
|
129
285
|
*/
|
|
130
|
-
|
|
286
|
+
function handleEdit() {
|
|
287
|
+
const repoRoot = getRepoRoot();
|
|
288
|
+
const configPath = repoRoot ? findRepoConfigPath(repoRoot) : null;
|
|
289
|
+
if (!configPath) {
|
|
290
|
+
const globalPath = getGlobalConfigPath();
|
|
291
|
+
if (fs.existsSync(globalPath)) {
|
|
292
|
+
openInEditor(globalPath);
|
|
293
|
+
return;
|
|
294
|
+
}
|
|
295
|
+
printError({ title: 'No configuration file found.', hint: 'Run "wt init" to create one.' });
|
|
296
|
+
process.exit(1);
|
|
297
|
+
}
|
|
298
|
+
openInEditor(configPath);
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* Open a file in the system editor
|
|
302
|
+
*/
|
|
303
|
+
function openInEditor(filePath) {
|
|
304
|
+
const editor = process.env.EDITOR || process.env.VISUAL || 'vi';
|
|
305
|
+
console.log(colors.dim(`Opening ${filePath} in ${editor}...`));
|
|
306
|
+
try {
|
|
307
|
+
spawnSync(editor, [filePath], { stdio: 'inherit' });
|
|
308
|
+
}
|
|
309
|
+
catch {
|
|
310
|
+
console.error(colors.error('Failed to open editor'));
|
|
311
|
+
process.exit(1);
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* Handle init subcommand - redirect to wt init
|
|
316
|
+
*/
|
|
317
|
+
function handleInit() {
|
|
318
|
+
console.log(colors.info('Use "wt init" to initialize git-worktree-tools configuration.'));
|
|
319
|
+
console.log();
|
|
320
|
+
console.log(colors.dim('Examples:'));
|
|
321
|
+
console.log(colors.dim(' wt init Interactive initialization'));
|
|
322
|
+
console.log(colors.dim(' wt init --local Create local config (gitignored)'));
|
|
323
|
+
console.log(colors.dim(' wt init --global Create global config'));
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* Handle validate subcommand
|
|
327
|
+
*/
|
|
328
|
+
function handleValidate(json) {
|
|
329
|
+
if (json) {
|
|
330
|
+
const repoRoot = getRepoRoot();
|
|
331
|
+
const source = getConfigSource(repoRoot ?? undefined);
|
|
332
|
+
if (source.type === 'none') {
|
|
333
|
+
const result = createSuccessResult('wtconfig', {
|
|
334
|
+
subcommand: 'validate',
|
|
335
|
+
valid: true,
|
|
336
|
+
source: null,
|
|
337
|
+
errors: [],
|
|
338
|
+
warnings: [],
|
|
339
|
+
});
|
|
340
|
+
console.log(formatJsonResult(result));
|
|
341
|
+
return;
|
|
342
|
+
}
|
|
343
|
+
const config = loadMergedConfig(repoRoot ?? undefined);
|
|
344
|
+
const validationResult = validateConfig(config);
|
|
345
|
+
const result = createSuccessResult('wtconfig', {
|
|
346
|
+
subcommand: 'validate',
|
|
347
|
+
valid: validationResult.valid,
|
|
348
|
+
source: source.path,
|
|
349
|
+
errors: validationResult.errors,
|
|
350
|
+
warnings: validationResult.warnings,
|
|
351
|
+
});
|
|
352
|
+
console.log(formatJsonResult(result));
|
|
353
|
+
if (!validationResult.valid) {
|
|
354
|
+
process.exit(1);
|
|
355
|
+
}
|
|
356
|
+
return;
|
|
357
|
+
}
|
|
131
358
|
const repoRoot = getRepoRoot();
|
|
132
359
|
if (!repoRoot) {
|
|
133
360
|
console.error(colors.error('Not in a git repository.'));
|
|
@@ -153,6 +380,70 @@ async function handleValidate() {
|
|
|
153
380
|
console.log(formatValidationErrors(validation.errors));
|
|
154
381
|
process.exit(1);
|
|
155
382
|
}
|
|
383
|
+
/**
|
|
384
|
+
* Handle migrate subcommand
|
|
385
|
+
*/
|
|
386
|
+
async function handleMigrate(json) {
|
|
387
|
+
const repoRoot = getRepoRoot();
|
|
388
|
+
if (!repoRoot) {
|
|
389
|
+
if (json) {
|
|
390
|
+
const errorResult = createErrorResult('wtconfig', ErrorCode.NOT_GIT_REPO, 'Not in a git repository');
|
|
391
|
+
console.log(formatJsonResult(errorResult));
|
|
392
|
+
}
|
|
393
|
+
else {
|
|
394
|
+
console.error(colors.error('Error: Not in a git repository'));
|
|
395
|
+
console.error(colors.dim('Run this command from within a git repository.'));
|
|
396
|
+
}
|
|
397
|
+
process.exit(1);
|
|
398
|
+
}
|
|
399
|
+
const detection = detectMigrationIssues(repoRoot);
|
|
400
|
+
if (detection.issues.length === 0) {
|
|
401
|
+
if (json) {
|
|
402
|
+
const result = createSuccessResult('wtconfig', {
|
|
403
|
+
migrated: false,
|
|
404
|
+
message: 'No migration needed',
|
|
405
|
+
});
|
|
406
|
+
console.log(formatJsonResult(result));
|
|
407
|
+
}
|
|
408
|
+
else {
|
|
409
|
+
printStatus('success', 'No migration needed.');
|
|
410
|
+
}
|
|
411
|
+
return;
|
|
412
|
+
}
|
|
413
|
+
if (json) {
|
|
414
|
+
const result = await runMigration(repoRoot, detection, { deleteLegacyFiles: false });
|
|
415
|
+
console.log(formatJsonResult(createSuccessResult('wtconfig', {
|
|
416
|
+
success: result.success,
|
|
417
|
+
backupPath: result.backupPath,
|
|
418
|
+
configPath: result.newConfigPath,
|
|
419
|
+
actionsApplied: result.actionsExecuted.length,
|
|
420
|
+
errors: result.errors,
|
|
421
|
+
})));
|
|
422
|
+
if (!result.success) {
|
|
423
|
+
process.exit(1);
|
|
424
|
+
}
|
|
425
|
+
return;
|
|
426
|
+
}
|
|
427
|
+
console.log(formatMigrationReport(detection, { verbose: true }));
|
|
428
|
+
console.log();
|
|
429
|
+
const result = await runMigration(repoRoot, detection, { deleteLegacyFiles: false });
|
|
430
|
+
if (result.success) {
|
|
431
|
+
console.log();
|
|
432
|
+
printStatus('success', 'Migration completed successfully!');
|
|
433
|
+
if (result.backupPath) {
|
|
434
|
+
console.log(colors.dim(`Backup created: ${result.backupPath}`));
|
|
435
|
+
}
|
|
436
|
+
console.log(colors.dim(`Config updated: ${result.newConfigPath}`));
|
|
437
|
+
}
|
|
438
|
+
else {
|
|
439
|
+
console.log();
|
|
440
|
+
console.error(colors.error('Migration failed:'));
|
|
441
|
+
for (const err of result.errors) {
|
|
442
|
+
console.error(colors.error(` ${err}`));
|
|
443
|
+
}
|
|
444
|
+
process.exit(1);
|
|
445
|
+
}
|
|
446
|
+
}
|
|
156
447
|
/**
|
|
157
448
|
* Handle schema info
|
|
158
449
|
*/
|