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.8.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.8-py3-none-any.whl (43.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: getv-0.2.8.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.8.tar.gz
Algorithm Hash digest
SHA256 38ea6f45cc4d192622deb806c47a68be8883aec5deccbff61802f352e4ead6c9
MD5 817f2a73f61e53d51085ccf47a3b1320
BLAKE2b-256 99e55577f9f7e4c492e4825d1196d3eb0a3b947dfd89450b66a32656e219835d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: getv-0.2.8-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.8-py3-none-any.whl
Algorithm Hash digest
SHA256 05f6af4469658a99b677db36a1601172bbd0b2cc454a37c48debfcf0619594bd
MD5 ac32b5f4e754d6212587073fb5151383
BLAKE2b-256 46990698481e817d4e963025c799f52183c59be6a6e62bddb126950fdb5c056f

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