GrayBeard AI Collective

Meeting #7 Pre-Work

Your first agent from three text files

Wednesday Aug 26, 7pm Central, Discord Meetups voice channel. Join the Discord

Do this before the meeting. About ten minutes. No paid subscription needed.

The stack: a free Google AI Studio key + pi (an open-source terminal coding agent) + three markdown files you create with one prompt. The agent writes the files itself. The second time you open it, it remembers.

Step 1. Get a free Gemini API key

  1. Go to aistudio.google.com and sign in with any Google account.
  2. Click Get API key (left sidebar), then Create API key. Pick "Create in new project" if asked.
  3. Copy the key (starts with AIza...).

Security: Your API key is a password. Do not paste it into chat, share it in screenshots, or commit it to git.

Privacy: The free tier may be used by Google to improve their products. Do not paste anything confidential into tonight's session.

No credit card required. Free tier is rate-limited (roughly 10 requests per minute, 250 per day on Flash models) which is plenty for the session.

Step 2. Install Node.js, then pi

pi installs with npm, which comes bundled with Node.js.

Windows (PowerShell)

  1. Install Node.js LTS from nodejs.org (the installer, defaults are fine). Close and reopen PowerShell.
  2. npm install -g --ignore-scripts @earendil-works/pi-coding-agent
  3. pi --version should print a version number.

Mac (Terminal)

  1. Install Node.js LTS from nodejs.org (or brew install node if you have Homebrew).
  2. npm install -g --ignore-scripts @earendil-works/pi-coding-agent
  3. pi --version

Linux (terminal)

  1. Node.js 20+ from your package manager, or nvm, or nodejs.org.
  2. npm install -g --ignore-scripts @earendil-works/pi-coding-agent
  3. pi --version

If npm install -g complains about permissions on Mac or Linux, use nvm instead of the system Node. Do not sudo it.

Step 3. Give pi your key

pi reads the key from an environment variable named GEMINI_API_KEY.

Windows (PowerShell), permanent

setx GEMINI_API_KEY "AIza...your key..."

Close and reopen PowerShell after running setx. It only affects new windows.

Mac (zsh)

echo 'export GEMINI_API_KEY="AIza...your key..."' >> ~/.zshrc && source ~/.zshrc

Linux (bash)

echo 'export GEMINI_API_KEY="AIza...your key..."' >> ~/.bashrc && source ~/.bashrc

Test it (all platforms)

pi --model google/gemini-flash-latest -p "Reply with the single word: ready"

You should see ready. If you see 401 or 403, the key is not set in this terminal window. If you see a model error, try google/gemini-2.5-flash or google/gemini-3.5-flash instead.

The bootstrap prompt

At the meeting, make a folder, open pi in it, and paste this. It creates the three files that become your agent's memory.

You are setting up a personal assistant that lives in this folder and remembers things between sessions. Do the setup now by creating three files in the current directory. Do not ask questions first; use sensible placeholders in [brackets] where you need information from me, and I will fill them in after.

1. AGENTS.md: your standing instructions. Include these sections: "Who I am" (name, role, one-sentence context, all placeholders), "What you help me with" (3 placeholder bullets), "How I like to work" (be direct, say when you don't know, one question at a time), and "Start of every session" with exactly these steps: read memory.md and mention anything relevant, read tasks.md and flag anything urgent, then ask what I want to work on.

2. memory.md: a file you keep for yourself. Sections: "Always know" (3 placeholder lines about me) and "Notes" (empty, with a one-line comment that you add dated entries here at the end of useful sessions).

3. tasks.md: sections "Active" and "Done", each with one placeholder checkbox item using "- [ ]" syntax.

Keep every file under 40 lines, plain markdown, no emoji. When the files are written, print a short list of what you created and the 3 placeholders I most need to fill in, then stop.

Troubleshooting

SymptomCauseFix
pi: command not foundnpm global bin not on PATH, or terminal opened before installReopen terminal; on Windows reopen PowerShell after Node install
401 / 403 / "API key not valid"GEMINI_API_KEY not set in this windowWindows: reopen PowerShell after setx. Mac/Linux: echo $GEMINI_API_KEY should print the key
Model "not found" / 404Model id retired or not on their accountUse google/gemini-flash-latest; pi accepts ids it doesn't list (prints a warning, still works)
429 / rate limitedFree tier: ~10 req/minWait a minute. Don't spam-retry
Bootstrap "hangs"First call on Flash can take 30-60s with thinking onWait. If nothing after 2 min, Ctrl+C and paste again
Files not createdpi started in a different foldercd my-agent first; pi writes in the current directory
Second session doesn't rememberpi started outside the folderAGENTS.md is loaded from the current directory and its parents only
Join the Discord

Questions before the meeting? Drop them in #general.

Back to GrayBeard AI Collective