Skip to main content

grep's the env

Project description

grepenv

greps your env 🔎

PyPI version Coverage Status Pipeline

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.

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.

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

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

grepenv-1.0.2.tar.gz (8.0 kB view hashes)

Uploaded Source

Built Distribution

grepenv-1.0.2-py3-none-any.whl (9.4 kB view hashes)

Uploaded Python 3

Supported by

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