You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: skills/dotenv/SKILL.md
+32-52Lines changed: 32 additions & 52 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,12 +5,11 @@ description: Load environment variables from a .env file into process.env for No
5
5
6
6
# dotenv
7
7
8
-
9
8
Dotenv is a zero-dependency module that loads environment variables from a `.env` file into [`process.env`](https://nodejs.org/docs/latest/api/process.html#process_process_env). Storing configuration in the environment separate from code is based on [The Twelve-Factor App](https://12factor.net/config) methodology.
10
9
11
10
[Watch the tutorial](https://www.youtube.com/watch?v=YtkZR0NFd1g)
> Note: Consider using [`dotenvx`](https://github.com/dotenvx/dotenvx) instead of preloading. I am now doing (and recommending) so.
140
159
>
141
-
> It serves the same purpose (you do not need to require and load dotenv), adds better debugging, and works with ANY language, framework, or platform. – [motdotla](https://mot.la)
160
+
> It serves the same purpose (you do not need to require and load dotenv), adds better debugging, and works with ANY language, framework, or platform. – [motdotla](https://not.la)
142
161
143
162
You can use the `--require` (`-r`) [command line option](https://nodejs.org/api/cli.html#-r---require-module) to preload dotenv. By doing this, you do not need to require and load dotenv in your application code.
> Software is changing, and dotenv must change with it—that is why I built [agentic secret storage (AS2)](https://dotenvx.com/as2). Agents run code without humans at terminals, so plaintext `.env` files are the wrong primitive.
328
-
>
329
-
> AS2 is built for autonomous software: encrypted by default, zero console access, and cryptography‑first delivery that keeps operators out of the loop.
330
-
>
331
-
> It is backed by [Vestauth](https://github.com/vestauth/vestauth), the trusted, pioneering auth layer for agents—giving each agent a cryptographic identity so requests are signed with private keys and verified with public keys. No shared secrets to leak.
332
-
>
333
-
> It's what I'm using now. - [motdotla](https://mot.la)
334
-
335
-
### Quickstart
336
-
337
-
Install vestauth and initialize your agent.
338
-
339
-
```bash
340
-
npm i -g vestauth
341
-
342
-
vestauth agent init
343
-
```
344
-
345
-
Your agent `set`s secrets with a simple `curl` endpoint:
346
-
347
-
```bash
348
-
vestauth agent curl -X POST https://as2.dotenvx.com/set -d '{"KEY":"value"}'
349
-
```
350
-
351
-
And your agent `get`s secrets with a simple `curl` endpoint:
<details><summary>How can I prevent committing my `.env` file to a Docker build?</summary><br/>
506
487
507
-
Use the [docker prebuild hook](https://dotenvx.com/docs/features/prebuild).
488
+
Use the [docker prebuild hook](https://dotenvx.com/docs/features/prebuild?utm_source=github&utm_medium=readme&utm_campaign=motdotla-dotenv&utm_content=docs-prebuild).
508
489
509
490
```bash
510
491
# Dockerfile
@@ -578,7 +559,7 @@ Alternatively, just use [dotenv-webpack](https://github.com/mrsteele/dotenv-webp
578
559
579
560
</details>
580
561
581
-
562
+
582
563
583
564
## Docs
584
565
@@ -645,7 +626,6 @@ HELLO=World
645
626
646
627
```sh
647
628
$ node index.js
648
-
[dotenv@17.0.0] injected env (1) from .env
649
629
Hello World
650
630
```
651
631
@@ -763,13 +743,13 @@ Default: `false`
763
743
764
744
Override any environment variables that have already been set.
0 commit comments