CLI Configuration (Terminal Engines)
- Set API Key: Set your Gemini API key inside your terminal environment (e.g., add
export GEMINI_API_KEY="your-key"to your shell profile). - Verify Installation: Run the verification command in your shell to ensure the terminal agent responds:
agy --version - Open Codebase: Open the cloned repository inside your choice of professional editor (such as VS Code or Cursor).
Command-Line Prompting & Context
In the Pro Track, we bypass graphical chat panels. Instead, we command the agent directly using shell flags. This teaches kids how commands chain together and targets precise files.
1. Context Engineering (Piping Target Files)
Always specify the exact files the agent needs to read. This keeps context clean and prevents the model from hallucinating code structures:
agy prompt "Inspect the typescript interface in packages/shared/src/contracts/index.ts and output the definition of TimesTableContentItem."
2. Direct File Modifying
Use the edit action and provide file targets to perform code replacements:
agy edit --file apps/web/public/data/times-table-content.json "Add a custom question contentId times-custom-1 with payload details"
3. Reviewing Git Diffs
Once execution is complete, the CLI shows a visual code difference (diff) directly in the console:
- Green lines (+) represent code the agent intends to insert.
- Red lines (-) represent code the agent intends to delete.
Review the diff for syntax correctness, then type Y to write the change to disk, or N to reject it.
Git Version Control (The Code Time Machine)
Every professional software team tracks files using **Git**. We will teach teenagers how to save and publish their code changes.
[Edit Code] --> [git add .] --> [git commit -m] --> [git push] --> [GitHub Repo]
The 4-Step Git Quest:
- git status: View current file changes.
git status - git add .: Stage all file changes for compression.
git add . - git commit -m: Label and lock the stage with a descriptional message.
git commit -m "feat: added custom space trivia questions in knowledge.json" - git push: Push your locked commit up to your GitHub repository branch.
git push origin main
Cooperative Assignments
Assignment 1: Error Piping
Introduce a type error into `play-scene.ts` (e.g., feed a string to a function expecting a number). Run the build command and pipe the console errors straight to the agent:
pnpm build | agy "Explain this compile failure and output a diff to fix the source file."
Goal: Inspect the resulting diff, approve it, and confirm the subsequent build completes successfully.
Assignment 2: Feature Branching
Create a fresh branch for your theme modifications:
git checkout -b dino-theme
Edit the files using the CLI, stage/commit the modifications, and push the branch to GitHub. Open a Pull Request (PR) online to review your changes.