summaryrefslogtreecommitdiff
path: root/internal/cli
AgeCommit message (Collapse)Author
2026-02-22Update main.go and cli API for signal-cancellable context (task 352/main)Paul Buetow
main.go: set up signal.NotifyContext(SIGINT, SIGTERM) so long-running operations (fzf, external editors) terminate gracefully on interrupts. Call cli.New(ctx) explicitly and pass the context to c.Run(ctx, argv), matching the task spec and allowing the context to flow through all store/git/crypto operations. cli: expose New(ctx) and Run(ctx, argv) as the public API; remove the package-level Run() helper that created its own context.Background(). Verified: mage build produces ./bin/geheim; PIN=test ./bin/geheim version prints "> geheim v0.4.0". Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-22Implement internal/cli package (task 352/cli)Paul Buetow
Full command dispatch, interactive shell loop, and all geheim commands mirroring the Ruby CLI class (geheim.rb lines 551-713). Key design points: - CLI struct holds all runtime deps; lastResult field enables Ruby-style fallback search term when a search command is given without an argument - dispatch → dispatchSimple (no-term commands) + dispatchSearch (term-based) kept under ~50 lines each per style guidelines - ActionOpen shreds the exported file immediately after opening, matching Ruby's shred_file(delay: 0) call - import implements Ruby's three-way dest_dir logic: nil→full src_path, contains-dot→literal dest, plain-dir→dir/basename(src) - completionFn notes $PIN limitation for description completion - openExported extends Ruby's OS detection with xdg-open, iTerm, Termux heuristics; comment documents the divergence from Ruby's evince default 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>