grep's the env
Project description
grepenv
greps your env 🔎
About
A simple tool to search through your environment.
Provides additional options for highlighting, searching specifically keys or values, and extracting values from best match keys.
Installation
grepenv
can be installed using pip, but pipx is recommended:
pipx install grepenv
This installs the grepenv
shell script:
grepenv --help
Usage
grepenv
takes a regex pattern, and matches it against currently available environment variables.
Calling grepenv --example
will show some example usage.
$ grepenv xdg # Will find any key or value that contains the letters xdg (lower or upper case).
$ grepenv "_api_(key|token)_" -k # finds any environment that looks like an api key. Searches only keys.
GITHUB_API_TOKEN=abc_NlNhalNDL78NAhdKhNAk78bdf7f
OPENAI_API_KEY=123_abcdefghijklmno
$ grepenv -fk git # find-key 'git'- finds all keys matching the pattern 'git' and gets their values.
123_abcdefghijklmnop
Development
This repo uses poetry as a build system, and invoke for task running.
inv
can then be used to run as follows:
$ inv lint
$ inv test
$ inv build
$ inv --list # Shows available commands
You can achieve similar results with a one liner bash alias, but after having rewritten that alias on every machine I've used, I decided to turn it into a package for maintainability.
Another language might have been more fun to use, but since pip is by FAR the most available package manager (compared to say cargo), here we are.
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
Built Distribution
File details
Details for the file grepenv-1.0.5.tar.gz
.
File metadata
- Download URL: grepenv-1.0.5.tar.gz
- Upload date:
- Size: 8.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.12.1 Linux/6.2.0-1018-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd0794e93e4ae045279a236859e8f8ddcb9240681eb09addfb2705fa2463c31c |
|
MD5 | c5d30b9f25dcde8dd79559dcf96b5183 |
|
BLAKE2b-256 | d526ee03b1b2c95ba418e9af5ae95759c8b4619ec27c04aaec8ed6bbd3fce1b8 |
File details
Details for the file grepenv-1.0.5-py3-none-any.whl
.
File metadata
- Download URL: grepenv-1.0.5-py3-none-any.whl
- Upload date:
- Size: 9.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.12.1 Linux/6.2.0-1018-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1fbf8b0212818e055184a55272ee0b62e4650647106befb7182b79ef863d6847 |
|
MD5 | 3d6ded488221916b246d72302762a590 |
|
BLAKE2b-256 | 7fbfefe2acda39ca5d0951e967ca0e39c6909e96cc17ae75c27f6e55c863b400 |