Before the session
Prepare your laptop: the terminal, folders, and your practice files
In this lesson you get your laptop ready for the workshop: an open terminal, a practice folder with three files and, if you want, OpenCode installed ahead of time. It takes about 10 to 15 minutes.
There are two paths, and both lead to the same result:
- Option A: terminal only. You copy one block, paste it, and you're done. It's the fastest.
- Option B: with Visual Studio Code. You create the files in an editor where you can see them. It's the most comfortable if you've never used a terminal.
Before you choose, five ideas you'll use throughout the session.
Five ideas before you start
1. What a terminal is (and what a shell is)
You normally use your computer with the mouse: you click folders, drag files, open programs. The terminal is another way to do the same things: a window where you type instructions instead of clicking.
Inside the terminal there's a program that reads what you type and runs it. That program is called the shell. On Mac the shell is usually zsh, on Linux bash, and on Windows we use PowerShell. Think of them as dialects: the idea is the same, but some words change. That's why below there's one block for Mac/Linux and another for Windows.
Analogy: the window-based interface is like ordering at a restaurant by pointing at pictures on the menu. The terminal is telling the waiter exactly what you want. It's more precise and faster, but you have to know the words.
Why it matters here: OpenCode lives in the terminal. And when the agent "runs a command," it's typing in the terminal just like you.
2. What a command is
A command is a one-line instruction. It almost always has this shape:
mkdir -p ~/agent-workshop
----- -- ----------------
what how on what
to do (option) (argument)You type the line, press Enter, the shell runs it and shows you the result (or nothing, if everything went well and there was nothing to show).
3. Folders, files, and paths
- A file is a document:
expenses.csv,notes.md. - A folder (or directory) is a container for files and other folders.
- A path is a file's address, like a mailing address: it says which folder it's in, inside which other folder. For example,
/Users/ana/agent-workshop/notes.mdreads as "the filenotes.md, insideagent-workshop, insideana, insideUsers."
4. What ~ means (your home folder)
Every user on the computer has their own home folder. That's usually where Documents, Downloads, and Desktop live. Since its full path is long and changes from person to person, shells have a shortcut: ~ (called "tilde").
| You type | It means (example) |
|---|---|
~ | /Users/ana on Mac, /home/ana on Linux |
~/agent-workshop | The agent-workshop folder inside your home folder |
$HOME\agent-workshop | The same in PowerShell: C:\Users\ana\agent-workshop |
5. The folder "where you're standing"
The terminal is always inside a folder, just like a file explorer window. Commands act on that folder unless you name another one. This is key for the workshop: OpenCode works on the folder where you open it, and only on that one. That's why we create a separate practice folder: from there, the agent can't see or touch the rest of your computer.
What you'll have at the end
A folder in your home folder with exactly three files:
~ (your home folder)
|
+-- Documents/
+-- Downloads/
+-- ...
|
+-- agent-workshop/ <-- the practice folder
|
+-- expenses.csv September expenses (sample data)
+-- notes.md your notes, with a budget goal
+-- opencode.json rules for the agent: ask permissionStep 0. Download your terminal: Warp or Visual Studio Code
Your computer already comes with a terminal, and it works. But for the workshop we recommend installing one of these two, before the session. Both are free and work on Mac, Windows, and Linux.
| Warp (recommended) | Visual Studio Code | |
|---|---|---|
| What it is | A modern terminal | A code editor with a terminal inside |
| Why it helps | It's easier to read, you can select and edit what you type like in a word processor, and every command sits in its own block with its output | You see your files in a column on the left and the terminal at the bottom, in the same window |
| Who it's for | If you want a single, simple window for the terminal | If you want to see and open your files while you work |
| Download | warp.dev | code.visualstudio.com |
How to install Warp:
- Go to warp.dev/download. The page detects your system; if it doesn't, choose Mac, Windows, or Linux.
- Install it like any other app. On Mac, drag it into Applications. On Windows, open the installer and follow the steps.
- Open it. It offers to create an account: it's optional, you can skip that step.
- On Windows, check that Warp opens PowerShell: this workshop's Windows blocks are written for PowerShell. If it asks which shell to use, choose PowerShell.
Warp comes with its own AI. We don't use it in this workshop. Type the commands as they are, like in any terminal. The workshop's agent is OpenCode, which runs inside the terminal. If you use Warp's AI and OpenCode's at the same time, you won't know which one did what.
The terminal (Warp, your system's, or VS Code's)
+---------------------------------------------------+
| $ cd ~/agent-workshop |
| $ opencode <-- OpenCode runs here |
| +---------------------------------------------+ |
| | OpenCode: the agent we work with | |
| +---------------------------------------------+ |
+---------------------------------------------------+If you choose VS Code, the full setup is further down, in Option B.
Step 1. Open a terminal
- If you installed Warp: open it, on Mac, Windows, or Linux.
- Mac: open Terminal (search for it with
Cmd + Spaceand type "Terminal"). - Windows: open Terminal or PowerShell from the Start menu.
- Linux: your desktop's terminal (it usually opens with
Ctrl + Alt + T).
Type this and press Enter:
echo holaecho is the simplest command there is: it repeats whatever you type after it. If the terminal answers hola, it's ready and it understood your instruction.
If you prefer Option B, you can do this step later from VS Code's integrated terminal.
Step 2, Option A: create the folder with a single block
We'll create the three files by copying one block and pasting it into the terminal. That way you don't have to fight any text editor, and we all end up with identical files.
On Mac or Linux
Copy this whole block, paste it into the terminal, and press Enter:
mkdir -p ~/agent-workshop && cd ~/agent-workshop
cat > expenses.csv <<'EOF'
date,description,category,amount
2026-09-01,Groceries at the market,food,54.20
2026-09-02,Bus card top-up,transport,20.00
2026-09-03,Coffee with a friend,Food,6.50
2026-09-05,Internet bill,home,35.00
2026-09-07,Movie tickets,fun,18.00
2026-09-09,Groceries at the market,food,61.75
2026-09-12,Taxi home,Transport,12.40
2026-09-14,Electricity bill,home,42.10
2026-09-18,Lunch near the office,food,11.90
2026-09-21,Concert,fun,45.00
2026-09-25,Bus card top-up,transport,20.00
2026-09-28,Groceries at the market,food,58.30
EOF
cat > notes.md <<'EOF'
# Budget notes
- I want to know where my money goes each month.
- My goal for October: spend less than 350 in total.
- I suspect food is the most expensive, but I haven't added it up.
EOF
cat > opencode.json <<'EOF'
{
"$schema": "https://opencode.ai/config.json",
"permission": {
"edit": "ask",
"bash": "ask"
}
}
EOF
lsWhat this block does, line by line
It looks like a lot, but it's just four different commands, repeated.
| Line | What it does | In plain words |
|---|---|---|
mkdir -p ~/agent-workshop | make directory: creates the folder. -p avoids an error if it already exists | "Create the agent-workshop folder in my home folder" |
&& | Joins two commands: runs the second one only if the first one succeeded | "and then" |
cd ~/agent-workshop | change directory: goes into the folder | "Stand inside that folder" |
cat > expenses.csv <<'EOF' | Writes everything that follows into expenses.csv, up to the EOF line | "Everything that follows, until it says EOF, save it in this file" |
| (the data lines) | The file's content, as is | The text that gets saved |
EOF | Marks the end of the content (End Of File) | "This is where it ends" |
ls | list: shows what's in the folder | "What's in here?" |
About cat > file <<'EOF': the > symbol means "send the result to this file" (if it already existed, it replaces it). And <<'EOF' means "the text I'm about to give you starts on the next line and ends when you see EOF alone on a line." The quotes in 'EOF' tell the shell to copy the text exactly as written, without interpreting symbols like $. That matters for opencode.json, which contains a "$schema".
cat > notes.md <<'EOF' <-- "save into notes.md..."
# Budget notes \
|
- I want to know where... | ...all of this, as is...
- My goal for October... |
- I suspect food is... /
EOF <-- "...up to here"On Windows (PowerShell)
Open PowerShell, copy this whole block, paste it, and press Enter:
New-Item -ItemType Directory -Force -Path "$HOME\agent-workshop" | Out-Null
Set-Location "$HOME\agent-workshop"
@'
date,description,category,amount
2026-09-01,Groceries at the market,food,54.20
2026-09-02,Bus card top-up,transport,20.00
2026-09-03,Coffee with a friend,Food,6.50
2026-09-05,Internet bill,home,35.00
2026-09-07,Movie tickets,fun,18.00
2026-09-09,Groceries at the market,food,61.75
2026-09-12,Taxi home,Transport,12.40
2026-09-14,Electricity bill,home,42.10
2026-09-18,Lunch near the office,food,11.90
2026-09-21,Concert,fun,45.00
2026-09-25,Bus card top-up,transport,20.00
2026-09-28,Groceries at the market,food,58.30
'@ | Set-Content -Encoding ascii expenses.csv
@'
# Budget notes
- I want to know where my money goes each month.
- My goal for October: spend less than 350 in total.
- I suspect food is the most expensive, but I haven't added it up.
'@ | Set-Content -Encoding utf8 notes.md
@'
{
"$schema": "https://opencode.ai/config.json",
"permission": {
"edit": "ask",
"bash": "ask"
}
}
'@ | Set-Content -Encoding ascii opencode.json
ls
What the PowerShell block does
It's the same recipe, in the Windows dialect:
| PowerShell | Equivalent to | What it does |
|---|---|---|
New-Item -ItemType Directory -Force -Path "$HOME\agent-workshop" | mkdir -p ~/agent-workshop | Creates the folder. -Force avoids an error if it already exists |
| Out-Null | (nothing) | Hides the confirmation message so it doesn't get in the way |
Set-Location "$HOME\agent-workshop" | cd ~/agent-workshop | Goes into the folder |
@' ... '@ | <<'EOF' ... EOF | A multi-line block of text (a here-string), copied exactly as written |
| Set-Content -Encoding ascii expenses.csv | cat > expenses.csv | Saves that text into the file, replacing it if it existed |
ls | ls | Shows what's in the folder |
The | symbol is called a pipe: it takes what comes out of the command on the left and hands it to the one on the right. Here it takes the block of text and hands it to Set-Content, which writes it into the file. -Encoding says how the characters are stored; notes.md uses utf8 so special characters are kept correctly.
+-------------------+ +---------------------+
| @' | | Set-Content |
| file text | pipe | -Encoding ascii |
| ... | --- | --> | expenses.csv |
| '@ | | (writes it) |
+-------------------+ +---------------------+Check the result
At the end, ls shows what's in the folder. You should see the three files: expenses.csv, notes.md, and opencode.json. The folder lives in your home folder, named agent-workshop.
It's safe to paste the block twice: it just writes the same files again.
Step 2, Option B: with Visual Studio Code
Visual Studio Code (VS Code) is a free code editor. For a first time it has a big advantage: you see your files in a sidebar, and you get a terminal inside the same window. During the session, when the agent creates or changes a file, you'll see it show up right there.
+----------------------------------------------------------------+
| VS Code |
+------------------+---------------------------------------------+
| EXPLORER | expenses.csv |
| | |
| AGENT-WORKSHOP | date,description,category,amount |
| expenses.csv | 2026-09-01,Groceries at the market,... |
| notes.md | ... |
| opencode.json | |
| +---------------------------------------------+
| (here you see | TERMINAL |
| the files the | $ opencode <-- the agent runs here |
| agent creates) | |
+------------------+---------------------------------------------+1. Install VS Code
Download it from code.visualstudio.com, install it with the default options, and open it.
2. Create and open the folder
- Go to File > Open Folder. On Mac the menu may just say Open....
- In the window that opens, go to your home folder (the one with your username).
- Create a new folder named exactly
agent-workshop(the New Folder button) and open it. - If VS Code asks whether you trust the authors of the folder, say yes: the folder is yours.
3. Create the three files
In the left sidebar (the Explorer), hover over the folder name and click the New File icon. Type the exact name and press Enter. Repeat for all three:
expenses.csvnotes.mdopencode.json
Then open each one, paste its content, and save (Cmd + S on Mac, Ctrl + S on Windows and Linux). Each file's content is what appears in the Option A block between the line that says <<'EOF' (or @') and the one that says EOF (or '@). Don't copy those two lines, only what's in between.
4. Open the integrated terminal
Go to Terminal > New Terminal (or press Ctrl + `, the backtick key, usually next to the 1). A terminal opens at the bottom, already standing inside agent-workshop. Type ls and you should see the three files. This is where you'll open OpenCode during the session.
5. Mac only: the code command
Open the Command Palette with Cmd + Shift + P, type Shell Command: Install 'code' command in PATH, and select it. This lets you open VS Code from the terminal by typing code ., and the OpenCode extension for VS Code needs it later. On Windows the installer does this for you.
What about another text editor?
If you prefer TextEdit or Notepad
You can, but every editor has its catch. These steps work:
- TextEdit (Mac): create a new document and, before pasting, go to Format, Make Plain Text (or press Shift + Command + T). Only then does the save menu stop offering RTF or Word. Paste, save with the exact name and, if it asks, choose Use .csv (or .md, or .json) instead of .txt.
- Notepad (Windows): paste the content, go to File, Save As, change the type to All Files (*.*), and type the exact name. If you don't change the type, it saves it as
expenses.csv.txt.
Why this happens: programs don't look at the content to know what a file is, they look at the extension (what comes after the dot). To OpenCode, an expenses.csv.txt is just any text file, not a table of expenses.
What each file is, and why it's there
expenses.csv: September's expenses. CSV stands for comma-separated values: each line is a row and commas separate the columns, like a spreadsheet in plain text. It has something odd on purpose. Don't fix it: it's part of the exercise.notes.md: your notes, with a budget goal..mdis Markdown: plain text where#marks a heading and-a list item.opencode.json: tells the agent to ask your permission before writing a file ("edit": "ask") or running a command ("bash": "ask"). By default OpenCode edits without asking. For a first time we want it to ask, so you see every change before it happens. OpenCode reads this file automatically when you open it in this folder.
Without opencode.json With our opencode.json
--------------------- ----------------------
Agent decides to change a file Agent decides to change a file
| |
v v
Changes it right away Shows you the change and asks
|
+---------+---------+
| |
You accept You reject
| |
it gets written nothing happensStep 3. (Optional) Install OpenCode ahead of time
If you want to save time, install it now with the steps in Part 2: Install OpenCode and connect it to a model, in the Live module's lesson. If something fails, don't worry: we'll sort it out in the first minutes of the session.
Check that you're ready
- A terminal (Warp, my system's, or VS Code's) answered
hola. -
lsinsideagent-workshopshowsexpenses.csv,notes.md, andopencode.json.
What if ls doesn't show the three files?
Most often the block got pasted incomplete. Copy it again in full, from the first line down to ls, and paste it again: repeating it is safe, it replaces the files. If you used VS Code, check that the names didn't end up with a different extension. If it still doesn't work, come as you are: we fix it live in a minute.
Check your understanding
1. What does ~/agent-workshop mean?
The agent-workshop folder inside your home folder. ~ is the shell's shortcut for your home folder, whatever your username is.
2. In cat > notes.md <<'EOF', what role does the EOF line further down play?
It marks where the content ends. Everything between cat > notes.md <<'EOF' and the EOF line is saved into notes.md, as is. In PowerShell, @' and '@ play the same role.
3. Why do you have to open OpenCode inside agent-workshop and not just anywhere?
Because OpenCode works on the folder where you open it: that's where it reads, writes, and runs things. If you open it in another folder, it doesn't see your practice files, and it also doesn't load the opencode.json that tells it to ask permission.
Summary
- The terminal is a window for typed instructions; the shell (zsh, bash, PowerShell) is what runs them.
~is your home folder. - You created the
agent-workshopfolder with the three practice files, using a terminal block (Option A) or VS Code (Option B), and you know what each line does. opencode.jsonmakes the agent ask your permission before changing anything. Next step: get a key from a model provider.