{"id":16179729,"url":"https://github.com/bep/firstupdotenv","last_synced_at":"2026-04-12T12:03:03.241Z","repository":{"id":148327921,"uuid":"531824362","full_name":"bep/firstupdotenv","owner":"bep","description":"Loads env from the first firstup.env it finds.","archived":false,"fork":false,"pushed_at":"2026-02-02T17:03:05.000Z","size":23,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-11T01:47:39.631Z","etag":null,"topics":["environment-variables","golang","zsh"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bep.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-09-02T07:24:39.000Z","updated_at":"2026-02-02T17:08:58.000Z","dependencies_parsed_at":"2024-10-27T19:23:14.051Z","dependency_job_id":"2972fdaa-f7c6-468e-867b-b97b349d1a74","html_url":"https://github.com/bep/firstupdotenv","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":"bep/gomaintemplate","purl":"pkg:github/bep/firstupdotenv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bep%2Ffirstupdotenv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bep%2Ffirstupdotenv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bep%2Ffirstupdotenv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bep%2Ffirstupdotenv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bep","download_url":"https://codeload.github.com/bep/firstupdotenv/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bep%2Ffirstupdotenv/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29686798,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T15:51:39.154Z","status":"ssl_error","status_checked_at":"2026-02-21T15:49:03.425Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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","zsh"],"created_at":"2024-10-10T05:43:54.191Z","updated_at":"2026-04-12T12:03:03.232Z","avatar_url":"https://github.com/bep.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"This is a simple Go program that finds the first `firstup.env` file starting from the current directory walking upward, stopping before the root folder (meaning: any `/firstup.env` file will not be read).\n\nIt will write the env vars as export statements. It will also store the list of keys set in a separate environment variable and unset those next time `firstupdotenv` is run.\n\nThe output may then look like this:\n\n```bash\nunset FOO\nunset BAR\nexport FIRSTUPDOTENV_CURRENT_SET_ENV='FOO,BAR'\nexport FOO='value1'\nexport BAR='value2'\n```\n\nNote the use of single quotes above to prevent any unlikely security issues with command substitution, word splitting and glob expansion. But this means that environment values with single quotes in them will not work correctly.\n\nThe `.env` format is a file on the form  `key=value`. It ignores empty lines and lines starting with # and lines without an equals sign. If the same key is defined more than once, the last will win.\n\n## 1Password Integration\n\nYou can load environment variables from 1Password by adding a line starting with `op://`:\n\n```bash\n# Regular variables\nFOO=bar\n\n# Load from 1Password\nop://Dev/myproject/env\n```\n\nThe referenced 1Password field should contain line-separated `KEY=value` entries:\n\n```\nAWS_ACCESS_KEY=xxx\nAWS_SECRET_KEY=yyy\n```\n\nThis executes a single `op read` command, which is useful since `op` can be slow (~1 second per invocation). All keys loaded from 1Password are tracked and will be unset when you navigate away.\n\nTo install:\n\n```bash\ngo install github.com/bep/firstupdotenv@latest\n```\n\nThis tool is meant to be used in combination with some shell extension that triggers when you `cd` into a directory. If you use the [Z shell](https://en.wikipedia.org/wiki/Z_shell), putting this in your `.zshrc` will work:\n\n```\nautoload -U add-zsh-hook\n\nfirstupdotenv_after_cd() {\n\tsource \u003c(firstupdotenv)\n}\n\nadd-zsh-hook chpwd firstupdotenv_after_cd\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbep%2Ffirstupdotenv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbep%2Ffirstupdotenv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbep%2Ffirstupdotenv/lists"}