Emulates DBUS with a Secret Service to manage secrets for apps that need it on Linux platforms without full-blown DBUS (Like Termux on Android)
- Go 100%
| auth.go | ||
| go.mod | ||
| keychain-emulator | ||
| main.go | ||
| marshal.go | ||
| README.md | ||
| server.go | ||
| service.go | ||
| store.go | ||
keychain-emulator
A D-Bus Secret Service emulator for Linux systems without D-Bus. Secrets are stored in a JSON file instead of a real keychain.
Build
go build -o keychain-emulator .
Usage
Wrapper mode
Runs a command with the emulator active for its lifetime:
keychain-emulator my-cli-tool --args
Daemon mode
Starts a background daemon and prints the environment variables to set:
eval $(keychain-emulator)
my-cli-tool --args
Stop it when done:
keychain-emulator stop
Running eval $(keychain-emulator) multiple times is safe — it returns the existing daemon's address if one is already running.
Storage
Secrets are persisted to ~/.local/share/keychain-emulator/secrets.json (mode 0600).