{"id":13862694,"url":"https://github.com/christianromney/projectile-direnv","last_synced_at":"2025-07-14T13:32:01.081Z","repository":{"id":138796283,"uuid":"53206073","full_name":"christianromney/projectile-direnv","owner":"christianromney","description":"Export your projectile project's environment variables in .envrc","archived":true,"fork":false,"pushed_at":"2017-03-09T15:58:44.000Z","size":5,"stargazers_count":15,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"develop","last_synced_at":"2024-11-22T23:32:05.598Z","etag":null,"topics":["emacs","projectile"],"latest_commit_sha":null,"homepage":null,"language":"Emacs Lisp","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/christianromney.png","metadata":{"files":{"readme":"README.org","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}},"created_at":"2016-03-05T14:45:07.000Z","updated_at":"2023-06-27T20:24:56.000Z","dependencies_parsed_at":"2024-01-28T10:33:04.334Z","dependency_job_id":null,"html_url":"https://github.com/christianromney/projectile-direnv","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/christianromney/projectile-direnv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christianromney%2Fprojectile-direnv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christianromney%2Fprojectile-direnv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christianromney%2Fprojectile-direnv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christianromney%2Fprojectile-direnv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/christianromney","download_url":"https://codeload.github.com/christianromney/projectile-direnv/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christianromney%2Fprojectile-direnv/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265297477,"owners_count":23742586,"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":["emacs","projectile"],"created_at":"2024-08-05T06:01:50.184Z","updated_at":"2025-07-14T13:32:00.792Z","avatar_url":"https://github.com/christianromney.png","language":"Emacs Lisp","funding_links":[],"categories":["Emacs Lisp"],"sub_categories":[],"readme":"* projectile-direnv.el\n\nHave Emacs set environment variables defined in a project's .envrc.\n\n* Deprecation Notice\n\nThe newer [[https://github.com/wbolster/emacs-direnv][emacs-direnv]] project takes a slightly different approach, which solves some of the drawbacks of this solution. I encourage you to try it out.\n\n* Motivation\n\nWhen working at the terminal, I use [[http://direnv.net/][direnv]] to export environment\nvariables that alter the behavior of the [[http://12factor.net/][12 factor]] applications I\nwrite. direnv automatically exports the variables to the environment\nwhen you *cd* into a directory containing a *.envrc* file.\n\nWhen launching a GUI instance of Emacs (not from the terminal), direnv\nnever gets the chance to export your environment variables, however. \n\nThis package contains a command *projectile-direnv-export-variables*\nwhich will look for a .envrc file in the projectile-project-root. \n\nIt will then parse the .envrc file for exports and call *setenv* in\nthe Emacs environment. This is useful, for instance, when launching\nprocesses from within Emacs (e.g. REPLs) that depend on the values in\nthese variables.\n\n* Installation\n\nThis package is available on MELPA as *projectile-direnv*\n\n[[https://melpa.org/#/projectile-direnv][file:https://melpa.org/packages/projectile-direnv-badge.svg]] \n\n* Dependencies\n\n- [[https://github.com/magnars/s.el][s]]\n- [[https://github.com/magnars/dash.el][dash]]\n- [[https://github.com/bbatsov/projectile][projectile]]\n\n* Usage\n\nThe easiest way to use this package is to invoke\n*projectile-direnv-export-variables* from a hook:\n\n#+begin_src lisp\n\n(add-hook 'projectile-mode-hook 'projectile-direnv-export-variables)\n\n#+end_src\n\n** Cautionary Note\n\nYou should only do this if you work on one project with a .envrc file\nat a time. This is because Emacs' environment is a global one, and\nprojectile mode is per-buffer. It is easily conceivable to visit a\nfile in one project and load envvars whose names clash with those in\nanother project. This will cause a last-project-wins scenario that\ncould lead to confusion and frustrated debugging. \n\nThere are two ways to address this concern.\n\n1. Explicitly invoke the command (instead of using a hook)\n2. Name your environment variables uniquely with a project prefix\n\n* Limitations / Known Issues\n\n- This package doesn't yet handle variable unloading\n- Ideally, the user should be prompted to allow a particular .envrc\n  just as direnv does (and Emacs does when loading from\n  .dir-locals.el)\n\n* License (GPL v3)\n\nCopyright (C) 2016 Free Software Foundation, Inc.\n\nThis program is free software; you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program.  If not, see \u003chttp://www.gnu.org/licenses/\u003e.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchristianromney%2Fprojectile-direnv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchristianromney%2Fprojectile-direnv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchristianromney%2Fprojectile-direnv/lists"}