{"id":19796153,"url":"https://github.com/abbotto/dot-export","last_synced_at":"2026-06-08T01:31:05.901Z","repository":{"id":72635394,"uuid":"222605515","full_name":"abbotto/dot-export","owner":"abbotto","description":"Safely export environment variables from a file","archived":false,"fork":false,"pushed_at":"2019-11-26T22:58:08.000Z","size":9,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-28T16:10:08.913Z","etag":null,"topics":["dot","environment-variables","export","shell"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/abbotto.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-19T04:05:37.000Z","updated_at":"2023-02-22T07:08:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"f3163f7b-7e83-4f26-9c91-21e6004f642e","html_url":"https://github.com/abbotto/dot-export","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/abbotto/dot-export","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abbotto%2Fdot-export","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abbotto%2Fdot-export/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abbotto%2Fdot-export/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abbotto%2Fdot-export/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abbotto","download_url":"https://codeload.github.com/abbotto/dot-export/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abbotto%2Fdot-export/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34044919,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-07T02:00:07.652Z","response_time":124,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","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":["dot","environment-variables","export","shell"],"created_at":"2024-11-12T07:18:37.188Z","updated_at":"2026-06-08T01:31:05.896Z","avatar_url":"https://github.com/abbotto.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [Dot-Export](dot-export)\n\n[![Build Status](https://travis-ci.org/abbotto/dot-env.svg?branch=master)](https://travis-ci.org/abbotto/dot-env)\n[![license](https://img.shields.io/github/license/mashape/apistatus.svg)](LICENSE)\n\n## Overview\n\n### Usage\n\nSafely export environment variables from a file.\n  - Will not overwrite previously set variables in the current process unless the `--overwrite` or `-o` flag is passed.\n  - If an environemnt file cannot be located the script will check in the `\u003cDOT_EXPORT_PATH\u003e` directory.\n\n        Usage: dot-export -f \u003cFILE_1\u003e -f \u003cFILE_2\u003e -f \u003cFILE_3\u003e...\n               dot-export -p \u003cDOT_EXPORT_PATH\u003e -f \u003cFILE\u003e\n               dot-export -o -p \u003cDOT_EXPORT_PATH\u003e -f \u003cFILE\u003e\n\n#### Arguments\n\n- `-c, --command`: Pass a command to run in the `dot-export` script (optional)\n- `-f, --file`: The location of an environment file (required)\n- `-o, --overwrite`: Overwrite previously exported environment variables (optional)\n- `-p, --path`: The base path of the environment files that are passed as arguments (optional)\n\n### Under the hood\n\n#### dot [.]\n\n\u003e Execute commands from a file in the current environment. [LINK](https://pubs.opengroup.org/onlinepubs/007904975/utilities/dot.html)\n\n#### export [set -a]\n\n\u003e When this option is on, the export attribute shall be set for each variable to which an assignment is performed. [LINK](https://pubs.opengroup.org/onlinepubs/009695399/utilities/set.html)\n\n#### Basic example\n\n    set -a; . file.env; set +a;\n\n## Configuration\n\n### Environment variables\n\n| variables       | default | description                                                          |\n|-----------------|---------|----------------------------------------------------------------------|\n| DOT_EXPORT_PATH |  `./`   | The base path of the environment files that are passed as arguments. |\n\n#### Required variables file\n\nThese variables must be provided a value in the current process or an error will be thrown.\n\nList the required variable names:\n\n`\u003cDOT_EXPORT_PATH\u003e/require.env`\n\n    ENV_VAR\n\n#### Default variables file\n\nThe values for these variables are baked into the application but can be easily overwritten.\n\nList the variable key/value pairs:\n\n`\u003cDOT_EXPORT_PATH\u003e/default.env`\n\n    ENV_VAR=HELLO_WORLD\n\n#### Module variables file\n\nYou can export specific environment variables and make them available as an ES6 JavaScript module called `module.env.js`.\n\n`\u003cDOT_EXPORT_PATH\u003e/module.env.js`\n\n    export default {\"ENV_VAR\": \"HELLO_WORLD\"}\n\nSpecify the module variables that should be exported:\n\n`\u003cDOT_EXPORT_PATH\u003e/module.env`\n\n    ENV_VAR\n\n#### Expected behavior\n\n- Comments are ignored\n- Empty lines are ignored\n\n- Empty values become empty strings\n\n      FOO= -\u003e FOO=\"\"\n\n- Escaped characters are preserved when properly wrapped\n\n      var=\"foo\\sbar\"\n      var=\"{\\'foo\\':\\'bar\\'}\"\n      var='{\\\"foo\\\":\\\"bar\\\"}'\n\n- Newlines are preserved when quoted\n\n      var=\"multi\n      line\n      string?query=abc123\"\n\n      var='multi\n      line\n      string?query=abc123'\n\n- Single-quotes and double-quotes are preserved when properly wrapped\n\n      var='{\"foo\":\"bar\"}' -\u003e var='{\"foo\":\"bar\"}'\n      var=\"{'foo':'bar'}\" -\u003e var=\"{'foo':'bar'}\"\n\n- Whitespace is trimmed from unquoted values\n      \n      var=  foobar   -\u003e var=foobar\n\n- Unescaped nested quotes are removed\n      \n      var='{'foo':'bar'}' -\u003e var={foo:bar}\n      var=\"{\"foo\":\"bar\"}\" -\u003e var={foo:bar}\n\n- The output from command substitution will become the assigned value\n\n      var=\"$(echo 'foobar')\" -\u003e var=\"foobar\"\n\n### Contributing\n\nThe contributing guidelines can be found [here](https://github.com/abbotto/contrib/blob/master/CONTRIBUTING.md).\n\n[Return to top](#dot-export)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabbotto%2Fdot-export","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabbotto%2Fdot-export","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabbotto%2Fdot-export/lists"}