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 5 of 6

The session, step by step

builds on: Terminal basics: where you are and running things
First the script fails. Then a one-off `export` makes it work in this window (the key is shortened here). Last, you check which files exist and that `.gitignore` excludes `.env`. (On Windows PowerShell, use `$env:WEATHER_API_KEY="…"` instead of `export`.)
$ python weather.py
Error: WEATHER_API_KEY is not set
$ export WEATHER_API_KEY=wk_live_9f2a
$ python weather.py
Berlin: 14°C, light rain
$ ls -a
.  ..  .env.example  .gitignore  weather.py
$ cat .env.example
WEATHER_API_KEY=
$ cat .gitignore
.env
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.
.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.
PowerShell
The standard terminal program on Windows. Its commands differ from macOS/Linux terminals.
script
A small program, usually one file, that you run to do a task, like `report.py`.
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