The terminal is a precise interface to your computer: you choose a working directory, run a program with arguments and environment values, then inspect its output and exit code. Safe backend work depends on knowing exactly where a command runs, what it can change, and what evidence proves success.
Ask four questions: Where am I? What exact target will change? Is the action reversible? What output or exit code proves success? This habit prevents more incidents than memorizing hundreds of commands.
The paths are relative to the directory shown by pwd. Avoid destructive commands with unresolved variables, broad wildcards, or a directory you have not inspected.
Programs write normal output to stdout, diagnostics to stderr, and return an integer exit code. By convention, 0 means success and non-zero means failure.
Pipes send one program's stdout to another. Redirection writes output to a file. Both are powerful, so inspect input and targets first.
Configuration that differs by environment can enter the process through environment variables. Secrets may use a secret manager that injects values as files or variables. Neither approach makes it acceptable to print or commit them.
Create a safe example template:
Keep the real .env ignored. In production, prefer the platform's secret store and short-lived workload identity when available.
AI backends add provider keys, tracing endpoints, model names, budgets, and safety switches. Configuration must be validated at startup, secrets must be redacted, and prompts must not accidentally interpolate the entire environment. Treat logs and model context as data-exfiltration surfaces.
Create the project tree, .gitignore, and .env.example. Deliberately run a command that exits non-zero without changing files, then record its stderr and exit code.
Acceptance criteria: .env would be ignored, the example contains no real secret, and your log distinguishes stdout, stderr, and the exit code.