Skip to main content

Universal .env variable manager — read, write, encrypt, delegate across services and devices

Project description

getv — Universal .env Variable Manager

PyPI version Python versions License: Apache-2.0 Downloads Tests

We increasingly work with APIs, especially in the context of LLMs, constantly needing to provide new keys and then copy them to other tools, .env files. What if when copying to the clipboard, they were automatically saved to .env from which various applications like ollama or libraries like liteLLM could retrieve the specified API TOKEN?

  • copy an API KEY in your browser
  • run: getv grab
  • use multiple keys directly: getv exec llm groq -- python app.py

Read, write, encrypt, and delegate environment variables across services and devices.

img.png

Copy to the clipboard and run getv grab to detect and save the API key

$ getv grab

Detected:  groq (GROQ_API_KEY)
Key:       gsk_Y1xV...TNpA
Source:    Prefix match
Domain:    console.groq.com
Category:  llm
Profile:   ~/.getv/llm/groq.env

Saved to /home/tom/.getv/llm/groq.env

Usage:
  getv get llm groq GROQ_API_KEY
  getv exec llm groq -- python app.py

without any plugins, managers, or integrations...

Clipboard → .env Auto-Detection No other CLI tool has this feature. Copy any API key and run getv grab — it auto-detects the provider, saves to the right profile, and shows usage commands. Perfect for rapid RPi + LLM development workflow.

$ getv grab              # copy API key → auto-detect provider → save
$ getv exec llm groq -- python app.py   # run with profile injected
$ getv ssh rpi3 "uname -a"              # SSH using stored profile

getv.gif

Why getv?

  • Clipboard → .envgetv grab auto-detects 19 API key prefixes from clipboard
  • Built-in integrations — SSH, curl, Docker, LiteLLM, Ollama, Pydantic — no plugins
  • Smart profiles — organize by category (llm/, devices/, tokens/) with per-app defaults
  • One-liner power — process substitution, pipes, shell eval

Install

pip install getv                   # core
pip install "getv[crypto]"         # + encryption (Fernet)
pip install "getv[all]"            # everything

Quick Start

# Save a profile
getv set llm groq LLM_MODEL=groq/llama-3.3-70b-versatile GROQ_API_KEY=gsk_xxx

# Read a variable
getv get llm groq LLM_MODEL

# List profiles (secrets masked)
getv list llm

# Run with env injected
getv exec llm groq -- python my_script.py

# Auto-detect API key from clipboard
getv grab

# Export formats
getv export llm groq --format json
getv export llm groq --format shell
getv export llm groq --format docker

Python API

from getv import EnvStore, ProfileManager

# Single .env file
store = EnvStore("~/.myapp/.env")
store.set("DB_HOST", "localhost").set("DB_PORT", "5432").save()

# Named profiles
pm = ProfileManager("~/.getv")
pm.add_category("llm", required_keys=["LLM_MODEL"])
pm.set("llm", "groq", {"LLM_MODEL": "groq/llama-3.3-70b-versatile", "GROQ_API_KEY": "gsk_xxx"})

# Merge profiles
cfg = pm.merge_profiles({"APP_NAME": "myapp"}, llm="groq", devices="rpi3")

Profile Directory

~/.getv/
├── .fernet.key            ← encryption key (chmod 600)
├── defaults/              ← per-app profile selections
│   ├── fixpi.conf         → llm=groq, devices=rpi3
│   └── prellm.conf        → llm=openrouter
├── devices/
│   ├── rpi3.env
│   └── rpi4-prod.env
├── llm/
│   ├── groq.env
│   └── openrouter.env
└── tokens/
    └── github.env

CLI Reference

Command Description
getv set CATEGORY PROFILE KEY=VAL... Create/update profile
getv get CATEGORY PROFILE KEY Get single value
getv list [CATEGORY [PROFILE]] List categories/profiles/vars
getv delete CATEGORY PROFILE Delete profile
getv export CATEGORY PROFILE --format FMT Export (json/shell/docker/env/pydantic)
getv encrypt CATEGORY PROFILE Encrypt sensitive values
getv decrypt CATEGORY PROFILE Decrypt values
getv exec CATEGORY PROFILE -- CMD... Run with profile env
getv use APP CATEGORY PROFILE Set app default
getv defaults [APP] Show app defaults
getv ssh PROFILE [CMD] SSH to device
getv curl PROFILE URL Authenticated API call
getv grab [--dry-run] Auto-detect API key from clipboard
getv diff CATEGORY A B Compare two profiles
getv copy CAT/SRC CAT/DST Clone profile
getv import FILE [CAT PROFILE] Import from .env / docker-compose
getv init Interactive setup wizard

Documentation

Document Description
docs/INTEGRATIONS.md SSH, LiteLLM, Ollama, Docker, curl, Pydantic, nfo, file watcher
docs/GRAB.md Clipboard detection — 19 prefixes, browser history, Python API
docs/SECURITY.md Masking, Fernet encryption, key rotation, validation, format export
docs/EXAMPLES.md 20+ one-liner examples — pipes, process substitution, cron, Docker
docs/COMPARISON.md getv vs direnv vs dotenvx vs envie

Environment Variables

Variable Default Description
GETV_HOME ~/.getv Base directory for profiles

Adopted by

  • fixpi — SSH + LLM diagnostic agent
  • prellm — LLM preprocessing proxy
  • code2logic — Code analysis engine
  • amen — Intent-iterative AI gateway
  • marksync — Markdown sync server
  • curllm — LLM-powered web automation

Development

git clone https://github.com/wronai/getv.git
cd getv
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
pytest  # 190 tests

License

Apache License 2.0 - see LICENSE for details.

Author

Created by Tom Sapletta - tom@sapletta.com

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

getv-0.2.10.tar.gz (49.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

getv-0.2.10-py3-none-any.whl (44.4 kB view details)

Uploaded Python 3

File details

Details for the file getv-0.2.10.tar.gz.

File metadata

  • Download URL: getv-0.2.10.tar.gz
  • Upload date:
  • Size: 49.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for getv-0.2.10.tar.gz
Algorithm Hash digest
SHA256 1279a3909eda281e14ab7e064e64b3cc327e147902d75b30f13adb8285b57b46
MD5 d40b0dd33c3cbf64c1bf2d5b55fc719f
BLAKE2b-256 c9cdf78124ed2f992f46f73ec8c82c2389d8a9b14859e027edb43aa853c37411

See more details on using hashes here.

File details

Details for the file getv-0.2.10-py3-none-any.whl.

File metadata

  • Download URL: getv-0.2.10-py3-none-any.whl
  • Upload date:
  • Size: 44.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for getv-0.2.10-py3-none-any.whl
Algorithm Hash digest
SHA256 ad2edcfb399c7e24b74686a344e90ae4c042b2c2abeebff2f496a9deed925a9c
MD5 c4a898e3e6af21798c8a08722af5a471
BLAKE2b-256 0fe0b5b1d1ee93e24f1d2a9392f4258a1c5e883f2e6ed06da41071de218ba178

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page