ennote secret

Command: ennote secret get

ennote secret get prints an Ennote secret, a single key or an older version, or injects the secret's keys as environment variables into a child process, so no .env file is written to disk.

Usage

Print a secret to stdout, or run a command with the secret injected into its environment.

ennote secret get <secret-query> [-- <command>] [flags]

Secret Query Formats

  • <name>: Fetches the latest version of the secret.
  • <name>@<version>: Fetches a specific historical version.
  • <name>:<key>: Fetches the latest version, targets specific key (outputs raw unescaped string).
  • <name>@<version>:<key>: Fetches a specific version, targets specific key.

Override Flags

You can pass specific flags to override your current active configuration for a single command execution:

  • --organization-id: Target Organization ID (Overrides local config and environment variables).
  • --workspace-id: Target Workspace ID (Overrides local config and environment variables).

Outputting Data (Stdout)

# Print the entire payload to console
ennote secret get "stripe"

# Print a specific version and target a specific key
ennote secret get "database@5:password"

# Extract a specific key for bash scripts
export DB_PASS=$(ennote secret get "database:password")

Process Injection (The Core Use-Case)

Instead of piping variables or writing .env files, Ennote securely injects secrets directly into the memory space of a child process.

# Inject all keys from the 'stripe' secret into a Node server
ennote secret get "stripe" -- npm run dev

# Inject keys into the AWS CLI
ennote secret get "aws" -- aws s3 ls

# Inject keys using explicit organization and workspace overrides
ennote secret get "aws" --workspace-id my-wrk-id --organization-id my-org-id -- aws s3 ls
Security Note: The CLI performs strict $PATH resolution (exec.LookPath) before executing the child command to prevent PATH-hijacking attacks. Secrets are injected into the standard OS execution environment (cmd.Env) and are isolated to that specific process tree.

JSON Type Handling & Serialization

When injecting secrets into child processes, Ennote automatically serializes complex nested JSON objects (e.g., Arrays or nested maps) back into standard JSON strings.

Primitive values (strings, booleans, floats) are injected natively as strings to ensure compatibility with standard application parsers.

FAQ

How do I inject secrets into a process without a .env file?

Run ennote secret get "<secret-name>" -- <command>, for example ennote secret get "stripe" -- npm run dev. Ennote injects the secret's keys as environment variables of that child process only, so no .env file is written.

How do I read a single key or an older version of a secret?

Use the query format <name>:<key> for one key, <name>@<version> for a specific version, or both: ennote secret get "database@5:password".

Need Help?

If you encounter any issues or have questions, don't hesitate to contact support. Our team is here to assist you with any challenges you might face.