Skip to content

Feature: add a get CLI command for retrieving single key values #3

@TickTockBent

Description

@TickTockBent

envy set lets you write a key via CLI, and envy run injects keys as environment variables for a command. But there's no way to read a single key value from the CLI without entering the TUI.

For scripting and automation workflows, a get command would fill the missing read side of the CLI interface:

# Retrieve a single key value
envy get myproject API_KEY

# Use in shell scripts
export TOKEN=$(envy get myproject AUTH_TOKEN)

# Specify environment
envy get myproject API_KEY -e prod

This would mirror the set command's interface (project name + key name + optional -e flag) and make envy usable in non-interactive contexts like CI pipelines, shell scripts, and dotfile bootstrapping.

Scope

  • Accept project and key positional args
  • Support -e / --env flag (same as set)
  • Print the decrypted value to stdout (no newline, for clean piping)
  • Exit non-zero if project or key not found

Happy to submit a PR for this if it aligns with your plans for the project.

// ticktockbent

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions