@solaqua/gji 0.6.0 → 0.6.1
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 +1 -1
- package/dist/config.d.ts +1 -0
- package/dist/config.js +1 -1
- package/dist/gji-bundle.mjs +123 -89
- package/dist/shell-completion.js +124 -89
- package/man/man1/gji-back.1 +1 -1
- package/man/man1/gji-clean.1 +1 -1
- package/man/man1/gji-completion.1 +1 -1
- package/man/man1/gji-config.1 +1 -1
- package/man/man1/gji-go.1 +1 -1
- package/man/man1/gji-history.1 +1 -1
- package/man/man1/gji-init.1 +1 -1
- package/man/man1/gji-ls.1 +1 -1
- package/man/man1/gji-new.1 +1 -1
- package/man/man1/gji-open.1 +1 -1
- package/man/man1/gji-pr.1 +1 -1
- package/man/man1/gji-remove.1 +1 -1
- package/man/man1/gji-root.1 +1 -1
- package/man/man1/gji-status.1 +1 -1
- package/man/man1/gji-sync.1 +1 -1
- package/man/man1/gji-trigger-hook.1 +1 -1
- package/man/man1/gji-warp.1 +1 -1
- package/man/man1/gji.1 +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -168,7 +168,7 @@ gji trigger-hook afterCreate # re-run setup in the current worktree
|
|
|
168
168
|
|
|
169
169
|
- **vs raw `git worktree`**: same underlying capability, but with branch-first commands, shell handoff, PR checkout, hooks, sync, and cleanup built into the workflow
|
|
170
170
|
- **vs `lazygit`**: `lazygit` is a broad Git UI; `gji` is narrower and faster for opening, jumping between, and removing isolated branch directories
|
|
171
|
-
- **vs `ghq`**: `ghq` organizes repositories; `gji` organizes
|
|
171
|
+
- **vs `ghq`**: `ghq` organizes where repositories live; `gji` organizes which branch, PR, or worktree you should be in once you are inside one
|
|
172
172
|
|
|
173
173
|
Use `gji` when your bottleneck is repeated context switching between features, reviews, and maintenance work without disturbing what is already open.
|
|
174
174
|
|
package/dist/config.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export declare const CONFIG_FILE_NAME = ".gji.json";
|
|
|
2
2
|
export declare const GLOBAL_CONFIG_DIRECTORY = ".config/gji";
|
|
3
3
|
export declare const GLOBAL_CONFIG_NAME = "config.json";
|
|
4
4
|
export declare const KNOWN_CONFIG_KEYS: ReadonlySet<string>;
|
|
5
|
+
export declare const KNOWN_GLOBAL_CONFIG_KEYS: ReadonlySet<string>;
|
|
5
6
|
export type GjiConfig = Record<string, unknown>;
|
|
6
7
|
export interface LoadedConfig {
|
|
7
8
|
config: GjiConfig;
|
package/dist/config.js
CHANGED
package/dist/gji-bundle.mjs
CHANGED
|
@@ -14482,7 +14482,11 @@ var TOP_LEVEL_COMMANDS = [
|
|
|
14482
14482
|
{ name: "init", description: "print or install shell integration" },
|
|
14483
14483
|
{ name: "completion", description: "print shell completion definitions" },
|
|
14484
14484
|
{ name: "pr", description: "fetch a pull request into a linked worktree" },
|
|
14485
|
+
{ name: "back", description: "navigate to the previously visited worktree" },
|
|
14486
|
+
{ name: "history", description: "show navigation history" },
|
|
14487
|
+
{ name: "open", description: "open the worktree in an editor" },
|
|
14485
14488
|
{ name: "go", description: "print or select a worktree path" },
|
|
14489
|
+
{ name: "jump", description: "alias of go" },
|
|
14486
14490
|
{ name: "root", description: "print the main repository root path" },
|
|
14487
14491
|
{ name: "status", description: "summarize repository and worktree health" },
|
|
14488
14492
|
{ name: "sync", description: "fetch and update one or all worktrees" },
|
|
@@ -14491,20 +14495,12 @@ var TOP_LEVEL_COMMANDS = [
|
|
|
14491
14495
|
{ name: "remove", description: "remove a linked worktree and delete its branch when present" },
|
|
14492
14496
|
{ name: "rm", description: "alias of remove" },
|
|
14493
14497
|
{ name: "trigger-hook", description: "run a named hook in the current worktree" },
|
|
14498
|
+
{ name: "warp", description: "jump to any worktree across all known repos" },
|
|
14494
14499
|
{ name: "config", description: "manage global config defaults" }
|
|
14495
14500
|
];
|
|
14496
14501
|
var SHELL_NAMES = ["bash", "fish", "zsh"];
|
|
14497
14502
|
var HOOK_NAMES = ["afterCreate", "afterEnter", "beforeRemove"];
|
|
14498
|
-
var CONFIG_KEYS =
|
|
14499
|
-
"branchPrefix",
|
|
14500
|
-
"syncRemote",
|
|
14501
|
-
"syncDefaultBranch",
|
|
14502
|
-
"syncFiles",
|
|
14503
|
-
"skipInstallPrompt",
|
|
14504
|
-
"installSaveTarget",
|
|
14505
|
-
"hooks",
|
|
14506
|
-
"repos"
|
|
14507
|
-
];
|
|
14503
|
+
var CONFIG_KEYS = Array.from(KNOWN_GLOBAL_CONFIG_KEYS);
|
|
14508
14504
|
function renderShellCompletion(shell) {
|
|
14509
14505
|
switch (shell) {
|
|
14510
14506
|
case "bash":
|
|
@@ -14538,7 +14534,7 @@ _gji_completion() {
|
|
|
14538
14534
|
|
|
14539
14535
|
case "$command_name" in
|
|
14540
14536
|
new)
|
|
14541
|
-
COMPREPLY=( $(compgen -W "--detached --dry-run --json --help" -- "$cur") )
|
|
14537
|
+
COMPREPLY=( $(compgen -W "--detached --force --open --editor --dry-run --json --help" -- "$cur") )
|
|
14542
14538
|
;;
|
|
14543
14539
|
init)
|
|
14544
14540
|
COMPREPLY=( $(compgen -W "${shells} --write --help" -- "$cur") )
|
|
@@ -14549,7 +14545,16 @@ _gji_completion() {
|
|
|
14549
14545
|
pr)
|
|
14550
14546
|
COMPREPLY=( $(compgen -W "--dry-run --json --help" -- "$cur") )
|
|
14551
14547
|
;;
|
|
14552
|
-
|
|
14548
|
+
back)
|
|
14549
|
+
COMPREPLY=( $(compgen -W "--print --help" -- "$cur") )
|
|
14550
|
+
;;
|
|
14551
|
+
history)
|
|
14552
|
+
COMPREPLY=( $(compgen -W "--json --help" -- "$cur") )
|
|
14553
|
+
;;
|
|
14554
|
+
open)
|
|
14555
|
+
COMPREPLY=( $(compgen -W "$(__gji_worktree_branches) --editor --save --workspace --help" -- "$cur") )
|
|
14556
|
+
;;
|
|
14557
|
+
go|jump)
|
|
14553
14558
|
COMPREPLY=( $(compgen -W "$(__gji_worktree_branches) --print --help" -- "$cur") )
|
|
14554
14559
|
;;
|
|
14555
14560
|
root)
|
|
@@ -14573,6 +14578,9 @@ _gji_completion() {
|
|
|
14573
14578
|
trigger-hook)
|
|
14574
14579
|
COMPREPLY=( $(compgen -W "${hooks} --help" -- "$cur") )
|
|
14575
14580
|
;;
|
|
14581
|
+
warp)
|
|
14582
|
+
COMPREPLY=( $(compgen -W "-n --new --print --json --help" -- "$cur") )
|
|
14583
|
+
;;
|
|
14576
14584
|
config)
|
|
14577
14585
|
if [ "$COMP_CWORD" -eq 2 ]; then
|
|
14578
14586
|
COMPREPLY=( $(compgen -W "get set unset" -- "$cur") )
|
|
@@ -14636,6 +14644,9 @@ complete -c gji -f
|
|
|
14636
14644
|
${commandLines}
|
|
14637
14645
|
|
|
14638
14646
|
complete -c gji -n '__fish_seen_subcommand_from new' -l detached -d 'create a detached worktree without a branch'
|
|
14647
|
+
complete -c gji -n '__fish_seen_subcommand_from new' -l force -d 'remove and recreate the worktree if the target path already exists'
|
|
14648
|
+
complete -c gji -n '__fish_seen_subcommand_from new' -l open -d 'open the new worktree in an editor after creation'
|
|
14649
|
+
complete -c gji -n '__fish_seen_subcommand_from new' -l editor -r -d 'editor CLI to use with --open (code, cursor, zed, \u2026)'
|
|
14639
14650
|
complete -c gji -n '__fish_seen_subcommand_from new' -l dry-run -d 'show what would be created without executing any git commands or writing files'
|
|
14640
14651
|
complete -c gji -n '__fish_seen_subcommand_from new' -l json -d 'emit JSON on success or error instead of human-readable output'
|
|
14641
14652
|
|
|
@@ -14649,8 +14660,17 @@ complete -c gji -n '__fish_seen_subcommand_from completion' -a 'zsh' -d 'shell'
|
|
|
14649
14660
|
complete -c gji -n '__fish_seen_subcommand_from pr' -l dry-run -d 'show what would be created without executing any git commands or writing files'
|
|
14650
14661
|
complete -c gji -n '__fish_seen_subcommand_from pr' -l json -d 'emit JSON on success or error instead of human-readable output'
|
|
14651
14662
|
|
|
14652
|
-
complete -c gji -n '__fish_seen_subcommand_from
|
|
14653
|
-
|
|
14663
|
+
complete -c gji -n '__fish_seen_subcommand_from back' -l print -d 'print the resolved worktree path explicitly'
|
|
14664
|
+
|
|
14665
|
+
complete -c gji -n '__fish_seen_subcommand_from history' -l json -d 'print history as JSON'
|
|
14666
|
+
|
|
14667
|
+
complete -c gji -n '__fish_seen_subcommand_from open' -l editor -r -d 'editor CLI to use (code, cursor, zed, windsurf, subl, \u2026)'
|
|
14668
|
+
complete -c gji -n '__fish_seen_subcommand_from open' -l save -d 'save the chosen editor to global config'
|
|
14669
|
+
complete -c gji -n '__fish_seen_subcommand_from open' -l workspace -d 'generate a .code-workspace file before opening (VS Code / Cursor / Windsurf)'
|
|
14670
|
+
complete -c gji -n '__fish_seen_subcommand_from open' -a '(__gji_worktree_branches)' -d 'worktree branch'
|
|
14671
|
+
|
|
14672
|
+
complete -c gji -n '__fish_seen_subcommand_from go jump' -l print -d 'print the resolved worktree path explicitly'
|
|
14673
|
+
complete -c gji -n '__fish_seen_subcommand_from go jump' -a '(__gji_worktree_branches)' -d 'worktree branch'
|
|
14654
14674
|
|
|
14655
14675
|
complete -c gji -n '__fish_seen_subcommand_from root' -l print -d 'print the resolved repository root path explicitly'
|
|
14656
14676
|
|
|
@@ -14674,6 +14694,10 @@ complete -c gji -n '__fish_seen_subcommand_from remove rm' -a '(__gji_worktree_b
|
|
|
14674
14694
|
|
|
14675
14695
|
${hookLines}
|
|
14676
14696
|
|
|
14697
|
+
complete -c gji -n '__fish_seen_subcommand_from warp' -s n -l new -d 'create a new worktree in a registered repo'
|
|
14698
|
+
complete -c gji -n '__fish_seen_subcommand_from warp' -l print -d 'print the resolved worktree path without changing directory'
|
|
14699
|
+
complete -c gji -n '__fish_seen_subcommand_from warp' -l json -d 'emit JSON on success or error instead of human-readable output'
|
|
14700
|
+
|
|
14677
14701
|
complete -c gji -n '__fish_seen_subcommand_from config; and __gji_should_complete_config_action' -a 'get set unset' -d 'config action'
|
|
14678
14702
|
${configKeyLines}`;
|
|
14679
14703
|
}
|
|
@@ -14684,89 +14708,99 @@ function renderZshCompletion() {
|
|
|
14684
14708
|
const configKeys = CONFIG_KEYS.join(" ");
|
|
14685
14709
|
const shells = SHELL_NAMES.join(" ");
|
|
14686
14710
|
const hooks = HOOK_NAMES.join(" ");
|
|
14687
|
-
return
|
|
14711
|
+
return `#compdef gji
|
|
14712
|
+
|
|
14713
|
+
__gji_worktree_branches() {
|
|
14688
14714
|
command gji ls --compact 2>/dev/null | awk 'NR > 1 { branch = ($1 == "*" ? $2 : $1); if (branch != "(detached)") print branch }'
|
|
14689
14715
|
}
|
|
14690
14716
|
|
|
14691
|
-
|
|
14692
|
-
|
|
14693
|
-
local -a commands worktree_branches
|
|
14717
|
+
local context state line
|
|
14718
|
+
local -a commands worktree_branches
|
|
14694
14719
|
|
|
14695
|
-
|
|
14696
|
-
|
|
14697
|
-
|
|
14720
|
+
commands=(
|
|
14721
|
+
${commandLines}
|
|
14722
|
+
)
|
|
14698
14723
|
|
|
14699
|
-
|
|
14700
|
-
|
|
14701
|
-
|
|
14702
|
-
|
|
14703
|
-
|
|
14704
|
-
case "\${words[2]}" in
|
|
14705
|
-
new)
|
|
14706
|
-
_arguments '--detached[create a detached worktree without a branch]' '--dry-run[show what would be created without executing any git commands or writing files]' '--json[emit JSON on success or error instead of human-readable output]' '2:branch: '
|
|
14707
|
-
;;
|
|
14708
|
-
init)
|
|
14709
|
-
_arguments '--write[write the integration to the shell config file]' '2:shell:(${shells})'
|
|
14710
|
-
;;
|
|
14711
|
-
completion)
|
|
14712
|
-
_arguments '2:shell:(${shells})'
|
|
14713
|
-
;;
|
|
14714
|
-
pr)
|
|
14715
|
-
_arguments '--dry-run[show what would be created without executing any git commands or writing files]' '--json[emit JSON on success or error instead of human-readable output]' '2:ref: '
|
|
14716
|
-
;;
|
|
14717
|
-
go)
|
|
14718
|
-
_arguments '--print[print the resolved worktree path explicitly]' '2:branch:->worktrees'
|
|
14719
|
-
;;
|
|
14720
|
-
root)
|
|
14721
|
-
_arguments '--print[print the resolved repository root path explicitly]'
|
|
14722
|
-
;;
|
|
14723
|
-
status)
|
|
14724
|
-
_arguments '--json[print repository and worktree health as JSON]'
|
|
14725
|
-
;;
|
|
14726
|
-
sync)
|
|
14727
|
-
_arguments '--all[sync every worktree in the repository]' '--json[emit JSON on success or error instead of human-readable output]'
|
|
14728
|
-
;;
|
|
14729
|
-
ls)
|
|
14730
|
-
_arguments '--compact[show only branch and path columns]' '--json[print active worktrees as JSON]'
|
|
14731
|
-
;;
|
|
14732
|
-
clean)
|
|
14733
|
-
_arguments '(-f --force)'{-f,--force}'[bypass prompts, force-remove dirty worktrees, and force-delete unmerged branches]' '--stale[only target clean worktrees whose upstream is gone and branch is merged into the default branch]' '--dry-run[show what would be deleted without removing anything]' '--json[emit JSON on success or error instead of human-readable output]'
|
|
14734
|
-
;;
|
|
14735
|
-
remove|rm)
|
|
14736
|
-
_arguments '(-f --force)'{-f,--force}'[bypass prompts, force-remove a dirty worktree, and force-delete an unmerged branch]' '--dry-run[show what would be deleted without removing anything]' '--json[emit JSON on success or error instead of human-readable output]' '2:branch:->worktrees'
|
|
14737
|
-
;;
|
|
14738
|
-
trigger-hook)
|
|
14739
|
-
_arguments "2:hook:(${hooks})"
|
|
14740
|
-
;;
|
|
14741
|
-
config)
|
|
14742
|
-
if (( CURRENT == 3 )); then
|
|
14743
|
-
_values 'config action' get set unset
|
|
14744
|
-
return
|
|
14745
|
-
fi
|
|
14724
|
+
if (( CURRENT == 2 )); then
|
|
14725
|
+
_describe 'command' commands
|
|
14726
|
+
return
|
|
14727
|
+
fi
|
|
14746
14728
|
|
|
14747
|
-
|
|
14748
|
-
|
|
14749
|
-
|
|
14750
|
-
|
|
14751
|
-
|
|
14752
|
-
|
|
14753
|
-
|
|
14754
|
-
|
|
14755
|
-
|
|
14756
|
-
|
|
14729
|
+
case "\${words[2]}" in
|
|
14730
|
+
new)
|
|
14731
|
+
_arguments '--detached[create a detached worktree without a branch]' '--force[remove and recreate the worktree if the target path already exists]' '--open[open the new worktree in an editor after creation]' '--editor[editor CLI to use with --open (code, cursor, zed, \u2026)]:editor:' '--dry-run[show what would be created without executing any git commands or writing files]' '--json[emit JSON on success or error instead of human-readable output]' '2:branch: '
|
|
14732
|
+
;;
|
|
14733
|
+
init)
|
|
14734
|
+
_arguments '--write[write the integration to the shell config file]' '2:shell:(${shells})'
|
|
14735
|
+
;;
|
|
14736
|
+
completion)
|
|
14737
|
+
_arguments '2:shell:(${shells})'
|
|
14738
|
+
;;
|
|
14739
|
+
pr)
|
|
14740
|
+
_arguments '--dry-run[show what would be created without executing any git commands or writing files]' '--json[emit JSON on success or error instead of human-readable output]' '2:ref: '
|
|
14741
|
+
;;
|
|
14742
|
+
back)
|
|
14743
|
+
_arguments '--print[print the resolved worktree path explicitly]' '2:steps: '
|
|
14744
|
+
;;
|
|
14745
|
+
history)
|
|
14746
|
+
_arguments '--json[print history as JSON]'
|
|
14747
|
+
;;
|
|
14748
|
+
open)
|
|
14749
|
+
_arguments '--editor[editor CLI to use (code, cursor, zed, windsurf, subl, \u2026)]:editor:' '--save[save the chosen editor to global config]' '--workspace[generate a .code-workspace file before opening (VS Code / Cursor / Windsurf)]' '2:branch:->worktrees'
|
|
14750
|
+
;;
|
|
14751
|
+
go|jump)
|
|
14752
|
+
_arguments '--print[print the resolved worktree path explicitly]' '2:branch:->worktrees'
|
|
14753
|
+
;;
|
|
14754
|
+
root)
|
|
14755
|
+
_arguments '--print[print the resolved repository root path explicitly]'
|
|
14756
|
+
;;
|
|
14757
|
+
status)
|
|
14758
|
+
_arguments '--json[print repository and worktree health as JSON]'
|
|
14759
|
+
;;
|
|
14760
|
+
sync)
|
|
14761
|
+
_arguments '--all[sync every worktree in the repository]' '--json[emit JSON on success or error instead of human-readable output]'
|
|
14762
|
+
;;
|
|
14763
|
+
ls)
|
|
14764
|
+
_arguments '--compact[show only branch and path columns]' '--json[print active worktrees as JSON]'
|
|
14765
|
+
;;
|
|
14766
|
+
clean)
|
|
14767
|
+
_arguments '(-f --force)'{-f,--force}'[bypass prompts, force-remove dirty worktrees, and force-delete unmerged branches]' '--stale[only target clean worktrees whose upstream is gone and branch is merged into the default branch]' '--dry-run[show what would be deleted without removing anything]' '--json[emit JSON on success or error instead of human-readable output]'
|
|
14768
|
+
;;
|
|
14769
|
+
remove|rm)
|
|
14770
|
+
_arguments '(-f --force)'{-f,--force}'[bypass prompts, force-remove a dirty worktree, and force-delete an unmerged branch]' '--dry-run[show what would be deleted without removing anything]' '--json[emit JSON on success or error instead of human-readable output]' '2:branch:->worktrees'
|
|
14771
|
+
;;
|
|
14772
|
+
trigger-hook)
|
|
14773
|
+
_arguments "2:hook:(${hooks})"
|
|
14774
|
+
;;
|
|
14775
|
+
warp)
|
|
14776
|
+
_arguments '(-n --new)'{-n,--new}'[create a new worktree in a registered repo]:branch:' '--print[print the resolved worktree path without changing directory]' '--json[emit JSON on success or error instead of human-readable output]' '2:branch: '
|
|
14777
|
+
;;
|
|
14778
|
+
config)
|
|
14779
|
+
if (( CURRENT == 3 )); then
|
|
14780
|
+
_values 'config action' get set unset
|
|
14781
|
+
return
|
|
14782
|
+
fi
|
|
14757
14783
|
|
|
14758
|
-
|
|
14759
|
-
|
|
14760
|
-
|
|
14761
|
-
|
|
14762
|
-
|
|
14763
|
-
|
|
14764
|
-
|
|
14765
|
-
|
|
14766
|
-
|
|
14767
|
-
|
|
14784
|
+
case "\${words[3]}" in
|
|
14785
|
+
get|unset)
|
|
14786
|
+
_arguments '3:key:->config_keys'
|
|
14787
|
+
;;
|
|
14788
|
+
set)
|
|
14789
|
+
_arguments '3:key:->config_keys' '4:value: '
|
|
14790
|
+
;;
|
|
14791
|
+
esac
|
|
14792
|
+
;;
|
|
14793
|
+
esac
|
|
14768
14794
|
|
|
14769
|
-
|
|
14795
|
+
case "$state" in
|
|
14796
|
+
worktrees)
|
|
14797
|
+
worktree_branches=(\${(@f)$(__gji_worktree_branches)})
|
|
14798
|
+
_describe 'worktree branch' worktree_branches
|
|
14799
|
+
;;
|
|
14800
|
+
config_keys)
|
|
14801
|
+
_values 'config key' ${configKeys}
|
|
14802
|
+
;;
|
|
14803
|
+
esac`;
|
|
14770
14804
|
}
|
|
14771
14805
|
function escapeSingleQuotes(value) {
|
|
14772
14806
|
return value.replace(/'/g, `'\\''`);
|
package/dist/shell-completion.js
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
|
+
import { KNOWN_GLOBAL_CONFIG_KEYS } from './config.js';
|
|
1
2
|
const TOP_LEVEL_COMMANDS = [
|
|
2
3
|
{ name: 'new', description: 'create a new branch or detached linked worktree' },
|
|
3
4
|
{ name: 'init', description: 'print or install shell integration' },
|
|
4
5
|
{ name: 'completion', description: 'print shell completion definitions' },
|
|
5
6
|
{ name: 'pr', description: 'fetch a pull request into a linked worktree' },
|
|
7
|
+
{ name: 'back', description: 'navigate to the previously visited worktree' },
|
|
8
|
+
{ name: 'history', description: 'show navigation history' },
|
|
9
|
+
{ name: 'open', description: 'open the worktree in an editor' },
|
|
6
10
|
{ name: 'go', description: 'print or select a worktree path' },
|
|
11
|
+
{ name: 'jump', description: 'alias of go' },
|
|
7
12
|
{ name: 'root', description: 'print the main repository root path' },
|
|
8
13
|
{ name: 'status', description: 'summarize repository and worktree health' },
|
|
9
14
|
{ name: 'sync', description: 'fetch and update one or all worktrees' },
|
|
@@ -12,20 +17,12 @@ const TOP_LEVEL_COMMANDS = [
|
|
|
12
17
|
{ name: 'remove', description: 'remove a linked worktree and delete its branch when present' },
|
|
13
18
|
{ name: 'rm', description: 'alias of remove' },
|
|
14
19
|
{ name: 'trigger-hook', description: 'run a named hook in the current worktree' },
|
|
20
|
+
{ name: 'warp', description: 'jump to any worktree across all known repos' },
|
|
15
21
|
{ name: 'config', description: 'manage global config defaults' },
|
|
16
22
|
];
|
|
17
23
|
const SHELL_NAMES = ['bash', 'fish', 'zsh'];
|
|
18
24
|
const HOOK_NAMES = ['afterCreate', 'afterEnter', 'beforeRemove'];
|
|
19
|
-
const CONFIG_KEYS =
|
|
20
|
-
'branchPrefix',
|
|
21
|
-
'syncRemote',
|
|
22
|
-
'syncDefaultBranch',
|
|
23
|
-
'syncFiles',
|
|
24
|
-
'skipInstallPrompt',
|
|
25
|
-
'installSaveTarget',
|
|
26
|
-
'hooks',
|
|
27
|
-
'repos',
|
|
28
|
-
];
|
|
25
|
+
const CONFIG_KEYS = Array.from(KNOWN_GLOBAL_CONFIG_KEYS);
|
|
29
26
|
export function renderShellCompletion(shell) {
|
|
30
27
|
switch (shell) {
|
|
31
28
|
case 'bash':
|
|
@@ -59,7 +56,7 @@ _gji_completion() {
|
|
|
59
56
|
|
|
60
57
|
case "$command_name" in
|
|
61
58
|
new)
|
|
62
|
-
COMPREPLY=( $(compgen -W "--detached --dry-run --json --help" -- "$cur") )
|
|
59
|
+
COMPREPLY=( $(compgen -W "--detached --force --open --editor --dry-run --json --help" -- "$cur") )
|
|
63
60
|
;;
|
|
64
61
|
init)
|
|
65
62
|
COMPREPLY=( $(compgen -W "${shells} --write --help" -- "$cur") )
|
|
@@ -70,7 +67,16 @@ _gji_completion() {
|
|
|
70
67
|
pr)
|
|
71
68
|
COMPREPLY=( $(compgen -W "--dry-run --json --help" -- "$cur") )
|
|
72
69
|
;;
|
|
73
|
-
|
|
70
|
+
back)
|
|
71
|
+
COMPREPLY=( $(compgen -W "--print --help" -- "$cur") )
|
|
72
|
+
;;
|
|
73
|
+
history)
|
|
74
|
+
COMPREPLY=( $(compgen -W "--json --help" -- "$cur") )
|
|
75
|
+
;;
|
|
76
|
+
open)
|
|
77
|
+
COMPREPLY=( $(compgen -W "$(__gji_worktree_branches) --editor --save --workspace --help" -- "$cur") )
|
|
78
|
+
;;
|
|
79
|
+
go|jump)
|
|
74
80
|
COMPREPLY=( $(compgen -W "$(__gji_worktree_branches) --print --help" -- "$cur") )
|
|
75
81
|
;;
|
|
76
82
|
root)
|
|
@@ -94,6 +100,9 @@ _gji_completion() {
|
|
|
94
100
|
trigger-hook)
|
|
95
101
|
COMPREPLY=( $(compgen -W "${hooks} --help" -- "$cur") )
|
|
96
102
|
;;
|
|
103
|
+
warp)
|
|
104
|
+
COMPREPLY=( $(compgen -W "-n --new --print --json --help" -- "$cur") )
|
|
105
|
+
;;
|
|
97
106
|
config)
|
|
98
107
|
if [ "$COMP_CWORD" -eq 2 ]; then
|
|
99
108
|
COMPREPLY=( $(compgen -W "get set unset" -- "$cur") )
|
|
@@ -149,6 +158,9 @@ complete -c gji -f
|
|
|
149
158
|
${commandLines}
|
|
150
159
|
|
|
151
160
|
complete -c gji -n '__fish_seen_subcommand_from new' -l detached -d 'create a detached worktree without a branch'
|
|
161
|
+
complete -c gji -n '__fish_seen_subcommand_from new' -l force -d 'remove and recreate the worktree if the target path already exists'
|
|
162
|
+
complete -c gji -n '__fish_seen_subcommand_from new' -l open -d 'open the new worktree in an editor after creation'
|
|
163
|
+
complete -c gji -n '__fish_seen_subcommand_from new' -l editor -r -d 'editor CLI to use with --open (code, cursor, zed, …)'
|
|
152
164
|
complete -c gji -n '__fish_seen_subcommand_from new' -l dry-run -d 'show what would be created without executing any git commands or writing files'
|
|
153
165
|
complete -c gji -n '__fish_seen_subcommand_from new' -l json -d 'emit JSON on success or error instead of human-readable output'
|
|
154
166
|
|
|
@@ -162,8 +174,17 @@ complete -c gji -n '__fish_seen_subcommand_from completion' -a 'zsh' -d 'shell'
|
|
|
162
174
|
complete -c gji -n '__fish_seen_subcommand_from pr' -l dry-run -d 'show what would be created without executing any git commands or writing files'
|
|
163
175
|
complete -c gji -n '__fish_seen_subcommand_from pr' -l json -d 'emit JSON on success or error instead of human-readable output'
|
|
164
176
|
|
|
165
|
-
complete -c gji -n '__fish_seen_subcommand_from
|
|
166
|
-
|
|
177
|
+
complete -c gji -n '__fish_seen_subcommand_from back' -l print -d 'print the resolved worktree path explicitly'
|
|
178
|
+
|
|
179
|
+
complete -c gji -n '__fish_seen_subcommand_from history' -l json -d 'print history as JSON'
|
|
180
|
+
|
|
181
|
+
complete -c gji -n '__fish_seen_subcommand_from open' -l editor -r -d 'editor CLI to use (code, cursor, zed, windsurf, subl, …)'
|
|
182
|
+
complete -c gji -n '__fish_seen_subcommand_from open' -l save -d 'save the chosen editor to global config'
|
|
183
|
+
complete -c gji -n '__fish_seen_subcommand_from open' -l workspace -d 'generate a .code-workspace file before opening (VS Code / Cursor / Windsurf)'
|
|
184
|
+
complete -c gji -n '__fish_seen_subcommand_from open' -a '(__gji_worktree_branches)' -d 'worktree branch'
|
|
185
|
+
|
|
186
|
+
complete -c gji -n '__fish_seen_subcommand_from go jump' -l print -d 'print the resolved worktree path explicitly'
|
|
187
|
+
complete -c gji -n '__fish_seen_subcommand_from go jump' -a '(__gji_worktree_branches)' -d 'worktree branch'
|
|
167
188
|
|
|
168
189
|
complete -c gji -n '__fish_seen_subcommand_from root' -l print -d 'print the resolved repository root path explicitly'
|
|
169
190
|
|
|
@@ -187,6 +208,10 @@ complete -c gji -n '__fish_seen_subcommand_from remove rm' -a '(__gji_worktree_b
|
|
|
187
208
|
|
|
188
209
|
${hookLines}
|
|
189
210
|
|
|
211
|
+
complete -c gji -n '__fish_seen_subcommand_from warp' -s n -l new -d 'create a new worktree in a registered repo'
|
|
212
|
+
complete -c gji -n '__fish_seen_subcommand_from warp' -l print -d 'print the resolved worktree path without changing directory'
|
|
213
|
+
complete -c gji -n '__fish_seen_subcommand_from warp' -l json -d 'emit JSON on success or error instead of human-readable output'
|
|
214
|
+
|
|
190
215
|
complete -c gji -n '__fish_seen_subcommand_from config; and __gji_should_complete_config_action' -a 'get set unset' -d 'config action'
|
|
191
216
|
${configKeyLines}`;
|
|
192
217
|
}
|
|
@@ -195,89 +220,99 @@ function renderZshCompletion() {
|
|
|
195
220
|
const configKeys = CONFIG_KEYS.join(' ');
|
|
196
221
|
const shells = SHELL_NAMES.join(' ');
|
|
197
222
|
const hooks = HOOK_NAMES.join(' ');
|
|
198
|
-
return
|
|
223
|
+
return `#compdef gji
|
|
224
|
+
|
|
225
|
+
__gji_worktree_branches() {
|
|
199
226
|
command gji ls --compact 2>/dev/null | awk 'NR > 1 { branch = ($1 == "*" ? $2 : $1); if (branch != "(detached)") print branch }'
|
|
200
227
|
}
|
|
201
228
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
local -a commands worktree_branches
|
|
205
|
-
|
|
206
|
-
commands=(
|
|
207
|
-
${commandLines}
|
|
208
|
-
)
|
|
229
|
+
local context state line
|
|
230
|
+
local -a commands worktree_branches
|
|
209
231
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
fi
|
|
232
|
+
commands=(
|
|
233
|
+
${commandLines}
|
|
234
|
+
)
|
|
214
235
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
init)
|
|
220
|
-
_arguments '--write[write the integration to the shell config file]' '2:shell:(${shells})'
|
|
221
|
-
;;
|
|
222
|
-
completion)
|
|
223
|
-
_arguments '2:shell:(${shells})'
|
|
224
|
-
;;
|
|
225
|
-
pr)
|
|
226
|
-
_arguments '--dry-run[show what would be created without executing any git commands or writing files]' '--json[emit JSON on success or error instead of human-readable output]' '2:ref: '
|
|
227
|
-
;;
|
|
228
|
-
go)
|
|
229
|
-
_arguments '--print[print the resolved worktree path explicitly]' '2:branch:->worktrees'
|
|
230
|
-
;;
|
|
231
|
-
root)
|
|
232
|
-
_arguments '--print[print the resolved repository root path explicitly]'
|
|
233
|
-
;;
|
|
234
|
-
status)
|
|
235
|
-
_arguments '--json[print repository and worktree health as JSON]'
|
|
236
|
-
;;
|
|
237
|
-
sync)
|
|
238
|
-
_arguments '--all[sync every worktree in the repository]' '--json[emit JSON on success or error instead of human-readable output]'
|
|
239
|
-
;;
|
|
240
|
-
ls)
|
|
241
|
-
_arguments '--compact[show only branch and path columns]' '--json[print active worktrees as JSON]'
|
|
242
|
-
;;
|
|
243
|
-
clean)
|
|
244
|
-
_arguments '(-f --force)'{-f,--force}'[bypass prompts, force-remove dirty worktrees, and force-delete unmerged branches]' '--stale[only target clean worktrees whose upstream is gone and branch is merged into the default branch]' '--dry-run[show what would be deleted without removing anything]' '--json[emit JSON on success or error instead of human-readable output]'
|
|
245
|
-
;;
|
|
246
|
-
remove|rm)
|
|
247
|
-
_arguments '(-f --force)'{-f,--force}'[bypass prompts, force-remove a dirty worktree, and force-delete an unmerged branch]' '--dry-run[show what would be deleted without removing anything]' '--json[emit JSON on success or error instead of human-readable output]' '2:branch:->worktrees'
|
|
248
|
-
;;
|
|
249
|
-
trigger-hook)
|
|
250
|
-
_arguments "2:hook:(${hooks})"
|
|
251
|
-
;;
|
|
252
|
-
config)
|
|
253
|
-
if (( CURRENT == 3 )); then
|
|
254
|
-
_values 'config action' get set unset
|
|
255
|
-
return
|
|
256
|
-
fi
|
|
236
|
+
if (( CURRENT == 2 )); then
|
|
237
|
+
_describe 'command' commands
|
|
238
|
+
return
|
|
239
|
+
fi
|
|
257
240
|
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
241
|
+
case "\${words[2]}" in
|
|
242
|
+
new)
|
|
243
|
+
_arguments '--detached[create a detached worktree without a branch]' '--force[remove and recreate the worktree if the target path already exists]' '--open[open the new worktree in an editor after creation]' '--editor[editor CLI to use with --open (code, cursor, zed, …)]:editor:' '--dry-run[show what would be created without executing any git commands or writing files]' '--json[emit JSON on success or error instead of human-readable output]' '2:branch: '
|
|
244
|
+
;;
|
|
245
|
+
init)
|
|
246
|
+
_arguments '--write[write the integration to the shell config file]' '2:shell:(${shells})'
|
|
247
|
+
;;
|
|
248
|
+
completion)
|
|
249
|
+
_arguments '2:shell:(${shells})'
|
|
250
|
+
;;
|
|
251
|
+
pr)
|
|
252
|
+
_arguments '--dry-run[show what would be created without executing any git commands or writing files]' '--json[emit JSON on success or error instead of human-readable output]' '2:ref: '
|
|
253
|
+
;;
|
|
254
|
+
back)
|
|
255
|
+
_arguments '--print[print the resolved worktree path explicitly]' '2:steps: '
|
|
256
|
+
;;
|
|
257
|
+
history)
|
|
258
|
+
_arguments '--json[print history as JSON]'
|
|
259
|
+
;;
|
|
260
|
+
open)
|
|
261
|
+
_arguments '--editor[editor CLI to use (code, cursor, zed, windsurf, subl, …)]:editor:' '--save[save the chosen editor to global config]' '--workspace[generate a .code-workspace file before opening (VS Code / Cursor / Windsurf)]' '2:branch:->worktrees'
|
|
262
|
+
;;
|
|
263
|
+
go|jump)
|
|
264
|
+
_arguments '--print[print the resolved worktree path explicitly]' '2:branch:->worktrees'
|
|
265
|
+
;;
|
|
266
|
+
root)
|
|
267
|
+
_arguments '--print[print the resolved repository root path explicitly]'
|
|
268
|
+
;;
|
|
269
|
+
status)
|
|
270
|
+
_arguments '--json[print repository and worktree health as JSON]'
|
|
271
|
+
;;
|
|
272
|
+
sync)
|
|
273
|
+
_arguments '--all[sync every worktree in the repository]' '--json[emit JSON on success or error instead of human-readable output]'
|
|
274
|
+
;;
|
|
275
|
+
ls)
|
|
276
|
+
_arguments '--compact[show only branch and path columns]' '--json[print active worktrees as JSON]'
|
|
277
|
+
;;
|
|
278
|
+
clean)
|
|
279
|
+
_arguments '(-f --force)'{-f,--force}'[bypass prompts, force-remove dirty worktrees, and force-delete unmerged branches]' '--stale[only target clean worktrees whose upstream is gone and branch is merged into the default branch]' '--dry-run[show what would be deleted without removing anything]' '--json[emit JSON on success or error instead of human-readable output]'
|
|
280
|
+
;;
|
|
281
|
+
remove|rm)
|
|
282
|
+
_arguments '(-f --force)'{-f,--force}'[bypass prompts, force-remove a dirty worktree, and force-delete an unmerged branch]' '--dry-run[show what would be deleted without removing anything]' '--json[emit JSON on success or error instead of human-readable output]' '2:branch:->worktrees'
|
|
283
|
+
;;
|
|
284
|
+
trigger-hook)
|
|
285
|
+
_arguments "2:hook:(${hooks})"
|
|
286
|
+
;;
|
|
287
|
+
warp)
|
|
288
|
+
_arguments '(-n --new)'{-n,--new}'[create a new worktree in a registered repo]:branch:' '--print[print the resolved worktree path without changing directory]' '--json[emit JSON on success or error instead of human-readable output]' '2:branch: '
|
|
289
|
+
;;
|
|
290
|
+
config)
|
|
291
|
+
if (( CURRENT == 3 )); then
|
|
292
|
+
_values 'config action' get set unset
|
|
293
|
+
return
|
|
294
|
+
fi
|
|
268
295
|
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
296
|
+
case "\${words[3]}" in
|
|
297
|
+
get|unset)
|
|
298
|
+
_arguments '3:key:->config_keys'
|
|
299
|
+
;;
|
|
300
|
+
set)
|
|
301
|
+
_arguments '3:key:->config_keys' '4:value: '
|
|
302
|
+
;;
|
|
303
|
+
esac
|
|
304
|
+
;;
|
|
305
|
+
esac
|
|
279
306
|
|
|
280
|
-
|
|
307
|
+
case "$state" in
|
|
308
|
+
worktrees)
|
|
309
|
+
worktree_branches=(\${(@f)$(__gji_worktree_branches)})
|
|
310
|
+
_describe 'worktree branch' worktree_branches
|
|
311
|
+
;;
|
|
312
|
+
config_keys)
|
|
313
|
+
_values 'config key' ${configKeys}
|
|
314
|
+
;;
|
|
315
|
+
esac`;
|
|
281
316
|
}
|
|
282
317
|
function escapeSingleQuotes(value) {
|
|
283
318
|
return value.replace(/'/g, `'\\''`);
|
package/man/man1/gji-back.1
CHANGED
package/man/man1/gji-clean.1
CHANGED
package/man/man1/gji-config.1
CHANGED
package/man/man1/gji-go.1
CHANGED
package/man/man1/gji-history.1
CHANGED
package/man/man1/gji-init.1
CHANGED
package/man/man1/gji-ls.1
CHANGED
package/man/man1/gji-new.1
CHANGED
package/man/man1/gji-open.1
CHANGED
package/man/man1/gji-pr.1
CHANGED
package/man/man1/gji-remove.1
CHANGED
package/man/man1/gji-root.1
CHANGED
package/man/man1/gji-status.1
CHANGED
package/man/man1/gji-sync.1
CHANGED
package/man/man1/gji-warp.1
CHANGED
package/man/man1/gji.1
CHANGED