Go from never having used a coding agent to working productively and safely with one. The learner should understand what an agent is and how it differs from a chat assistant. They should choose a tool, set up a protected first project, describe tasks the agent can do well, and follow and verify its work. They should recover from bad changes, manage context, and plan bigger changes. They should also use tests as the definition of done and run everyday workflows (bug fixes, features, writing tests, codebase exploration, scripts, small tools, refactors). Throughout, they should keep secrets and systems safe and keep their own understanding growing instead of outsourcing it.
Environment variables and where secrets live card 4 of 6

Making the key stick, safely

builds on: Terminal basics: where you are and running things
`export WEATHER_API_KEY=<your-key>` sets the variable only for this terminal window and the programs started from it. Open a new tab and the variable is gone. To make it last, copy `.env.example` to a new file named `.env` and fill in your key. This works when the script loads `.env` with a library, and the README usually says so. Then run `cat .gitignore` and check that `.env` is listed. Files starting with `.` are hidden, so plain `ls` skips them. Use `ls -a` to see them.
Terms on this card
.env
A plain text file of `NAME=value` lines, usually in the project root, that a library or tool loads into environment variables.
.env.example
A shareable copy of `.env` that lists the variable names with empty or dummy values, so others know what to fill in.
.gitignore
A text file listing file names git should ignore, so they are never recorded or uploaded.
export
A command in macOS/Linux terminals that sets an environment variable for that terminal window and the programs started from it.
ls -a
Lists all files in the current folder, including hidden ones whose names start with a dot.
Learn this step by step on Bytewise
Lesson goal: Explain how API keys and passwords usually reach a program: environment variables, `.env` files and config files. Explain why these files must stay out of git and out of anything you share. · the whole lesson