@aku11i/phantom 2.2.3 → 2.2.4

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/phantom.js +206 -232
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aku11i/phantom",
3
- "version": "2.2.3",
3
+ "version": "2.2.4",
4
4
  "description": "A powerful CLI tool for managing Git worktrees for parallel development",
5
5
  "keywords": [
6
6
  "git",
package/phantom.js CHANGED
@@ -5301,236 +5301,8 @@ async function attachHandler(args2) {
5301
5301
 
5302
5302
  // src/handlers/completion.ts
5303
5303
  import { exit } from "node:process";
5304
- var FISH_COMPLETION_SCRIPT = `# Fish completion for phantom
5305
- # Load with: phantom completion fish | source
5306
-
5307
- function __phantom_list_worktrees
5308
- phantom list --names 2>/dev/null
5309
- end
5310
-
5311
- function __phantom_using_command
5312
- set -l cmd (commandline -opc)
5313
- set -l cmd_count (count $cmd)
5314
- if test $cmd_count -eq 1
5315
- # No subcommand yet, so any command can be used
5316
- if test (count $argv) -eq 0
5317
- return 0
5318
- else
5319
- return 1
5320
- end
5321
- else if test $cmd_count -ge 2
5322
- # Check if we're in the context of a specific command
5323
- if test (count $argv) -gt 0 -a "$argv[1]" = "$cmd[2]"
5324
- return 0
5325
- end
5326
- end
5327
- return 1
5328
- end
5329
-
5330
- # Disable file completion for phantom
5331
- complete -c phantom -f
5332
-
5333
- # Main commands
5334
- complete -c phantom -n "__phantom_using_command" -a "create" -d "Create a new Git worktree (phantom)"
5335
- complete -c phantom -n "__phantom_using_command" -a "attach" -d "Attach to an existing branch by creating a new worktree"
5336
- complete -c phantom -n "__phantom_using_command" -a "list" -d "List all Git worktrees (phantoms)"
5337
- complete -c phantom -n "__phantom_using_command" -a "where" -d "Output the filesystem path of a specific worktree"
5338
- complete -c phantom -n "__phantom_using_command" -a "delete" -d "Delete a Git worktree (phantom)"
5339
- complete -c phantom -n "__phantom_using_command" -a "exec" -d "Execute a command in a worktree directory"
5340
- complete -c phantom -n "__phantom_using_command" -a "review" -d "Review changes in a worktree with a local PR review interface (experimental)"
5341
- complete -c phantom -n "__phantom_using_command" -a "shell" -d "Open an interactive shell in a worktree directory"
5342
- complete -c phantom -n "__phantom_using_command" -a "github" -d "GitHub integration commands"
5343
- complete -c phantom -n "__phantom_using_command" -a "gh" -d "GitHub integration commands (alias)"
5344
- complete -c phantom -n "__phantom_using_command" -a "version" -d "Display phantom version information"
5345
- complete -c phantom -n "__phantom_using_command" -a "completion" -d "Generate shell completion scripts"
5346
- complete -c phantom -n "__phantom_using_command" -a "mcp" -d "Manage Model Context Protocol (MCP) server"
5347
-
5348
- # Global options
5349
- complete -c phantom -l help -d "Show help (-h)"
5350
- complete -c phantom -l version -d "Show version (-v)"
5351
-
5352
- # create command options
5353
- complete -c phantom -n "__phantom_using_command create" -l shell -d "Open an interactive shell in the new worktree after creation (-s)"
5354
- complete -c phantom -n "__phantom_using_command create" -l exec -d "Execute a command in the new worktree after creation (-x)" -x
5355
- complete -c phantom -n "__phantom_using_command create" -l tmux -d "Open the worktree in a new tmux window (-t)"
5356
- complete -c phantom -n "__phantom_using_command create" -l tmux-vertical -d "Open the worktree in a vertical tmux pane"
5357
- complete -c phantom -n "__phantom_using_command create" -l tmux-horizontal -d "Open the worktree in a horizontal tmux pane"
5358
- complete -c phantom -n "__phantom_using_command create" -l copy-file -d "Copy specified files from the current worktree" -r
5359
- complete -c phantom -n "__phantom_using_command create" -l base -d "Branch or commit to create the new worktree from (defaults to HEAD)" -x
5360
-
5361
- # attach command options
5362
- complete -c phantom -n "__phantom_using_command attach" -l shell -d "Open an interactive shell in the worktree after attaching (-s)"
5363
- complete -c phantom -n "__phantom_using_command attach" -l exec -d "Execute a command in the worktree after attaching (-x)" -x
5364
-
5365
- # list command options
5366
- complete -c phantom -n "__phantom_using_command list" -l fzf -d "Use fzf for interactive selection"
5367
- complete -c phantom -n "__phantom_using_command list" -l names -d "Output only phantom names (for scripts and completion)"
5368
-
5369
- # where command options
5370
- complete -c phantom -n "__phantom_using_command where" -l fzf -d "Use fzf for interactive selection"
5371
- complete -c phantom -n "__phantom_using_command where" -a "(__phantom_list_worktrees)"
5372
-
5373
- # delete command options
5374
- complete -c phantom -n "__phantom_using_command delete" -l force -d "Force deletion even if worktree has uncommitted changes (-f)"
5375
- complete -c phantom -n "__phantom_using_command delete" -l current -d "Delete the current worktree"
5376
- complete -c phantom -n "__phantom_using_command delete" -l fzf -d "Use fzf for interactive selection"
5377
- complete -c phantom -n "__phantom_using_command delete" -a "(__phantom_list_worktrees)"
5378
-
5379
- # exec command options
5380
- complete -c phantom -n "__phantom_using_command exec" -l fzf -d "Use fzf for interactive selection"
5381
- complete -c phantom -n "__phantom_using_command exec" -l tmux -d "Execute command in new tmux window (-t)"
5382
- complete -c phantom -n "__phantom_using_command exec" -l tmux-vertical -d "Execute command in vertical split pane"
5383
- complete -c phantom -n "__phantom_using_command exec" -l tmux-horizontal -d "Execute command in horizontal split pane"
5384
- complete -c phantom -n "__phantom_using_command exec" -a "(__phantom_list_worktrees)"
5385
-
5386
- # review command options
5387
- complete -c phantom -n "__phantom_using_command review" -l fzf -d "Use fzf for interactive selection"
5388
- complete -c phantom -n "__phantom_using_command review" -l base -d "Base reference for comparison" -x
5389
- complete -c phantom -n "__phantom_using_command review" -a "(__phantom_list_worktrees)"
5390
-
5391
- # shell command options
5392
- complete -c phantom -n "__phantom_using_command shell" -l fzf -d "Use fzf for interactive selection"
5393
- complete -c phantom -n "__phantom_using_command shell" -l tmux -d "Open shell in new tmux window (-t)"
5394
- complete -c phantom -n "__phantom_using_command shell" -l tmux-vertical -d "Open shell in vertical split pane"
5395
- complete -c phantom -n "__phantom_using_command shell" -l tmux-horizontal -d "Open shell in horizontal split pane"
5396
- complete -c phantom -n "__phantom_using_command shell" -a "(__phantom_list_worktrees)"
5397
-
5398
- # completion command - shell names
5399
- complete -c phantom -n "__phantom_using_command completion" -a "fish zsh bash" -d "Shell type"
5400
-
5401
- # github command options
5402
- complete -c phantom -n "__phantom_using_command github" -a "checkout" -d "Create a worktree for a GitHub PR or issue"
5403
- complete -c phantom -n "__phantom_using_command gh" -a "checkout" -d "Create a worktree for a GitHub PR or issue"
5404
-
5405
- # github checkout command options
5406
- complete -c phantom -n "__phantom_using_command github checkout" -l base -d "Base branch for new issue branches (issues only)" -x
5407
- complete -c phantom -n "__phantom_using_command gh checkout" -l base -d "Base branch for new issue branches (issues only)" -x
5408
-
5409
- # mcp command options
5410
- complete -c phantom -n "__phantom_using_command mcp" -a "serve" -d "Start MCP server"`;
5411
- var ZSH_COMPLETION_SCRIPT = `#compdef phantom
5412
- # Zsh completion for phantom
5413
- # Load with: eval "$(phantom completion zsh)"
5414
-
5415
- # Only define the function, don't execute it
5416
- _phantom() {
5417
- local -a commands
5418
- commands=(
5419
- 'create:Create a new Git worktree (phantom)'
5420
- 'attach:Attach to an existing branch by creating a new worktree'
5421
- 'list:List all Git worktrees (phantoms)'
5422
- 'where:Output the filesystem path of a specific worktree'
5423
- 'delete:Delete a Git worktree (phantom)'
5424
- 'exec:Execute a command in a worktree directory'
5425
- 'review:Review changes in a worktree with a local PR review interface (experimental)'
5426
- 'shell:Open an interactive shell in a worktree directory'
5427
- 'github:GitHub integration commands'
5428
- 'gh:GitHub integration commands (alias)'
5429
- 'version:Display phantom version information'
5430
- 'completion:Generate shell completion scripts'
5431
- 'mcp:Manage Model Context Protocol (MCP) server'
5432
- )
5433
5304
 
5434
- _arguments -C \\
5435
- '--help[Show help (-h)]' \\
5436
- '--version[Show version (-v)]' \\
5437
- '1:command:->command' \\
5438
- '*::arg:->args'
5439
-
5440
- case \${state} in
5441
- command)
5442
- _describe 'phantom command' commands
5443
- ;;
5444
- args)
5445
- case \${line[1]} in
5446
- create)
5447
- _arguments \\
5448
- '--shell[Open an interactive shell in the new worktree after creation (-s)]' \\
5449
- '--exec[Execute a command in the new worktree after creation (-x)]:command:' \\
5450
- '--tmux[Open the worktree in a new tmux window (-t)]' \\
5451
- '--tmux-vertical[Open the worktree in a vertical tmux pane]' \\
5452
- '--tmux-horizontal[Open the worktree in a horizontal tmux pane]' \\
5453
- '*--copy-file[Copy specified files from the current worktree]:file:_files' \\
5454
- '--base[Branch or commit to create the new worktree from (defaults to HEAD)]:branch/commit:' \\
5455
- '1:name:'
5456
- ;;
5457
- attach)
5458
- _arguments \\
5459
- '--shell[Open an interactive shell in the worktree after attaching (-s)]' \\
5460
- '--exec[Execute a command in the worktree after attaching (-x)]:command:' \\
5461
- '1:branch-name:'
5462
- ;;
5463
- list)
5464
- _arguments \\
5465
- '--fzf[Use fzf for interactive selection]' \\
5466
- '--names[Output only phantom names (for scripts and completion)]'
5467
- ;;
5468
- where|delete|review|shell)
5469
- local worktrees
5470
- worktrees=(\${(f)"$(phantom list --names 2>/dev/null)"})
5471
- if [[ \${line[1]} == "where" ]]; then
5472
- _arguments \\
5473
- '--fzf[Use fzf for interactive selection]' \\
5474
- '1:worktree:(\${(q)worktrees[@]})'
5475
- elif [[ \${line[1]} == "review" ]]; then
5476
- _arguments \\
5477
- '--fzf[Use fzf for interactive selection]' \\
5478
- '--base[Base reference for comparison]:reference:' \\
5479
- '1:worktree:(\${(q)worktrees[@]})'
5480
- elif [[ \${line[1]} == "shell" ]]; then
5481
- _arguments \\
5482
- '--fzf[Use fzf for interactive selection]' \\
5483
- '--tmux[Open shell in new tmux window (-t)]' \\
5484
- '--tmux-vertical[Open shell in vertical split pane]' \\
5485
- '--tmux-horizontal[Open shell in horizontal split pane]' \\
5486
- '1:worktree:(\${(q)worktrees[@]})'
5487
- elif [[ \${line[1]} == "delete" ]]; then
5488
- _arguments \\
5489
- '--force[Force deletion even if worktree has uncommitted changes (-f)]' \\
5490
- '--current[Delete the current worktree]' \\
5491
- '--fzf[Use fzf for interactive selection]' \\
5492
- '1:worktree:(\${(q)worktrees[@]})'
5493
- fi
5494
- ;;
5495
- exec)
5496
- local worktrees
5497
- worktrees=(\${(f)"$(phantom list --names 2>/dev/null)"})
5498
- _arguments \\
5499
- '--fzf[Use fzf for interactive selection]' \\
5500
- '--tmux[Execute command in new tmux window (-t)]' \\
5501
- '--tmux-vertical[Execute command in vertical split pane]' \\
5502
- '--tmux-horizontal[Execute command in horizontal split pane]' \\
5503
- '1:worktree:(\${(q)worktrees[@]})' \\
5504
- '*:command:_command_names'
5505
- ;;
5506
- completion)
5507
- _arguments \\
5508
- '1:shell:(fish zsh bash)'
5509
- ;;
5510
- github|gh)
5511
- if [[ \${#line} -eq 1 ]]; then
5512
- _arguments \\
5513
- '1:subcommand:(checkout)'
5514
- elif [[ \${line[2]} == "checkout" ]]; then
5515
- _arguments \\
5516
- '--base[Base branch for new issue branches (issues only)]:branch:' \\
5517
- '1:number:'
5518
- fi
5519
- ;;
5520
- mcp)
5521
- _arguments \\
5522
- '1:action:(serve)'
5523
- ;;
5524
- esac
5525
- ;;
5526
- esac
5527
- }
5528
-
5529
- # Register the completion function if loading dynamically
5530
- if [[ -n \${ZSH_VERSION} ]]; then
5531
- autoload -Uz compinit && compinit -C
5532
- compdef _phantom phantom
5533
- fi`;
5305
+ // src/completions/phantom-bash.ts
5534
5306
  var BASH_COMPLETION_SCRIPT = `# Bash completion for phantom
5535
5307
  # Load with: eval "$(phantom completion bash)"
5536
5308
 
@@ -5730,7 +5502,205 @@ _phantom_completion() {
5730
5502
  }
5731
5503
 
5732
5504
  # Register the completion function
5733
- complete -F _phantom_completion phantom`;
5505
+ if [[ "\${BASH_VERSINFO[0]}" -eq 4 && "\${BASH_VERSINFO[1]}" -ge 4 || "\${BASH_VERSINFO[0]}" -gt 4 ]]; then
5506
+ complete -F _phantom_completion -o nosort -o bashdefault -o default phantom
5507
+ else
5508
+ complete -F _phantom_completion -o bashdefault -o default phantom
5509
+ fi`;
5510
+
5511
+ // src/completions/phantom-fish.ts
5512
+ var FISH_COMPLETION_SCRIPT = `# Fish completion for phantom
5513
+ # Load with: phantom completion fish | source
5514
+
5515
+ function __phantom_list_worktrees
5516
+ phantom list --names 2>/dev/null
5517
+ end
5518
+
5519
+ function __phantom_using_command
5520
+ set -l cmd (commandline -opc)
5521
+ set -l cmd_count (count $cmd)
5522
+ if test $cmd_count -eq 1
5523
+ # No subcommand yet, so any command can be used
5524
+ if test (count $argv) -eq 0
5525
+ return 0
5526
+ else
5527
+ return 1
5528
+ end
5529
+ else if test $cmd_count -ge 2
5530
+ # Check if we're in the context of a specific command
5531
+ if test (count $argv) -gt 0 -a "$argv[1]" = "$cmd[2]"
5532
+ return 0
5533
+ end
5534
+ end
5535
+ return 1
5536
+ end
5537
+
5538
+ # Disable file completion for phantom
5539
+ complete -c phantom -f
5540
+
5541
+ # Main commands
5542
+ complete -c phantom -n "__phantom_using_command" -a "create" -d "Create a new Git worktree (phantom)"
5543
+ complete -c phantom -n "__phantom_using_command" -a "attach" -d "Attach to an existing branch by creating a new worktree"
5544
+ complete -c phantom -n "__phantom_using_command" -a "list" -d "List all Git worktrees (phantoms)"
5545
+ complete -c phantom -n "__phantom_using_command" -a "where" -d "Output the filesystem path of a specific worktree"
5546
+ complete -c phantom -n "__phantom_using_command" -a "delete" -d "Delete a Git worktree (phantom)"
5547
+ complete -c phantom -n "__phantom_using_command" -a "exec" -d "Execute a command in a worktree directory"
5548
+ complete -c phantom -n "__phantom_using_command" -a "review" -d "Review changes in a worktree with a local PR review interface (experimental)"
5549
+ complete -c phantom -n "__phantom_using_command" -a "shell" -d "Open an interactive shell in a worktree directory"
5550
+ complete -c phantom -n "__phantom_using_command" -a "github" -d "GitHub integration commands"
5551
+ complete -c phantom -n "__phantom_using_command" -a "gh" -d "GitHub integration commands (alias)"
5552
+ complete -c phantom -n "__phantom_using_command" -a "version" -d "Display phantom version information"
5553
+ complete -c phantom -n "__phantom_using_command" -a "completion" -d "Generate shell completion scripts"
5554
+ complete -c phantom -n "__phantom_using_command" -a "mcp" -d "Manage Model Context Protocol (MCP) server"
5555
+
5556
+ # Global options
5557
+ complete -c phantom -l help -d "Show help (-h)"
5558
+ complete -c phantom -l version -d "Show version (-v)"
5559
+
5560
+ # create command options
5561
+ complete -c phantom -n "__phantom_using_command create" -l shell -d "Open an interactive shell in the new worktree after creation (-s)"
5562
+ complete -c phantom -n "__phantom_using_command create" -l exec -d "Execute a command in the new worktree after creation (-x)" -x
5563
+ complete -c phantom -n "__phantom_using_command create" -l tmux -d "Open the worktree in a new tmux window (-t)"
5564
+ complete -c phantom -n "__phantom_using_command create" -l tmux-vertical -d "Open the worktree in a vertical tmux pane"
5565
+ complete -c phantom -n "__phantom_using_command create" -l tmux-horizontal -d "Open the worktree in a horizontal tmux pane"
5566
+ complete -c phantom -n "__phantom_using_command create" -l copy-file -d "Copy specified files from the current worktree" -r
5567
+ complete -c phantom -n "__phantom_using_command create" -l base -d "Branch or commit to create the new worktree from (defaults to HEAD)" -x
5568
+
5569
+ # attach command options
5570
+ complete -c phantom -n "__phantom_using_command attach" -l shell -d "Open an interactive shell in the worktree after attaching (-s)"
5571
+ complete -c phantom -n "__phantom_using_command attach" -l exec -d "Execute a command in the worktree after attaching (-x)" -x
5572
+
5573
+ # list command options
5574
+ complete -c phantom -n "__phantom_using_command list" -l fzf -d "Use fzf for interactive selection"
5575
+ complete -c phantom -n "__phantom_using_command list" -l names -d "Output only phantom names (for scripts and completion)"
5576
+
5577
+ # where command options
5578
+ complete -c phantom -n "__phantom_using_command where" -l fzf -d "Use fzf for interactive selection"
5579
+ complete -c phantom -n "__phantom_using_command where" -a "(__phantom_list_worktrees)"
5580
+
5581
+ # delete command options
5582
+ complete -c phantom -n "__phantom_using_command delete" -l force -d "Force deletion even if worktree has uncommitted changes (-f)"
5583
+ complete -c phantom -n "__phantom_using_command delete" -l current -d "Delete the current worktree"
5584
+ complete -c phantom -n "__phantom_using_command delete" -l fzf -d "Use fzf for interactive selection"
5585
+ complete -c phantom -n "__phantom_using_command delete" -a "(__phantom_list_worktrees)"
5586
+
5587
+ # exec command options
5588
+ complete -c phantom -n "__phantom_using_command exec" -l fzf -d "Use fzf for interactive selection"
5589
+ complete -c phantom -n "__phantom_using_command exec" -l tmux -d "Execute command in new tmux window (-t)"
5590
+ complete -c phantom -n "__phantom_using_command exec" -l tmux-vertical -d "Execute command in vertical split pane"
5591
+ complete -c phantom -n "__phantom_using_command exec" -l tmux-horizontal -d "Execute command in horizontal split pane"
5592
+ complete -c phantom -n "__phantom_using_command exec" -a "(__phantom_list_worktrees)"
5593
+
5594
+ # review command options
5595
+ complete -c phantom -n "__phantom_using_command review" -l fzf -d "Use fzf for interactive selection"
5596
+ complete -c phantom -n "__phantom_using_command review" -l base -d "Base reference for comparison" -x
5597
+ complete -c phantom -n "__phantom_using_command review" -a "(__phantom_list_worktrees)"
5598
+
5599
+ # shell command options
5600
+ complete -c phantom -n "__phantom_using_command shell" -l fzf -d "Use fzf for interactive selection"
5601
+ complete -c phantom -n "__phantom_using_command shell" -l tmux -d "Open shell in new tmux window (-t)"
5602
+ complete -c phantom -n "__phantom_using_command shell" -l tmux-vertical -d "Open shell in vertical split pane"
5603
+ complete -c phantom -n "__phantom_using_command shell" -l tmux-horizontal -d "Open shell in horizontal split pane"
5604
+ complete -c phantom -n "__phantom_using_command shell" -a "(__phantom_list_worktrees)"
5605
+
5606
+ # completion command - shell names
5607
+ complete -c phantom -n "__phantom_using_command completion" -a "fish zsh bash" -d "Shell type"
5608
+
5609
+ # github command options
5610
+ complete -c phantom -n "__phantom_using_command github" -a "checkout" -d "Create a worktree for a GitHub PR or issue"
5611
+ complete -c phantom -n "__phantom_using_command gh" -a "checkout" -d "Create a worktree for a GitHub PR or issue"
5612
+
5613
+ # github checkout command options
5614
+ complete -c phantom -n "__phantom_using_command github checkout" -l base -d "Base branch for new issue branches (issues only)" -x
5615
+ complete -c phantom -n "__phantom_using_command gh checkout" -l base -d "Base branch for new issue branches (issues only)" -x
5616
+
5617
+ # mcp command options
5618
+ complete -c phantom -n "__phantom_using_command mcp" -a "serve" -d "Start MCP server"`;
5619
+
5620
+ // src/completions/phantom-zsh.ts
5621
+ var ZSH_COMPLETION_SCRIPT = `#compdef phantom
5622
+ # Zsh completion for phantom
5623
+ # Load with: eval "$(phantom completion zsh)"
5624
+
5625
+ # Only define the function, don't execute it
5626
+ _phantom() {
5627
+ local -a commands
5628
+ commands=(
5629
+ 'create:Create a new Git worktree (phantom)'
5630
+ 'attach:Attach to an existing branch by creating a new worktree'
5631
+ 'list:List all Git worktrees (phantoms)'
5632
+ 'where:Output the filesystem path of a specific worktree'
5633
+ 'delete:Delete a Git worktree (phantom)'
5634
+ 'exec:Execute a command in a worktree directory'
5635
+ 'review:Review changes in a worktree with a local PR review interface (experimental)'
5636
+ 'shell:Open an interactive shell in a worktree directory'
5637
+ 'github:GitHub integration commands'
5638
+ 'gh:GitHub integration commands (alias)'
5639
+ 'version:Display phantom version information'
5640
+ 'completion:Generate shell completion scripts'
5641
+ 'mcp:Manage Model Context Protocol (MCP) server'
5642
+ )
5643
+
5644
+ _arguments -C '--help[Show help (-h)]' '--version[Show version (-v)]' '1:command:->command' '*::arg:->args'
5645
+
5646
+ case \${state} in
5647
+ command)
5648
+ _describe 'phantom command' commands
5649
+ ;;
5650
+ args)
5651
+ case \${line[1]} in
5652
+ create)
5653
+ _arguments '--shell[Open an interactive shell in the new worktree after creation (-s)]' '--exec[Execute a command in the new worktree after creation (-x)]:command:' '--tmux[Open the worktree in a new tmux window (-t)]' '--tmux-vertical[Open the worktree in a vertical tmux pane]' '--tmux-horizontal[Open the worktree in a horizontal tmux pane]' '*--copy-file[Copy specified files from the current worktree]:file:_files' '--base[Branch or commit to create the new worktree from (defaults to HEAD)]:branch/commit:' '1:name:'
5654
+ ;;
5655
+ attach)
5656
+ _arguments '--shell[Open an interactive shell in the worktree after attaching (-s)]' '--exec[Execute a command in the worktree after attaching (-x)]:command:' '1:branch-name:'
5657
+ ;;
5658
+ list)
5659
+ _arguments '--fzf[Use fzf for interactive selection]' '--names[Output only phantom names (for scripts and completion)]'
5660
+ ;;
5661
+ where|delete|review|shell)
5662
+ local worktrees
5663
+ worktrees=(\${(f)"$(phantom list --names 2>/dev/null)"})
5664
+ if [[ \${line[1]} == "where" ]]; then
5665
+ _arguments '--fzf[Use fzf for interactive selection]' '1:worktree:(\${(q)worktrees[@]})'
5666
+ elif [[ \${line[1]} == "review" ]]; then
5667
+ _arguments '--fzf[Use fzf for interactive selection]' '--base[Base reference for comparison]:reference:' '1:worktree:(\${(q)worktrees[@]})'
5668
+ elif [[ \${line[1]} == "shell" ]]; then
5669
+ _arguments '--fzf[Use fzf for interactive selection]' '--tmux[Open shell in new tmux window (-t)]' '--tmux-vertical[Open shell in vertical split pane]' '--tmux-horizontal[Open shell in horizontal split pane]' '1:worktree:(\${(q)worktrees[@]})'
5670
+ elif [[ \${line[1]} == "delete" ]]; then
5671
+ _arguments '--force[Force deletion even if worktree has uncommitted changes (-f)]' '--current[Delete the current worktree]' '--fzf[Use fzf for interactive selection]' '1:worktree:(\${(q)worktrees[@]})'
5672
+ fi
5673
+ ;;
5674
+ exec)
5675
+ local worktrees
5676
+ worktrees=(\${(f)"$(phantom list --names 2>/dev/null)"})
5677
+ _arguments '--fzf[Use fzf for interactive selection]' '--tmux[Execute command in new tmux window (-t)]' '--tmux-vertical[Execute command in vertical split pane]' '--tmux-horizontal[Execute command in horizontal split pane]' '1:worktree:(\${(q)worktrees[@]})' '*:command:_command_names'
5678
+ ;;
5679
+ completion)
5680
+ _arguments '1:shell:(fish zsh bash)'
5681
+ ;;
5682
+ github|gh)
5683
+ if [[ \${#line} -eq 1 ]]; then
5684
+ _arguments '1:subcommand:(checkout)'
5685
+ elif [[ \${line[2]} == "checkout" ]]; then
5686
+ _arguments '--base[Base branch for new issue branches (issues only)]:branch:' '1:number:'
5687
+ fi
5688
+ ;;
5689
+ mcp)
5690
+ _arguments '1:action:(serve)'
5691
+ ;;
5692
+ esac
5693
+ ;;
5694
+ esac
5695
+ }
5696
+
5697
+ if [ "$funcstack[1]" = "_phantom" ]; then
5698
+ _phantom "$@"
5699
+ else
5700
+ compdef _phantom phantom
5701
+ fi`;
5702
+
5703
+ // src/handlers/completion.ts
5734
5704
  function completionHandler(args2) {
5735
5705
  const shell = args2[0];
5736
5706
  if (!shell) {
@@ -13352,7 +13322,7 @@ var StdioServerTransport = class {
13352
13322
  // ../mcp/package.json
13353
13323
  var package_default = {
13354
13324
  name: "@aku11i/phantom-mcp",
13355
- version: "2.2.3",
13325
+ version: "2.2.4",
13356
13326
  private: true,
13357
13327
  type: "module",
13358
13328
  main: "./src/index.ts",
@@ -13850,7 +13820,7 @@ import { parseArgs as parseArgs10 } from "node:util";
13850
13820
  // package.json
13851
13821
  var package_default2 = {
13852
13822
  name: "@aku11i/phantom-cli",
13853
- version: "2.2.3",
13823
+ version: "2.2.4",
13854
13824
  private: true,
13855
13825
  type: "module",
13856
13826
  scripts: {
@@ -13858,6 +13828,10 @@ var package_default2 = {
13858
13828
  prebuild: "git clean -fdx dist",
13859
13829
  build: "node build.ts",
13860
13830
  typecheck: "tsc --noEmit",
13831
+ "test:shell": "pnpm run test:shell:bash && pnpm run test:shell:zsh && pnpm run test:shell:fish",
13832
+ "test:shell:bash": "node --test --experimental-strip-types --experimental-test-module-mocks src/completions/phantom.bash.test.shell.js",
13833
+ "test:shell:fish": "node --test --experimental-strip-types --experimental-test-module-mocks src/completions/phantom.fish.test.shell.js",
13834
+ "test:shell:zsh": "node --test --experimental-strip-types --experimental-test-module-mocks src/completions/phantom.zsh.test.shell.js",
13861
13835
  test: 'node --test --experimental-strip-types --experimental-test-module-mocks "src/**/*.test.js"',
13862
13836
  prepublishOnly: "pnpm build"
13863
13837
  },