Install OpenCode’s TUI agent, connect a provider, and complete one reviewable after-work Python edit using Plan/Build and /undo.
After work you want an open-source coding agent in the terminal you already use. OpenCode (project: anomalyco/opencode) is an AI coding agent with a terminal UI, plus desktop and IDE options. This guide stays on the TUI path so you can finish one reviewed Python change in a single evening.
Official docs call OpenCode an open source AI coding agent for terminal, desktop, or IDE. In the terminal you install the CLI, connect a model provider, cd into a project, run opencode, optionally /init for an AGENTS.md, then chat. Plan mode (Tab) disables edits so you can agree on a plan before Build mode applies changes. /undo and /redo help when a refactor goes sideways.
You bring your own LLM provider API keys (or OpenCode Zen via /connect). Pick a modern terminal emulator if your default shell UI struggles with TUIs — docs mention options such as WezTerm, Alacritty, Ghostty, and Kitty.
After-work learners who like open source, will paste an API key once, and want agent edits inside a folder of practice .py files. Prefer a hosted IDE agent if you refuse terminal UIs tonight. Prefer OpenCode when you want a local TUI with provider choice and clear plan/build control.
curl -fsSL https://opencode.ai/install | bash. Alternatives include npm install -g opencode-ai, Homebrew tap brew install anomalyco/tap/opencode (recommended over the slower-updating core formula), Scoop/Chocolatey on Windows, Mise, or Docker ghcr.io/anomalyco/opencode. Confirm opencode is on your PATH./connect. New users can select opencode / OpenCode Zen, sign in at opencode.ai/auth, and paste the API key — or pick another provider you already pay for.cd /path/to/practice then opencode./init analyzes the repo and writes AGENTS.md so later sessions share structure context. Fine on night one for a small folder; skip if you only have one file.Create numbers.py:
def mean(values):
return sum(values) / len(values)
if __name__ == "__main__":
print(mean([2, 4, 6]))
In that folder run opencode. Ask (Plan mode first if you want): Add a median for a non-empty list, call it from main after mean, keep under 40 lines.
Approve/build, then:
python numbers.py
If the result is wrong, /undo, tighten the prompt, try again. Quit once mean and median both print — do not start a multi-file rewrite at midnight.
/connect (or equivalent provider config) before debugging “silent” failures.anomalyco/tap/opencode tap for fresher releases./undo. One bad refactor should not force a manual git archaeology session on night one (still use git for real projects)./share exists for team links; only use it when you intend to publish a transcript.OpenCode is fast at proposing code. You still need Python literacy to accept or reject it. Introduction to Python Programming is designed for evening study. Check the course page for the current enrollment window.
Tonight: install, /connect, one small file, one successful python run. Close the TUI on that win.