{"id":19251029,"url":"https://github.com/onesignal/envgrep","last_synced_at":"2025-04-21T12:33:37.784Z","repository":{"id":57625414,"uuid":"379394547","full_name":"OneSignal/envgrep","owner":"OneSignal","description":"Search through all process environment variables on linux","archived":false,"fork":false,"pushed_at":"2021-06-23T17:09:47.000Z","size":7,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":37,"default_branch":"main","last_synced_at":"2025-04-20T17:53:02.666Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OneSignal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-06-22T20:36:13.000Z","updated_at":"2025-04-03T03:01:21.000Z","dependencies_parsed_at":"2022-08-26T22:20:21.238Z","dependency_job_id":null,"html_url":"https://github.com/OneSignal/envgrep","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OneSignal%2Fenvgrep","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OneSignal%2Fenvgrep/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OneSignal%2Fenvgrep/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OneSignal%2Fenvgrep/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OneSignal","download_url":"https://codeload.github.com/OneSignal/envgrep/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250056295,"owners_count":21367528,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T18:19:41.438Z","updated_at":"2025-04-21T12:33:37.470Z","avatar_url":"https://github.com/OneSignal.png","language":"Rust","readme":"# EnvGrep\n\nLinux CLI utility to find environment variable keys or values in all processes\nthat you have permissions to read.\n\n## Example\n\nLet's imagine that we have a long-running server process that have a few\nenvironment variables that are used for configuration: `SERVER_VERSION`,\n`SERVER_BIND_PORT`, and `SERVER_ID`. We can simulate this using a few `tail -f\n/dev/null` processes.\n\n```bash\n$ env SERVER_VERSION=1.0.1 SERVER_ID=1 SERVER_BIND_PORT=:8080 tail -f /dev/null \u0026\n[1] 1969\n$ env SERVER_VERSION=1.0.1 SERVER_ID=2 SERVER_BIND_PORT=:9090 tail -f /dev/null \u0026\n[2] 1970\n$ env SERVER_VERSION=1.0.1 SERVER_ID=3 SERVER_BIND_PORT=:8181 tail -f /dev/null \u0026\n[3] 1971\n```\n\nNow that these processes are running and have their variables set, we can search\nboth keys and values using `envgrep`.\n\n```bash\n# To find all configuration variables for all servers\n$ envgrep SERVER\n/proc/1969/environ (tail -f /dev/null):\nSERVER_VERSION = \"1.0.1\"\nSERVER_ID = \"1\"\nSERVER_BIND_PORT = \":8080\"\n\n/proc/1970/environ (tail -f /dev/null):\nSERVER_VERSION = \"1.0.1\"\nSERVER_ID = \"2\"\nSERVER_BIND_PORT = \":9090\"\n\n/proc/1971/environ (tail -f /dev/null):\nSERVER_VERSION = \"1.0.1\"\nSERVER_ID = \"3\"\nSERVER_BIND_PORT = \":8181\"\n\n# To find only the IDs for the server processes\n$ envgrep SERVER_ID\n/proc/1969/environ (tail -f /dev/null):\nSERVER_ID = \"1\"\n\n/proc/1970/environ (tail -f /dev/null):\nSERVER_ID = \"2\"\n\n/proc/1971/environ (tail -f /dev/null):\nSERVER_ID = \"3\"\n\n# To find the specific process that is running on port 8181\n$ envgrep 8181\n/proc/1971/environ (tail -f /dev/null):\nSERVER_BIND_PORT = \":8181\"\n```\n\n## Installing\n\n`envgrep` is currently not packaged with any distro's package manager, so you\nmust rely on `cargo` to compile and install from source.\n\n```bash\n$ cargo install envgrep\n```\n\n## Command-line options\n\n```\nenvgrep 0.1.0\nSearch through the environment variables of all running processes on the system and report on all variables that match\nthe specified pattern\n\nUSAGE:\n    envgrep [FLAGS] \u003cPATTERN\u003e\n\nFLAGS:\n    -i, --case-insensitive    Perform case-insensitive matching with the specified regex\n    -h, --help                Prints help information\n    -V, --version             Prints version information\n    -v, --verbose             Print all error messages as they occur instead of hiding them\n\nARGS:\n    \u003cPATTERN\u003e    Regex pattern to use to search for environment variables. Matches on both parts of the `KEY=value`\n                 string (independently), so parts of the environment variable name, value, or both can be used here``\n```\n\n## Limitations\n\nEnvgrep can search through procfs for environment variables, but applications\ncan also modify their own environments. Many executables do not rewrite changes\nto their environment back into procfs, so if your executable modifies its own\nenvironment it may not show up in the output of envgrep.\n\nThe tool currently relies on procfs, so it only works on operating systems that\nsupport procfs (no macOS or Windows support).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonesignal%2Fenvgrep","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fonesignal%2Fenvgrep","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonesignal%2Fenvgrep/lists"}