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

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.9.tar.gz (49.1 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.9-py3-none-any.whl (43.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: getv-0.2.9.tar.gz
  • Upload date:
  • Size: 49.1 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.9.tar.gz
Algorithm Hash digest
SHA256 238ef8004561d866c69587a6fa4858d6455973188b5f988cb55c0024d99c5454
MD5 03fa01a06f0c5247bc3d1530c638f63f
BLAKE2b-256 a8302b56a1243de134fc6308b8f7ddd3460ec1aff28fb63e4d471301d10f9f9b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: getv-0.2.9-py3-none-any.whl
  • Upload date:
  • Size: 43.8 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.9-py3-none-any.whl
Algorithm Hash digest
SHA256 1ce5dc298a7e8866a7ce6e36262a9039dbe609086cef6093357656a67c143b2f
MD5 95d89e7cecc3954125dec2db435ca7be
BLAKE2b-256 2eabcb52bc321ffc442e3dc21c8fcbb46c184188bde841e9e21b6c5839126f60

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