Skip to content

Add useful bash helper functions leveraging existing devcontainer tools#56

Draft
Copilot wants to merge 3 commits into
mainfrom
copilot/suggest-useful-helper-functions
Draft

Add useful bash helper functions leveraging existing devcontainer tools#56
Copilot wants to merge 3 commits into
mainfrom
copilot/suggest-useful-helper-functions

Conversation

Copilot AI commented Mar 16, 2026

Copy link
Copy Markdown

Extends bash/.config/bash/functions with nine new helpers, each following the established patterns (fzf interactive selection, batcat previews, local scoping, usage comments). All dependencies are already installed in the devcontainer.

New functions

  • extract() — multi-format archive extraction; complements existing compress() and decompress alias. Handles .tar.gz, .tar.bz2, .tar.xz, .tar, .zip, .gz, .bz2, .xz.

  • rgf <pattern> — ripgrep × fzf with batcat line-highlighted preview; natural counterpart to the ff alias (which finds files — this finds content).

    rgf TODO          # browse all TODO matches across files
    rgf -t py import  # restrict to Python files
  • mkd path/to/dirmkdir -p + cd in one step; uses ${!#} for reliable last-argument expansion.

  • ps-fzf — fuzzy-pick a running process and send SIGTERM; includes a [y/N] confirmation prompt before killing.

  • tldrf — browse all tealdeer pages via fzf with live preview; gracefully errors if tldr is not installed.

  • glf [git-log opts] — interactive git log browser; fzf over git log --oneline with a git show diff preview pane. Accepts any git log flags (e.g. glf -n 50 --author=me).

  • jqf [file.json] — fuzzy-pick a JSON file (or pass one directly) and pretty-print it with jq colour output piped through batcat.

  • envf — fuzzy-search all current environment variables; echoes the selected VAR=value line.

  • ghpr — fuzzy-pick an open pull request (shows number, title, author) with a gh pr view preview pane, then checks it out locally. Natural companion to gclone.

Original prompt

This section details on the original issue you should resolve

<issue_title>Suggest useful helper functions</issue_title>
<issue_description>See existing ones in bash functions. By using our existing tools, see if you can define some useful helpers such as the existing ones.</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: tin900 <113692500+tin900@users.noreply.github.com>
@tin900

tin900 commented Mar 16, 2026

Copy link
Copy Markdown
Collaborator

Got some more suggestions @copilot ?

Copilot AI changed the title [WIP] Add useful helper functions based on existing tools Add useful bash helper functions leveraging existing devcontainer tools Mar 16, 2026
Copilot AI requested a review from tin900 March 16, 2026 16:13
Co-authored-by: tin900 <113692500+tin900@users.noreply.github.com>

Copilot AI commented Mar 16, 2026

Copy link
Copy Markdown
Author

Got some more suggestions @copilot ?

Added four more in commit b34a933, all using tools already in the devcontainer:

  • glf – interactive git log browser: fzf over git log --oneline with git show diff in the preview pane; accepts any git log flags (e.g. glf -n 50 --author=me)
  • jqf [file.json] – fuzzy-pick a JSON file (or pass one directly) and pretty-print it with jq colour output piped through batcat
  • envf – fuzzy-search all current environment variables; echoes the selected VAR=value line
  • ghpr – fuzzy-pick an open pull request (shows number, title, author) with gh pr view preview, then checks it out; natural companion to gclone

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Suggest useful helper functions

2 participants