Skip to main content

Custom Commands

This setup ships a collection of small, purpose-built CLI commands into ~/bin.

Where They Live

Anything named executable_,something becomes a command called ,something.

If you are an IDE-first user: you can run these from VSCode/JetBrains terminal without switching editors.

How To Discover Commands

List the installed commands:

ls -1 "$HOME/bin" | rg '^,'

See where a command comes from:

command -v ,w

Show usage for a command:

,w --help

Useful Aliases

This setup also defines a few cross-shell aliases (Fish + Bash/Zsh).

  • dash: shorthand for gh dash

High-Leverage Workflows

System health check: ,doctor

  • Source: home/exact_bin/executable_,doctor
  • Checks: chezmoi state, Homebrew, shell, tmux+TPM, git+signing, SSH agent, pass/GPG, editors, AI tools, key CLIs, ~/bin wrapper integrity (sem/parallel) + cursor-cli bundled rg, worktrees.

Examples:

,doctor # full check
,doctor --quiet # only warnings/failures
,doctor --verbose # extra detail (e.g. outdated Homebrew count)

PR readiness audit: ,kbn-pr-audit

  • Source: home/exact_bin/executable_,kbn-pr-audit
  • Read-only audit of an elastic/kibana PR before a reply/resolve/push cycle. It never mutates GitHub (it reports; you act — see the Human-Visible Publication Gate in the AI assistants topic).
  • Checks: local HEAD vs published PR head alignment, unresolved review threads split human vs bot, deletions disclosed in the body, expected body sections, label consistency (single release_note:*, backport target, body↔label agreement), and validation commands recorded in the Test Plan.
,kbn-pr-audit # audit the current branch's PR
,kbn-pr-audit 271562 # audit a specific PR number / URL / branch

Run telegramtui with optional pass-backed API config: ,tg

  • Source: home/exact_bin/executable_,tg
  • Fork-first runtime:
    • prefers locally built jar from ~/code/telegramtui/main/target/telegramtui-*.jar
    • falls back to telegramtui on PATH if no local jar exists
  • Setup/install source:
    • chezmoi custom-packages installer clones kapral18/telegramtui to ~/code/telegramtui/main
    • tracks origin/main, builds with Maven, and installs ~/.local/bin/telegramtui launcher
    • this install path is personal-profile only (isWork != true)
  • Optionally reads credentials from:
    • telegram/apps/tuilegram/app_id
    • telegram/apps/tuilegram/api_hash
  • When both pass entries exist, writes ~/.telegramtui/config.properties (api.id/api.hash) before launching.
  • Runs telegramtui by default (or any command passed after ,tg --).
  • Supports repo lifecycle:
    • ,tg --sync fetch/switch/pull origin/main, build, then launch
    • ,tg --build build only
  • Optional overrides:
    • TELEGRAMTUI_REPO_DIR (default ~/code/telegramtui/main)
    • TELEGRAMTUI_REPO_BRANCH (default main)

Examples:

,tg # runs telegramtui
,tg --sync # pull fork main, build jar, run
,tg --build # build local fork jar only
,tg --help # passes --help to telegramtui

Worktree workflow: ,w

Examples:

,w add feat/my-change main
,w prs 12345
,w issue 12345
,w switch
,w doctor

Transfer patches or files/dirs: ,wh

  • Source: home/exact_bin/executable_,wh
  • Behavior:
    • ,wh post (no path): writes the current staged diff to /tmp/staged.patch and sends it with a one-word Magic Wormhole code.
    • ,wh post <path>: sends that single file or directory raw (Magic Wormhole bundles directories natively, preserving structure).
    • ,wh get: receives the transfer (prompts for the code when omitted) and auto-detects what arrived — a received *.patch is applied with git apply; any other file or directory is saved into the destination instead.
  • Receive destination (get -o, --output PATH): for raw files/dirs it is the target directory (default: current dir); for patches it overrides the patch path (default: WH_PATCH_FILE).
  • Completions: Fish and Zsh complete post / get, a path for post, and -o/--output for get.
  • Optional override: WH_PATCH_FILE=/path/to/file.patch

Examples:

,wh post # send staged diff
,wh post ./src # send a directory
,wh post notes.md # send a single file
,wh get # receive: apply patch, or save file/dir to cwd
,wh get -o ~/inbox # save received file/dir into ~/inbox

PR lookup/open: ,gh-prw

Examples:

,gh-prw
,gh-prw --number
,gh-prw --url

Issue lookup/open: ,gh-issuew

Examples:

,gh-issuew
,gh-issuew --number
,gh-issuew --url

Apply one patch across multiple PRs: ,add-patch-to-prs

Examples:

,add-patch-to-prs ./fix.patch 12345 12346
,add-patch-to-prs ./fix.patch --search "is:open author:@me"
,add-patch-to-prs ./fix.patch --message "Apply follow-up fix"

Fork + clone + tmux: ,gh-tfork

  • Source: home/exact_bin/executable_,gh-tfork
  • Clone target:
    • ~/work/<repo>/<default-branch> when owner is elastic
    • ~/code/<repo>/<default-branch> otherwise
  • For elastic/kibana: date-anchored shallow history (--shallow-since=2022-01-01 --no-tags)
  • tmux session: <wrapper/repo>|<default-branch> (2 windows, 2 panes each)

Examples:

,gh-tfork elastic/integrations

Sync branch with upstream: ,pull-rebase

Re-converge yarn globals: ,install-yarn-pkgs

Apply icon mapping: ,apply-app-icons

Run one command across tmux sessions: ,tmux-run-all

Examples:

,tmux-run-all "work-*" "git status"
,tmux-run-all --all "work-*" "yarn run test -- --watch=false"

Start/control lowfi in tmux: ,tmux-lowfi

Examples:

,tmux-lowfi p
,tmux-lowfi nt
,tmux-lowfi q

Additional Commands

GitHub / PR helpers

CommandDescription
,view-my-issuesBrowse your GitHub issues with fzf preview
,remove-commentDelete a comment from the current PR via fzf picker
,gh-subissues-createDraft multiple sub-issues in your editor, create them, and attach to a parent issue via GitHub's sub-issue GraphQL API
,check-backport-progressFind PRs missing backports or required labels across target branches
,disable-auto-mergeDisable auto-merge for all open PRs targeting a base branch
,enable-auto-mergeEnable auto-merge for all open PRs targeting a base branch
,trace-string-prLocate the PR that introduced a matching string and open it in the browser
,hey-branchQuick "am I in sync with upstream?" status (ahead/behind + missing remote)

Search / discovery helpers

CommandDescription
,grepoGrep for a pattern across files and open the selected match in $EDITOR at the right line
,search-brew-descSearch installed Homebrew formula descriptions (JSON output)
,fuzzy-brew-searchFuzzy search Homebrew descriptions with preview, then drive an "add this to Brewfile" workflow
,search-gh-topicSearch GitHub repos by topic with preview, then open the selected repo

Testing / analysis helpers

CommandDescription
,jest-test-title-reportCompare Jest test titles between two worktrees and emit a CSV report
,get-risky-testsRun Jest and report tests whose runtime exceeds a threshold
,get-age-bucketsCompute file "age buckets" from git history to spot stale areas
,generate-git-sandboxCreate a throwaway git repo with branches/commits for testing rebases/merges/scripts

Kibana development helpers

CommandDescription
,start-feat-kbnBoot ES (snapshot) and start Kibana in a tmux pane when bootstrap completes (feature cluster)
,start-main-kbnSame as above for the "main" cluster defaults/ports

AI / Agent helpers

CommandDescription
,agent-memoryInspect or wipe the selected /tmp/specs hook memory topic for the current workspace

Utility helpers

CommandDescription
,cp-files-for-llmCopy a directory tree's text contents to the clipboard with file headers, ready to paste into an assistant
,appidPrint the macOS bundle identifier for an app name/path
,dumputiDump the system's registered Uniform Type Identifiers
,to-gifConvert a video to an optimized GIF
,vid-ipadRe-encode a video for iPad playback
,pdf-diffVisual diff two PDFs by compositing pages
,nano-bananaGenerate a Nano Banana (Gemini) image from a text prompt via the Generative Language API
,history-syncMerge local Fish history with a 1Password document and push the merged result back (see below)

,history-sync details

  • Source: home/exact_bin/executable_,history-sync
  • Merge logic: home/exact_bin/utils/exact_history/executable_fish-history-merge.py
  • Stores the synced history in the 1Password document fish-history-sync; that document doubles as an off-machine backup of your fish history.
  • The merge is a union keyed by command text, keeping the most recent timestamp per command, and writes entries in chronological order.
  • Data-safety behavior:
    • Before replacing local history it writes a snapshot to ~/.local/share/fish/fish_history.bak.
    • It refuses to install/push a merged result that has fewer entries than the remote copy (guards against parse/merge corruption shrinking the backup).
    • If the remote pull fails but the fish-history-sync item exists (transient/auth/network error), it aborts instead of overwriting the good remote with local-only history.
  • Caveat: a running fish session keeps its own in-memory history and may rewrite fish_history on save. If you restore the file out-of-band, run history merge in active fish shells (or restart them) so they adopt it.

Internal / plumbing helpers

These are used by other scripts, fzf integrations, and Neovim — you rarely invoke them directly:

CommandDescription
,bat-previewSmart preview for fzf (images via chafa, binaries via hexyl, directories via ls, text via bat)
,fzf-git-changed-linesEmit changed lines as grep-like entries for fzf
,fzf-preview-followCenter fzf preview around a match line
,fzf-rg-multilineConvert ripgrep output into NUL-delimited multi-line fzf entries

Verification And Troubleshooting

Quick checks:

command -v ,w
command -v ,gh-prw
command -v ,tmux-run-all

If commands are missing after apply, verify:

  • home/exact_bin/ contains the source script.
  • The script has the executable_ prefix.
  • chezmoi apply completed successfully.
  • ~/bin is on PATH (echo "$PATH").