{"id":21477477,"url":"https://github.com/spectralops/senv","last_synced_at":"2025-07-23T11:39:51.636Z","repository":{"id":43533116,"uuid":"340917865","full_name":"SpectralOps/senv","owner":"SpectralOps","description":"Friends don't let friends leak secrets on their terminal window :see_no_evil:","archived":false,"fork":false,"pushed_at":"2021-05-04T16:41:27.000Z","size":759,"stargazers_count":104,"open_issues_count":0,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-07-15T20:15:08.160Z","etag":null,"topics":["environment-variables","golang","security","security-tools"],"latest_commit_sha":null,"homepage":"","language":"Go","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/SpectralOps.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-02-21T14:14:22.000Z","updated_at":"2024-11-21T13:31:18.000Z","dependencies_parsed_at":"2022-08-30T21:41:15.706Z","dependency_job_id":null,"html_url":"https://github.com/SpectralOps/senv","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/SpectralOps/senv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpectralOps%2Fsenv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpectralOps%2Fsenv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpectralOps%2Fsenv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpectralOps%2Fsenv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SpectralOps","download_url":"https://codeload.github.com/SpectralOps/senv/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpectralOps%2Fsenv/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266671256,"owners_count":23966138,"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","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["environment-variables","golang","security","security-tools"],"created_at":"2024-11-23T11:13:48.026Z","updated_at":"2025-07-23T11:39:51.613Z","avatar_url":"https://github.com/SpectralOps.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"![](media/cover.png)\n\n# senv - safer `env`\n![ci](https://github.com/spectralops/senv/actions/workflows/ci.yml/badge.svg)\n\n\nFriends don't let friends leak secrets in terminal windows.\n\n![](media/env.png)\n\n![](media/omg.webp)\n\n:tv: Print your environment to the terminal without worry, even in recorded Zoom sessions  \n:see_no_evil: Execute commands and block snooping your secrets  \n:computer: Start an interactive shell with non-sensitive environment variables  \n:whale: Use `senv` with Docker to ensure nothing inside the container is snooping around  \n:hash: Copy `senv` to `/usr/bin` and use `/usr/bin/senv` in your shebang lines to ensure no secret leaks  \n\n\n## Quick Start\n\nYou can install `senv` with homebrew:\n\n```\n$ brew tap spectralops/tap \u0026\u0026 brew install senv\n````\n\n### Print env\n\nUse it just like `env`. Now you can print your environment in Zoom sessions :smile:\n\n```\n$ senv\n```\n### Execute command\n\nUsing `senv` before your command ensures no environment variable you don't want will be transferred to the binary that will run:\n\n\n```\n$ senv my-binary --myopts todo.txt\n```\n\n### A more secure shebang\n\nPlace `senv` in  `/usr/bin/senv`, and now you run safe, like so:\n\n```sh\n#!/usr/bin/senv node\n\nconsole.log(\"hello, world\")\n```\n\n\n## Options\n\n```\n$ senv --help\nArguments:\n  [\u003ccmd\u003e ...]    Command to execute\n\nFlags:\n  -h, --help      Show context-sensitive help.\n      --info      Show information\n      --create    Create global config\n      --config    Path to config file\n```\n\n## The redaction list\n\nRedactions are simply names of sensitive keys, or regular expressions of keys. Any of these is good:\n\n\n```\nGITHUB_TOKEN\n.*_TOKEN\n```\n\nYou can can submit a pull request if this is a popular key, or add to your own global configuration if you like to do things in a different but specific way.\n\n## Adding your own redactions\n\nYou can easily make your own custom redaction list. Create it:\n\n```\n$ senv --create\nWrote config to ~/.senv.yaml\n```\n\nNow you can add to your `.senv.yaml`:\n\n```yaml\n# ~/.senv.yaml\n\nredact:\n- MY_SECRET_TOKEN\n```\n\n`MY_SECRET_TOKEN` will now be removed from the environment, in addition to the set of redaction `senv` already performs. If you like to start from scratch and redact _only_ your own list:\n\n```yaml\n# ~/.senv.yaml\n\nno_defaults: true\nredact:\n- MY_SECRET_TOKEN\n```\n\n## Use as a library\n\nYou can use `senv` as a library in the following way:\n\n```go\nimport (\n\t\"github.com/spectralops/senv/pkg\"\n)\nsenv := pkg.Senv{\n  Cmd: []string{ \"my-cmd\", \"arg1\" }\n}\nsenv.Init()\nsenv.Clean() // from this point your env is clean\n\n// you can also use:\n// senv.Print()\n// senv.Exec()\n```\n\n\n## Contributing a default redaction\n\nDefault redactions are placed at [pkg/redact.go](pkg/redact.go). Please feel free to add a default and submit a PR if:\n\n* It is well-known\n* Generic enough, and not an edge-case\n\nAfter adding a redaction, run \u0026 update tests if needed:\n\n\n```\n$ make test\n```\n\n\n### Thanks:\n\nTo all [Contributors](https://github.com/spectralops/senv/graphs/contributors) - you make this happen, thanks!\n\n# Copyright\n\nCopyright (c) 2021 [@jondot](http://twitter.com/jondot). See [LICENSE](LICENSE.txt) for further details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspectralops%2Fsenv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspectralops%2Fsenv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspectralops%2Fsenv/lists"}