summaryrefslogtreecommitdiff
path: root/internal/shell
AgeCommit message (Collapse)Author
2026-02-23Release v0.5.2v0.5.2Paul Buetow
2026-02-22Replace all geheim path/name defaults with foostorePaul Buetow
- Default data_dir: ~/git/geheimlager → ~/git/foostore-data - Default export_dir: ~/.geheimlagerexport → ~/.foostore-export - Default key_file: ~/.geheimlager.key → ~/.foostore.key - Rename env var GEHEIM_SHELL → FOOSTORE_SHELL - Update package-level comments across cli, shell, store, git, config - Update Magefile and CLAUDE.md docs to reflect new paths Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-22Add unit tests to reach 63.3% coverage (task 335)Paul Buetow
- internal/shell/shell_internal_test.go (new): tests prefixCompleter.Do with table-driven cases covering empty prefix, partial match, no match, and multi-word line (prefix after space) - internal/cli/cli_test.go (new): tests pure helpers (logMsg, warn, printHelp, shredFile), dispatch paths with real store (ls, search, cat, rm, shred, get, paste, export, pathexport, open, edit, unknown command, empty argv), error paths for cmdAdd/cmdImport/cmdImportR, readPIN env-var path, completionFn commands-only path, makeActionFn nil cases - internal/store/store_test.go: added TestSearchActionPathExport, TestSearchActionWithCallback, TestSearchActionNilCallback, TestFzfEmpty, TestRemoveInteractiveInvalidThenDecline, TestImportForceOverwrite Total coverage: 44.8% → 63.3% Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-22Rename binary from geheim to foostorePaul Buetow
- go.mod: module path codeberg.org/snonux/geheim → codeberg.org/snonux/foostore - cmd/geheim/ → cmd/foostore/ - Magefile.go: binary/binaryName/mainPkg constants updated - internal/config: config file path ~/.config/geheim.json → ~/.config/foostore.json - All import paths and comments updated throughout - Delete geheim.rb (the original Ruby implementation, superseded by this Go rewrite) - CLAUDE.md rewritten to reflect the Go implementation, new binary name, build system (mage), and current package architecture Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-22Fix PIN prompt and Ctrl+C behaviour in shellPaul Buetow
PIN prompt: replace readline.ReadPassword (which silently failed to display the prompt before the process was fully interactive) with golang.org/x/term.ReadPassword, which reliably disables echo and prints the prompt via a plain fmt.Print before reading. This fixes the root cause of the decryption failures — the user was never prompted for their PIN, so an empty/default PIN was used, producing a wrong IV. Ctrl+C: return io.EOF from Shell.ReadLine on readline.ErrInterrupt so that pressing Ctrl+C exits the shell loop, matching the Ruby behaviour where SIGINT terminates the process. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-22Implement shell package with readline vi mode and tab completion (task 358)Paul Buetow
Replaces the stub in internal/shell/shell.go with a full implementation backed by github.com/ergochat/readline. The Shell struct wraps a readline instance configured with vi mode, a 500-entry in-memory history limit, and a custom prefixCompleter that delegates tab expansion to a caller-supplied function — mirroring the Ruby CLI#setup_readline / Readline.completion_proc pattern. History deduplication (skip empty lines and consecutive duplicate entries) matches the Ruby shell_loop behaviour by disabling auto-save and calling SaveToHistory only for non-empty, non-duplicate lines. A package- level ReadPassword helper handles PIN entry before the Shell is created. Tests skip gracefully when stdin is not a TTY. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-22Add Go project scaffold (task 352)Paul Buetow
- go.mod with module codeberg.org/snonux/geheim (go 1.22, mage dep) - Magefile.go with Build, Test, Install, Uninstall targets - cmd/geheim/main.go delegating to internal/cli - Stub packages: cli, version, config, crypto, git, store, clipboard, shell - go.sum generated; binary confirmed to build via mage build Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>