How gateway-of-last-resort/keyward works
Keyward is a terminal SSH-setup manager with both an interactive Bubble Tea UI and headless CLI. The main workflow loads SSH keys and config, then lets users inspect and manage keys, edit hosts, audit security, browse known hosts, and create or restore encrypted backups. The graph emphasizes documented capabilities and sampled call paths; unsampled screens and integrations are included only where their paths are explicit, and links without visible evidence are omitted.
Main entry points: model.go Interactive shell · cli.go CLI router · main.go Application entry · checks.go Security audit
Components 22
Entry points
- Application entry
cmd/keyward/main.go - CLI router
internal/cli/cli.go - SSH environment
internal/cli/cli.go
User experience
- Interactive shell
internal/ui/model.go - Key inventory
internal/ui/keys.go - Key details
internal/ui/detail.go - Config editor
internal/ui/config.go - Audit screen
internal/ui/audit.go - Known-hosts screen
internal/ui/knownhosts.go - Backup screen
internal/ui/backup.go - Vault setup
internal/ui/setup.go - Settings
internal/ui/settings.go
SSH management
- Key operations
internal/keys/generate.go - SSH config
internal/config/parser.go - Known hosts
internal/knownhosts/knownhosts.go - SSH agent
internal/agent/agent.go
Security and vault
- Security audit
internal/audit/checks.go - Encrypted metadata
internal/storage/storage.go - Encrypted backups
internal/storage/backup.go - Cryptography
pkg/crypto/crypto.go - Master key
pkg/crypto/masterkey.go
Other components
- Operator
Connections 34
- Operator → Application entry: launches
README.md - Application entry → CLI router: routes arguments
cmd/keyward/main.go - Application entry → SSH environment: loads environment
cmd/keyward/main.go - Application entry → Security audit: runs audit
cmd/keyward/main.go - Application entry → Interactive shell: starts interface
cmd/keyward/main.go - CLI router → SSH environment: loads shared state
internal/cli/cli.go - SSH environment → Key operations: parses keys
internal/cli/cli.go - SSH environment → SSH config: parses config
internal/cli/cli.go - Interactive shell → Key inventory: shows inventory
- Interactive shell → Config editor: routes screen
- Interactive shell → Audit screen: routes screen
- Interactive shell → Known-hosts screen: routes screen
- Interactive shell → Backup screen: routes screen
- Interactive shell → Vault setup: initializes vault
internal/ui/model.go - Interactive shell → Settings: routes screen
- Key inventory → Key details: opens details
- Key details → Key operations: rotates keys
- Key details → SSH agent: adds key
- Key details → Encrypted metadata: reads metadata
internal/ui/detail.go - Config editor → SSH config: edits config
- Audit screen → Security audit: presents findings
- Known-hosts screen → Known hosts: manages entries
- Backup screen → Encrypted backups: creates or restores
internal/ui/backup.go - Encrypted backups → Cryptography: encrypts archive
internal/storage/backup.go - Encrypted metadata → Cryptography: encrypts metadata
internal/storage/storage.go - Vault setup → Master key: sets password
- Settings → Master key: changes password
- Security audit → SSH config: checks directives
internal/audit/checks.go - Security audit → Key operations: checks keys
- CLI router → Security audit: audit command
- CLI router → Encrypted backups: backup command
- CLI router → SSH agent: agent commands
- CLI router → Key operations: imports keys
- Interactive shell → Encrypted metadata: updates metadata
internal/ui/model.go