You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add env command for shell-consumable vault export (#158)
* feat: add env command for shell-consumable vault export
Outputs vault field values as shell-safe KEY='value' lines, designed
for eval $(enpass-cli env ...) workflows. Supports -field flag to
select a specific field label (default: password) and -json for
programmatic consumption.
Claude-Session: https://claude.ai/code/session_01Lr7gquKQVPezfc8NvN39q8
* fix: harden env command input validation and field resolution
Validate varName as a POSIX shell identifier to prevent injection via
eval. Clear the default cardType filter in the -field path so non-password
field labels (username, Access Key, etc.) are actually reachable. Output
text pairs immediately instead of accumulating.
Claude-Session: https://claude.ai/code/session_01Lr7gquKQVPezfc8NvN39q8
args.trashed=flag.Bool("trashed", false, "Show trashed items in the 'list' and 'show' command.")
96
98
args.detailed=flag.Bool("detailed", false, "Show every field of each entry in 'list' and 'show'. Without this flag, only the original summary fields (title, login, category, label, type) are displayed.")
97
99
args.clipboardPrimary=flag.Bool("clipboardPrimary", false, "Use primary X selection instead of clipboard for the 'copy' command.")
100
+
args.field=flag.String("field", "", "Field label to extract (default: password). Used with 'env' command.")
98
101
// write command flags
99
102
args.title=flag.String("title", "", "Entry title (for create/edit).")
100
103
args.login=flag.String("login", "", "Username or email (for create/edit).")
@@ -131,6 +134,7 @@ func printHelp() {
131
134
fmt.Println(" show [filter] Show entries (with passwords; computes RFC 6238 TOTP code)")
132
135
fmt.Println(" copy <filter> Copy password to clipboard")
133
136
fmt.Println(" pass <filter> Print password to stdout")
137
+
fmt.Println(" env VARNAME=filter Output entry field as KEY=VALUE for shell eval")
134
138
fmt.Println(" ui Interactive terminal UI")
135
139
fmt.Println(" create Create a new entry")
136
140
fmt.Println(" edit <filter> Edit an existing entry")
@@ -146,6 +150,11 @@ func printHelp() {
146
150
fmt.Println("are treated as sensitive: their secret is hidden in list, and show prints")
147
151
fmt.Println("the current RFC 6238 code alongside the secret.")
148
152
fmt.Println()
153
+
fmt.Println("The env command outputs vault values as shell-safe KEY='value' lines.")
154
+
fmt.Println("Use -field to select a specific field label (default: password).")
0 commit comments