diff options
| author | Paul Buetow <paul@buetow.org> | 2026-02-22 20:50:32 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-02-22 20:50:32 +0200 |
| commit | 7de95e396d729895a7e1e27c1155c9d365fab41c (patch) | |
| tree | 67e0212e4aa6e641b84185b7f4ddb57d602e0864 | |
| parent | 3373b7e90c4e1ff1abcebe0594316131f546dfa8 (diff) | |
Fix fish shell integration after binary rename to foostore (v0.4.0)v0.4.0
- Rename completions/geheim.fish → completions/foostore.fish
- Update all geheim references to foostore in ge.fish, install-fish.sh, FISH_INTEGRATION.md
- Add fish shell integration section to README
- Fix stale comment in internal/version/version.go
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
| -rw-r--r-- | FISH_INTEGRATION.md | 20 | ||||
| -rw-r--r-- | IDEAS.md | 7 | ||||
| -rw-r--r-- | README.md | 42 | ||||
| -rw-r--r-- | completions/foostore.fish | 33 | ||||
| -rw-r--r-- | completions/ge.fish | 22 | ||||
| -rw-r--r-- | completions/geheim.fish | 33 | ||||
| -rwxr-xr-x | install-fish.sh | 6 | ||||
| -rw-r--r-- | internal/version/version.go | 2 |
8 files changed, 99 insertions, 66 deletions
diff --git a/FISH_INTEGRATION.md b/FISH_INTEGRATION.md index 6c9b964..0a0ced2 100644 --- a/FISH_INTEGRATION.md +++ b/FISH_INTEGRATION.md @@ -1,19 +1,19 @@ -# Fish Shell Integration for Geheim +# Fish Shell Integration for foostore ## Installation ### Automatic Installation ```bash -cd /home/paul/git/geheim +cd /home/paul/git/foostore ./install-fish.sh ``` ### Manual Installation -1. Copy the completion file for `geheim`: +1. Copy the completion file for `foostore`: ```bash -cp completions/geheim.fish ~/.config/fish/completions/ +cp completions/foostore.fish ~/.config/fish/completions/ ``` 2. Copy the wrapper function for `ge`: @@ -28,9 +28,9 @@ exec fish ## Usage -### `geheim` command +### `foostore` command -The `geheim` command now has full tab completion: +The `foostore` command now has full tab completion: - Tab complete all subcommands (ls, search, cat, paste, etc.) - Tab complete file paths for `import` - Tab complete the `force` flag for import @@ -45,7 +45,7 @@ ge # Search shortcut (if not a known command, treats as search) ge mypassword -# Same as: geheim search mypassword +# Same as: foostore search mypassword # Explicit commands still work ge cat mypassword @@ -61,7 +61,7 @@ For better security, entry completion only works when the `PIN` environment vari # Set PIN for session (entries will autocomplete) set -x PIN yourpin -# Use geheim with autocomplete +# Use foostore with autocomplete ge <TAB> # Unset PIN when done @@ -72,9 +72,9 @@ Without `PIN` set, commands will still autocomplete, but entry names won't (to a ## Features -- ✓ Dynamic command completion (fetched from `geheim commands`) +- ✓ Dynamic command completion (fetched from `foostore commands`) - ✓ Smart search fallback in `ge` wrapper - ✓ Entry name completion (when PIN is set) - ✓ File path completion for import/export - ✓ Force flag completion -- ✓ No hardcoded command lists (stays in sync with geheim updates) +- ✓ No hardcoded command lists (stays in sync with foostore updates) diff --git a/IDEAS.md b/IDEAS.md deleted file mode 100644 index d4cb717..0000000 --- a/IDEAS.md +++ /dev/null @@ -1,7 +0,0 @@ -# Ideas - -* Better prompt with Vi or Helix input mode -* Refactor code maybe? -* Revamp compy and paste pw to clipboard -* Comprehensive documentation -* Maybe a release and blog post @@ -14,6 +14,46 @@ This is for my own use. So the documentation here may be lacking. But feel free * The Git repository can be synchronized with N remote Git repositories (e.g. to two separate VMs for geo-redundancy). * Text entries are edited using Helix (or any other `$EDITOR`) * Clipboard support for MacOS and GNOME (Linux). -* Interactive `geheim` shell support. +* Interactive `foostore` shell support. * Can import and export documuments in batches. * Can shred exported data again. + +## Fish Shell Integration + +Tab completion and a `ge` shortcut wrapper are provided for the [fish shell](https://fishshell.com/). + +### Install + +```bash +./install-fish.sh +exec fish +``` + +This copies `completions/foostore.fish` to `~/.config/fish/completions/` and `completions/ge.fish` to `~/.config/fish/functions/`. + +### Usage + +```bash +# Tab-complete foostore subcommands +foostore <TAB> + +# ge wrapper: no arguments → interactive shell +ge + +# ge wrapper: bare term → treated as search +ge mypassword # same as: foostore search mypassword + +# ge wrapper: explicit commands pass through +ge cat mypassword +ge import file.txt backup/ +``` + +Entry-name completion is gated on the `PIN` environment variable to avoid interactive PIN prompts during tab completion: + +```fish +set -x PIN yourpin # enable entry completion for this session +ge <TAB> +set -e PIN # clear when done +``` + +See `FISH_INTEGRATION.md` for more details. diff --git a/completions/foostore.fish b/completions/foostore.fish new file mode 100644 index 0000000..88056f1 --- /dev/null +++ b/completions/foostore.fish @@ -0,0 +1,33 @@ +# Fish completion for foostore +# Install to ~/.config/fish/completions/foostore.fish + +# Dynamically load commands from foostore +function __fish_foostore_commands + foostore commands 2>/dev/null +end + +# Get list of entries for completion +function __fish_foostore_entries + # Only run if PIN is set to avoid interactive prompt + if set -q PIN + foostore ls 2>/dev/null | string replace -r ';.*$' '' | string trim + end +end + +# Complete subcommands +complete -c foostore -f -n "__fish_use_subcommand" -a "(__fish_foostore_commands)" + +# Complete search terms for commands that need them +complete -c foostore -f -n "__fish_seen_subcommand_from search cat paste export pathexport open edit rm" -a "(__fish_foostore_entries)" + +# Complete file paths for import +complete -c foostore -n "__fish_seen_subcommand_from import" -F + +# Complete directory paths for import destination +complete -c foostore -n "__fish_seen_subcommand_from import; and __fish_is_nth_token 3" -F -a "(__fish_complete_directories)" + +# Force flag for import +complete -c foostore -n "__fish_seen_subcommand_from import; and __fish_is_nth_token 4" -f -a "force" + +# Complete directory paths for import_r +complete -c foostore -n "__fish_seen_subcommand_from import_r" -F -a "(__fish_complete_directories)" diff --git a/completions/ge.fish b/completions/ge.fish index 8a1206a..ae723b1 100644 --- a/completions/ge.fish +++ b/completions/ge.fish @@ -1,35 +1,35 @@ -# Fish wrapper and completion for ge (geheim shortcut) +# Fish wrapper and completion for ge (foostore shortcut) # Install to ~/.config/fish/functions/ge.fish -function ge --description 'Geheim wrapper with shortcuts' +function ge --description 'foostore wrapper with shortcuts' # If no arguments, run interactive mode if test (count $argv) -eq 0 - geheim shell + foostore shell return $status end set -l cmd $argv[1] - + # Check if first argument is a known command - if contains $cmd (geheim commands 2>/dev/null) - # It's a command, pass through to geheim - geheim $argv + if contains $cmd (foostore commands 2>/dev/null) + # It's a command, pass through to foostore + foostore $argv else # Not a command, treat as search term - geheim search $argv + foostore search $argv end end -# Dynamically load commands from geheim +# Dynamically load commands from foostore function __fish_ge_commands - geheim commands 2>/dev/null + foostore commands 2>/dev/null end # Get list of entries for completion function __fish_ge_entries # Only run if PIN is set to avoid interactive prompt if set -q PIN - geheim ls 2>/dev/null | string replace -r ';.*$' '' | string trim + foostore ls 2>/dev/null | string replace -r ';.*$' '' | string trim end end diff --git a/completions/geheim.fish b/completions/geheim.fish deleted file mode 100644 index c36ad03..0000000 --- a/completions/geheim.fish +++ /dev/null @@ -1,33 +0,0 @@ -# Fish completion for geheim -# Install to ~/.config/fish/completions/geheim.fish - -# Dynamically load commands from geheim -function __fish_geheim_commands - geheim commands 2>/dev/null -end - -# Get list of entries for completion -function __fish_geheim_entries - # Only run if PIN is set to avoid interactive prompt - if set -q PIN - geheim ls 2>/dev/null | string replace -r ';.*$' '' | string trim - end -end - -# Complete subcommands -complete -c geheim -f -n "__fish_use_subcommand" -a "(__fish_geheim_commands)" - -# Complete search terms for commands that need them -complete -c geheim -f -n "__fish_seen_subcommand_from search cat paste export pathexport open edit rm" -a "(__fish_geheim_entries)" - -# Complete file paths for import -complete -c geheim -n "__fish_seen_subcommand_from import" -F - -# Complete directory paths for import destination -complete -c geheim -n "__fish_seen_subcommand_from import; and __fish_is_nth_token 3" -F -a "(__fish_complete_directories)" - -# Force flag for import -complete -c geheim -n "__fish_seen_subcommand_from import; and __fish_is_nth_token 4" -f -a "force" - -# Complete directory paths for import_r -complete -c geheim -n "__fish_seen_subcommand_from import_r" -F -a "(__fish_complete_directories)" diff --git a/install-fish.sh b/install-fish.sh index 73d4d3e..5ca8901 100755 --- a/install-fish.sh +++ b/install-fish.sh @@ -2,15 +2,15 @@ set -e -echo "Installing geheim fish shell integration..." +echo "Installing foostore fish shell integration..." # Create directories if they don't exist mkdir -p ~/.config/fish/completions mkdir -p ~/.config/fish/functions # Copy completion files -echo "Installing geheim completion..." -cp completions/geheim.fish ~/.config/fish/completions/ +echo "Installing foostore completion..." +cp completions/foostore.fish ~/.config/fish/completions/ echo "Installing ge wrapper function..." cp completions/ge.fish ~/.config/fish/functions/ diff --git a/internal/version/version.go b/internal/version/version.go index 9297d1b..2291e47 100644 --- a/internal/version/version.go +++ b/internal/version/version.go @@ -1,5 +1,5 @@ // Package version holds the application version string. package version -// Version is the current release version of geheim. +// Version is the current release version of foostore. const Version = "v0.4.0" |
