Skip to main content

grep's the env

Project description

grepenv 🔎

greps your env

PyPI version Coverage Status Pipeline

About

A little tool to search through your environment.

I made grepenv to simplify the process of calling various combinations of env | grep | sort, and replicating my aliases for this across machines.

Installation

grepenv can be installed using pip, but pipx is recommended:

pipx install grepenv

This installs the grepenv shell script:

grepenv --help 
ge --help # The short alias 'ge' is also available

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)_" --keys # finds any environment variable with this regex pattern, matching only on keys.
GITHUB_API_TOKEN=abc_NlNhalNDL78NAhdKhNAk78bdf7f
OPENAI_API_KEY=123_abcdefghijklmno
$ grepenv --find-key gitlab # Search for an environment variable with the name gitlab, and output it's value.
123_abcdefghijklmnop
# GITLAB_API_TOKEN=123_abcdefghijklmnop
$ grepenv perl --path # Search for the pattern "perl", but only in the PATH
/usr/bin/site_perl
/usr/bin/vendor_perl
/usr/bin/core_perl

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.1.0.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

grepenv-1.1.0-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

Details for the file grepenv-1.1.0.tar.gz.

File metadata

  • Download URL: grepenv-1.1.0.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.12.7 Linux/6.5.0-1025-azure

File hashes

Hashes for grepenv-1.1.0.tar.gz
Algorithm Hash digest
SHA256 7f4a2bbe67b18d69b729bc3786b6740b51e8add5b49f95bcc2a7e009a387cd5b
MD5 38d99225d4dcbfde43f04ba243368de4
BLAKE2b-256 c1427f103b1f8c131a4d9b9d41ef22384fe394312680ea44c48e6679dc84076f

See more details on using hashes here.

File details

Details for the file grepenv-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: grepenv-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.12.7 Linux/6.5.0-1025-azure

File hashes

Hashes for grepenv-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3a7528aaa060da0e82345dab88a4f739c965a9c0303076fd97386c86cb8e64e3
MD5 b96b6732bf0e765ee59837769786df52
BLAKE2b-256 4accaf6deda3ea42a2f0b7e7a3d57c518a82b6a6d8a6ff7ddb2a5d1c5a3f5aca

See more details on using hashes here.

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