feat: initial implementation of jjf
A TUI revision picker for jujutsu (jj). Wraps any jj subcommand with an inline fuzzy-finder over jj log, then forwards the picked revision(s) as -r '<id>' to the underlying jj invocation. Features: - Inline viewport (no full-screen alt-screen takeover) - Smart prefix matching: typing the bold portion of a change ID jumps to that revision instantly - Multi-select via Tab; emitted as -r 'A|B|C' revset union - Preflight detection of subcommands that don't accept -r - Optional shell integration (jjf init <bash|zsh|fish|nu>) that rewrites shell history so up-arrow recalls the resolved jj command Hand-rolled ANSI rendering to /dev/tty; only crossterm, nucleo-matcher, anyhow, and libc as runtime dependencies.
This commit is contained in:
11 files changed
+1325
No files matched your search
@@ -0,0 +1,18 @@
|
||||
def --env jjf [...args] {
|
||||
# Meta-commands and bare flags bypass the picker and run the binary directly.
|
||||
if ($args | is-empty) {
|
||||
^jjf
|
||||
return
|
||||
}
|
||||
let first = $args.0
|
||||
if $first == "init" or ($first | str starts-with "-") {
|
||||
^jjf ...$args
|
||||
return
|
||||
}
|
||||
let result = (^jjf --emit ...$args | complete)
|
||||
if $result.exit_code != 0 { exit $result.exit_code }
|
||||
let cmd = ($result.stdout | str trim)
|
||||
if ($cmd | is-empty) { exit 130 }
|
||||
[{command: $cmd, start_timestamp: (date now | format date "%+")}] | history import
|
||||
^sh -c $cmd
|
||||
}
|
||||
Reference in new issue
Block a user