| Age | Commit message (Collapse) | Author |
|
The fish subcommand prints a purely static shell-integration script and
needs no backend, cipher, store, git, or shell. Previously cli.New ran
in main() before dispatch, triggering the KeePass Argon2 KDF and adding
~1.8s to every interactive fish shell startup that sources the script.
Export FishIntegrationScript and dispatch `fish` directly from main()
before constructing the CLI. Local timing: `foostore fish` drops from
~1.834s to ~0.003s.
Bump version to v0.8.1.
Amp-Thread-ID: https://ampcode.com/threads/T-019dd950-11ef-77aa-bb92-810f22601023
Co-authored-by: Amp <amp@ampcode.com>
|
|
Add `foostore fish` subcommand that prints the complete fish shell integration
script (tab completions for foostore + the ge wrapper function) to stdout so
users can source it with `foostore fish | source`. Remove install-fish.sh,
FISH_INTEGRATION.md, and completions/ directory. Update CLAUDE.md and README.md
to document the new workflow.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
Move all geheim→KeePass migration business logic from internal/cli/migrate_kdbx.go
into a new internal/migrate package (migrator.go, kdbx_store.go). The CLI layer
is now a thin orchestrator: parse flags, open KDBX, call migrate.Run, save, report.
Key design decisions:
- migrate.Run accepts separate logFn (stdout info) and warnFn (stderr errors)
so per-entry errors correctly route to stderr via warn(), not stdout via logMsg()
- migrate.Options contains only DryRun; DBPath/BinaryOutDir removed (CLI-only concerns)
- StoreWalker interface is narrow, avoiding a direct dependency on backend.Backend
- cli_paths.go extracts readPasswordFile/resolveHomeDir/expandHome shared within cli
- kdbx_store.go deleted from cli (moved to internal/migrate)
- Duplicate TestExtractPasswordFromContent removed from kdbx_store_test.go
- Custom contains/containsStr helpers replaced with strings.Contains in tests
- Dry-run test now asserts logged message content
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
Per Go best practice (100 Go Mistakes #6): interfaces belong where they are
used, not where they are implemented. Move Gitter from internal/git to
internal/cli/git.go. Compile-time assertions (var _ Gitter = ...) kept in
the new location. internal/git retains concrete *Git and *NoOp types.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
Extract cli.go into four dedicated files to improve separation of concerns
and readability: cli_flags.go (flag parsing), cli_backend.go (backend init),
cli_commands.go (command handlers), cli_dispatch.go (command routing).
Fix inaccurate comments on logMsg/warn that claimed declaration order matters
in Go; package-level functions are resolved across the whole file.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
Change default backend from "geheim" to "keepass" and default KDBXPath
from ~/Documents/Keepass/master to ~/Documents/Keepass/master.kdbx.
Existing geheim users must set backend="geheim" in ~/.config/foostore.json.
Update resolveBackend fallback, struct comments, and test assertions to match.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
Allows specifying the .kdbx file path without editing the config file:
foostore --backend keepass --kdbx-path /path/to/db.kdbx ls
The flag overrides cfg.KDBXPath for the process lifetime. Implemented by
extracting a shared parseFlagValue helper used by both parseBackendFlag and
the new parseKDBXPathFlag. Help text updated to document both global flags.
Table-driven tests added for parseKDBXPathFlag (mirrors TestParseBackendFlag).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
lines
Extracts a 3-line buildGeheimGit(cfg) helper from buildGeheimBackend,
mirroring the existing buildKeepassGit pattern and satisfying the project
guideline of keeping functions under 30 lines. Also includes the full
o4 backend-abstraction changeset: Gitter interface, git.NoOp, --backend
flag parsing, keepass backend wiring, and effectiveBackend guard for
migrate-kdbx.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
(tasks k4+l4)
Remove ~90 lines of duplicated code from kdbx_store.go by delegating
to EnsureGroup, UpsertEntryByTitle, SetEntryField, SplitDescriptionPath,
SanitizeRelativePath exported from internal/keepass. kdbxStore.Save()
now delegates to keepass.AtomicSave, eliminating the double-close risk.
migrate_kdbx.go updated to use the exported helpers.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
Add internal/backend/backend.go with a Backend interface covering all
10 CLI-facing methods. Change CLI.st field type to backend.Backend.
Compile-time guard var _ Backend = (*store.Store)(nil) prevents drift.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- 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>
|
|
- 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>
|
|
- 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>
|
|
- Magefile.go: add Default() target so bare `mage` builds the binary;
fix Install()/Uninstall() to use $GOPATH/bin (default ~/go/bin) instead
of the previous hardcoded ~/.local/bin path; use cp -v for visibility;
fix 0755 -> 0o755 octal literal in createBinDir; extract binaryName const
- cmd/geheim/main.go: add -version flag (prints version.Version and exits);
pass flag.Args() instead of os.Args[1:] so flags are parsed cleanly
- internal/cli/cli.go: remove dead fatal() and prompt() helpers that were
never called anywhere in the codebase
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
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>
|
|
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>
|
|
- 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>
|