| theme | seriph | ||||||
|---|---|---|---|---|---|---|---|
| background | https://images.unsplash.com/photo-1451187580459-43490279c0fa?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80 | ||||||
| addons |
|
||||||
| class | text-center | ||||||
| highlighter | shiki | ||||||
| lineNumbers | true | ||||||
| info | ## Agentic Coding with Antigravity CLI By Kenneth Kousen Learn more at [KouseniT](https://kousenit.com) | ||||||
| drawings |
|
||||||
| transition | slide-left | ||||||
| title | Agentic Coding with Antigravity CLI | ||||||
| mdc | true | ||||||
| slidev |
|
||||||
| css | unocss |
Press Space for next page
Ken Kousen Kousen IT, Inc.
- ken.kousen@kousenit.com
- http://www.kousenit.com
- http://kousenit.org (blog)
- Social Media:
- @kenkousen (twitter)
- @kenkousen@foojay.social (mastodon)
- @kousenit.com (bluesky)
- Tales from the jar side (free newsletter)
- Duration: 5 hours of hands-on learning
- Format: Instructor-led with multiple labs
- Hands-on Labs: Real codebases in Python, JavaScript, Java
- Prerequisites: Command-line experience, development background
- Foundation: Installation, CLI basics, authentication
- Core Skills: File operations, shell integration, context management
- Customization: AGENTS.md, custom commands, settings.json
- Safety: Sandbox mode, permission rules, checkpointing
- Advanced: MCP integration, skills/plugins, session management
- Initial 1.0.0 release of the Antigravity CLI — a Go-based terminal agent
- Multi-model sessions: Gemini, Claude, and GPT-OSS via
/model(1.0.5) modelssubcommand +--modelflag to pick a model at launch (1.0.5)/permissionscommand to manage tool permission rules in-CLI (1.0.5)- G1 credits with
/credits,/usage,/quotawhen quota runs out (1.0.3) - MCP via
urlinmcp_config.json; parallel server init (1.0.5/1.0.6) - SQLite conversation format +
/resume,--continue,--conversation(1.0.4) - Plugin discovery for skills and subagents (1.0.1)
- Latest stable track: Antigravity CLI
1.0.6
- Google's Go-based AI coding agent for the terminal (binary:
agy) - Multi-model: Gemini 3.x, Claude Sonnet/Opus 4.6, GPT-OSS — switch with
/model - Built-in tools: web search, file ops, shell, web fetch
- Model Context Protocol (MCP) support via
mcp_config.json - Shares config with the Antigravity 2.0 desktop app (
/export)
- Model choice: mix Gemini, Claude, and GPT-OSS in one tool
- Google Search Grounding: real-time web access
- Free tier + G1 credits: keep working when quota runs out
- Desktop continuity: shares conversations with Antigravity 2.0
- MCP Native: built-in Model Context Protocol support
- Gemini 3.1 Pro: high-capability Gemini model for complex coding
- Gemini 3.5 Flash: faster, lower-cost option (Low/Medium/High)
- Claude Sonnet 4.6 / Opus 4.6: Anthropic models (thinking)
- GPT-OSS 120B: open-weights option
- List models:
agy models· Switch:/modelor--model
- Free tier: sign in with a Google account to get started
- G1 credits: kick in automatically when standard quota runs out
- In-CLI panels:
/credits,/usage,/quotafor real-time status - Manage models and preferences via
/settings
📖 Docs: antigravity.google/docs
- macOS / Linux:
curl -fsSL https://antigravity.google/cli/install.sh | bash - Windows (PowerShell):
irm https://antigravity.google/cli/install.ps1 | iex - Installs the
agybinary to~/.local/bin/ - Verify:
agy --version· Update later:agy update
# Install (macOS / Linux)
curl -fsSL https://antigravity.google/cli/install.sh | bash
# Verify installation
agy --version- Google Sign-In (default): launches automatically on first run
- Remote / SSH: shows an authorization URL with a one-time code
- API key (alternative):
export ANTIGRAVITY_API_KEY="your-key" - Credentials persist via OAuth in
~/.gemini/
# First run: sign in with your Google account
agy
# Alternative: API key for scripts / headless use
export ANTIGRAVITY_API_KEY="your-api-key"
agy -p "Summarize this repo"- Interactive REPL:
agy- Start a conversation - One-shot / print:
agy -p "prompt"- Single response - Piped input:
echo "task" | agy -p - Interactive with initial prompt:
agy -i "initial context"
# Interactive mode
agy
# One-shot (print) mode
agy -p "Explain what this codebase does"
# Start interactively with an initial prompt
agy -i "You are a Python expert"layout: image-right image: https://images.unsplash.com/photo-1555949963-ff9fe0c870eb?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80 backgroundSize: cover
- Reference files directly:
@./src/main.js - Reference directories:
@./src/(recursive) - Reference images:
@./screenshot.png - Multiple references in one prompt
# Reference a specific file
agy -p "Explain @./src/app.py"
# Reference multiple files
agy -p "Compare @./old.js and @./new.js"
# Reference a directory
agy -p "Analyze the architecture in @./src/"- Execute shell commands:
!git status - Toggle persistent shell mode:
! - The agent can observe and analyze output
- Combine with AI analysis
# In interactive mode:
> !npm test
# The agent sees the test output
> !git diff
# Ask the agent to analyze the changes
# Toggle persistent shell mode
> !/help- Show available commands and shortcuts/context- View loaded context and token usage/model- Switch the active model mid-session/settings- Open settings and preferences
/agent <task>- Dispatch an asynchronous subagent/permissions- Add/edit/remove tool permission rules/usage- Session, quota, and rate-limit status
/resume- Open the conversation browser/export- Send the session to the Antigravity 2.0 desktop app/credits·/quota- Credit balance and quota panels
# Show what context is loaded and token usage
/context
# Switch the active model
/model
# Manage tool permission rules
/permissions
# Open settings and preferences
/settings# Open the conversation browser
/resume
# Dispatch an async subagent task
/agent refactor the auth module
# Push this session to the desktop app
/exportCtrl+L- Clear screenCtrl+V- Paste text/imagesCtrl+R- Open the Artifact Review panel
Esc- Interrupt the active agent streamCtrl+C- Cancel current operationCtrl+DCtrl+D- Exit Antigravity CLI (press twice)
- File System:
read_file(),write_file(),replace(),glob() - Shell: Execute terminal commands
- Web:
google_web_search(),web_fetch() - Memory:
save_memory()for cross-session recall
# The agent automatically uses appropriate tools
"Search the web for React 19 new features"
# Uses google_web_search()
"Read all Python files in src/"
# Uses glob() and read_file()
"Update the README with the changes we made"
# Uses write_file()layout: image-right image: https://images.unsplash.com/photo-1488590528505-98d2b5aba04b?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80 backgroundSize: cover
- Default: prompt for approval on each tool call
/permissions: add, edit, or remove allow/deny rules in-CLIproceed-in-sandbox: auto-approve commands that stay in the sandbox--dangerously-skip-permissions: auto-approve everything (use with care)
# Default - interactive, prompts per tool call
agy
# Auto-approve all tool calls (use with care)
agy --dangerously-skip-permissions
# Manage allow/deny rules from inside a session
> /permissions- Review proposed changes before they are applied
- Open the Artifact Review panel with
Ctrl+R - Inspect diffs with
/diff(supports commit-hash selection) - Works even while answering pending tool-permission prompts
- Great safety habit when exploring an unfamiliar codebase
# Inspect changes from inside a session
> /diff
# Toggle the Artifact Review panel
Ctrl+R- Isolate file operations away from your host
- Multiple backends depending on your OS
- Prevents accidental system changes
- Perfect for exploring unfamiliar code
# Run in sandbox mode (terminal restrictions enabled)
agy --sandbox
# Combine with a one-shot prompt
agy --sandbox -p "Refactor this entire codebase"--sandbox: run with terminal restrictions enabledproceed-in-sandboxpermission mode: auto-approve commands that stay inside the sandbox, prompt only when one tries to break out- Sandbox isolation is enforced in headless print mode too (
-p) - Pair with
/permissionsrules for durable guardrails
# Interactive, sandboxed
agy --sandbox
# Non-interactive, sandbox still enforced
agy --sandbox -p "Audit @./src for risky calls"- Snapshots: capture state before file modifications
- Shadow storage: kept under
~/.gemini/(not your repo) - Includes: files + conversation + tool call
- Manage checkpoints from the
/contextpanel
# View context and manage checkpoints
> /context# Open the context panel to review checkpoints
/context
# Resume an earlier conversation by ID
agy --conversation <id>
# Continue the most recent conversation
agy -cRecover earlier state and pick up where you left off
layout: image-left image: https://images.unsplash.com/photo-1454165804606-c3d57bc86b40?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80 backgroundSize: cover
- Project memory loaded automatically
- Coding standards and conventions
- Architecture context for the AI
- Persistent instructions across sessions
- Antigravity also recognizes
GEMINI.mdandCLAUDE.md
graph TD
A[~/.gemini/AGENTS.md<br/>Global Rules] --> B[project/AGENTS.md<br/>Project Standards]
B --> C[project/frontend/AGENTS.md<br/>Frontend Conventions]
B --> D[project/backend/AGENTS.md<br/>Backend Patterns]
style A fill:#FFE5CC,stroke:#333,stroke-width:2px,color:#000
style B fill:#CCE5FF,stroke:#333,stroke-width:2px,color:#000
style C fill:#E5CCFF,stroke:#333,stroke-width:2px,color:#000
style D fill:#CCFFE5,stroke:#333,stroke-width:2px,color:#000
More specific files override general ones
# Project: Weather API
## Tech Stack
- Backend: Python Flask
- Database: PostgreSQL
- Testing: pytest
## Coding Standards
- Use type hints for all functions
- Follow PEP 8 style guide
- Write docstrings for public APIs
## Current Focus
Implementing caching layer for API responses- Edit
AGENTS.mddirectly to update project memory /context- view combined context and token usage- Add
includeDirectoriesin settings to load shared context - Restart or reload the session to pick up changes
# Create or edit project memory
$EDITOR AGENTS.md
# See what context is loaded
> /context- Import other files with
@file.mdsyntax - Break large context into components
- Supports relative and absolute paths
# AGENTS.md
## Project Overview
@./docs/architecture.md
## Coding Standards
@./docs/style-guide.md
## API Documentation
@./docs/api-reference.mdlayout: image-right image: https://images.unsplash.com/photo-1558494949-ef010cbdcc31?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80 backgroundSize: cover
- Default values - Built-in defaults
- User settings -
~/.gemini/settings.json - Project settings -
.gemini/settings.json - Environment variables - Including
.envfiles - Command-line arguments - Highest priority
{
"general": {
"preferredEditor": "vscode",
"vimMode": false,
"checkpointing": { "enabled": true }
}
}{
"ui": {
"hideTips": false,
"hideBanner": false
},
"tools": {
"sandbox": false
}
}/permissions: add, edit, or remove allow/deny rules in-CLI- Rules merge across three layers: project, user, and CLI settings
- Shared with the Antigravity desktop app's permission settings
- Keep high-risk tools constrained for teams
# Manage permission rules interactively
> /permissions
# Auto-approve everything (use with care)
agy --dangerously-skip-permissions- respectGitIgnore: Honor .gitignore patterns
- enableRecursiveFileSearch: Recursive completion
- Exclude rules and allowlists live in
rules.json
{
"context": {
"fileFiltering": {
"respectGitIgnore": true,
"enableRecursiveFileSearch": true
}
}
}| Variable | Purpose |
|---|---|
ANTIGRAVITY_API_KEY |
API-key authentication (alternative to sign-in) |
AGY_CLI_DISABLE_LATEX |
Turn off LaTeX math rendering |
AGY_CLI_HIDE_ACCOUNT_INFO |
Hide email and plan tier from the header |
$EDITOR |
External editor for prompts and files |
HTTP_PROXY |
Network proxy |
AGENTS.mdis the documented default context fileGEMINI.mdandCLAUDE.mdare also recognized- Support multiple filenames in priority order
- Include additional directories for shared context
{
"context": {
"fileName": ["AGENTS.md", "GEMINI.md", "CLAUDE.md"],
"includeDirectories": ["~/shared-context"],
"loadMemoryFromIncludeDirectories": true
}
}layout: image-right image: https://images.unsplash.com/photo-1516321318423-f06f85e504b3?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80 backgroundSize: cover
- Standard protocol for AI-to-system connections
- Connect to external tools and services
- Supports local commands, HTTP, and SSE
- OAuth 2.0 for remote authentication
{
"mcpServers": {
"firecrawl": {
"command": "npx",
"args": ["@modelcontextprotocol/server-firecrawl"],
"env": {
"FIRECRAWL_API_KEY": "${FIRECRAWL_API_KEY}"
}
}
}
}{
"mcpServers": {
"postgres": {
"command": "npx",
"args": ["@modelcontextprotocol/server-postgres"],
"env": {
"CONNECTION_STRING": "${DATABASE_URL}"
}
}
}
}Antigravity has no mcp subcommand — edit the config file directly:
# Open the MCP config
$EDITOR ~/.gemini/config/mcp_config.json{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"]
}
}
}Servers initialize in parallel on startup.
Use a url for HTTP/remote MCP servers (added in 1.0.5):
{
"mcpServers": {
"remote-tools": {
"url": "https://mcp.example.com/sse"
}
}
}Toggle servers from the in-CLI settings; changes reload on restart.
- command: Shell command to start server
- args: Command arguments
- env: Environment variables
- cwd: Working directory
- timeout: Startup timeout in ms
- includeTools/excludeTools: Filter available tools
- trust: Bypass tool confirmation for this server
- Firecrawl - Web scraping, search, content extraction
- PostgreSQL - Database queries and schema
- Filesystem - Extended file operations
- Slack - Team communication
- Playwright - Browser automation
📖 Registry: modelcontextprotocol.io/registry
- Install from a marketplace with
plugin@marketplacesyntax - Plugins bundle skills and subagents, discovered automatically
- Import existing Gemini or Claude plugins with
agy plugin import - Plugins install to the shared
~/.gemini/config/directory
# Install, then link a marketplace
agy plugin install my-plugin@my-marketplace
agy plugin link my-marketplace ./target- Dispatch focused tasks to a subagent with
/agent <task> - Subagents run with their own context and interaction timeout
- Bundled and discovered through installed plugins
- Standalone subagent conversations stay separate in
/resume
# Dispatch an async subagent
> /agent write unit tests for @./src/utils.py- Extend Antigravity CLI with plugins (skills + subagents)
- Managed with the
agy pluginsubcommand - Import from Gemini or Claude:
agy plugin import gemini - Installed plugins are scanned for skills and agents automatically
# List installed plugins
agy plugin list
# Install / enable / disable
agy plugin install my-plugin@marketplace
agy plugin enable my-plugin
agy plugin disable my-plugin- Package reusable expert workflows as skills
- Distributed inside plugins, stored under
~/.gemini/config/skills/ - Surface as slash commands via autocomplete
- Discovered automatically from installed plugins
# Skills arrive with plugins
agy plugin install code-review@marketplace
# Invoke a skill-derived command in-session
> /code-review @./src- Continue: pick up the most recent conversation
- Resume by ID: jump to a specific past conversation
- Browse: open the conversation picker with
/resume - Conversations are stored in SQLite (
.db)
# Continue the most recent conversation
agy -c
# Resume a specific conversation by ID
agy --conversation <id>
# Browse conversations from inside a session
> /resume-p/--print: run a single prompt and print the response--print-timeout: bound how long print mode waits (default 5m)- Sandbox isolation is enforced in print mode too
- Pipe input from other commands for scripting
# One-shot print mode
agy -p "List all TODO comments in @./src"
# Piped input
cat error.log | agy -p "Diagnose this stack trace"- Antigravity 2.0 desktop app: shares config and conversations
/export: push a CLI session into the desktop app- Shared permissions: rules carry across CLI and desktop
- External editor: set
$EDITORfor prompt and file editing
# Push this session to the desktop app
> /exportlayout: image-left image: https://images.unsplash.com/photo-1498050108023-c5249f4df085?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80 backgroundSize: cover
- Understand unfamiliar codebases
- Trace dependencies and data flow
- Find patterns and conventions
- Generate architecture documentation
agy -p "Analyze the architecture of @./src/ and explain
how the components interact"
agy -p "Trace the flow from the API endpoint to the database
in @./src/controllers/ and @./src/services/"- Generate unit tests for existing code
- Identify edge cases automatically
- Create integration test scaffolding
- Mock setup and fixtures
agy -p "Create comprehensive unit tests for @./src/utils.py
with pytest, including edge cases"
agy -p "Generate integration tests for @./src/api/users.py
with proper mocking"- README files for projects
- API documentation
- Architecture diagrams (Mermaid)
- Code comments and docstrings
agy -p "Generate a comprehensive README.md for this project"
agy -p "Add detailed docstrings to all public functions
in @./src/services/"
agy -p "Create a Mermaid diagram showing the system architecture"- Upgrade legacy code patterns
- Apply modern language features
- Improve code organization
- Fix anti-patterns
agy -p "Refactor @./src/legacy.py to use modern Python 3.12
features like type hints and match statements"
agy -p "Convert this callback-based code to async/await
@./src/api.js"- Analyze error messages and stack traces
- Identify root causes
- Suggest fixes with context
- Test and verify solutions
agy -p "This test is failing with @./tests/output.log.
Analyze the error and fix the issue in @./src/app.py"
agy -p "Debug why the API returns 500 errors.
Check @./src/routes.py and @./src/middleware.py"- Generate commit messages
- Create pull request descriptions
- Analyze diffs and changes
- Resolve merge conflicts
# Analyze staged changes
!git diff --staged
"Generate a conventional commit message for these changes"
# Create PR description
"Create a pull request description summarizing the changes
from the last 5 commits"- Non-interactive
--printmode for pipelines - Capture stdout to a file for parsing
- Exit codes for success/failure
- Automated code reviews
# In CI/CD pipeline
agy -p "Review @./src/ for security issues" > review.txt
# Check exit code
if agy -p "Verify all tests pass"; then
echo "All checks passed"
filayout: image-right image: https://images.unsplash.com/photo-1522071820081-009f0129c71c?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80 backgroundSize: cover
- Designed for teams moving from personal usage to production workflows
- Can be taught live or assigned as follow-up practice
- Focus areas: auth strategy, governance, skills/MCP, CI automation
- Google Sign-In: best default for local interactive usage
- Device-code flow: shows a URL + code for remote/SSH machines
ANTIGRAVITY_API_KEY: scripts and headless automation- G1 credits: keep teams productive past standard quota
# Interactive route: sign in with Google on first run
agy
# API-key route (scripts / headless)
export ANTIGRAVITY_API_KEY="..."
agy -p "Summarize @./src"
# Hide account info from the header (e.g. for screen sharing)
export AGY_CLI_HIDE_ACCOUNT_INFO=1
agy--dangerously-skip-permissionsis a per-session escape hatch/permissionsrules provide durable guardrails across users/projects- Keep high-risk tools constrained in team settings
- Prefer explicit allow/deny patterns over ad-hoc approvals
- Antigravity tracks trusted folders (
trustedFolders.json) - Folder trust impacts settings, skills, and context loading
- Treat untrusted repos with
--sandboxand stricter rules - Combine with
/permissionsfor auditable guardrails
- Skills package repeatable expert workflows for teams
- MCP connects external systems (docs, data, browsers, APIs)
- Distribute skills and subagents together inside plugins
- Use
includeTools/excludeToolsto narrow risky MCP exposure
# Plugin (skills + subagents) lifecycle
agy plugin list
agy plugin disable my-plugin
agy plugin enable my-plugin
# MCP servers: edit config, then restart to reload
$EDITOR ~/.gemini/config/mcp_config.json- Prefer
--printfor non-interactive runs - Use exit codes for pipeline gates
- Keep prompts deterministic and repo-scoped
- Store logs/artifacts for auditability
agy -p "Review @./src/ for security issues" > review.txt
if agy -p "Run checks and report pass/fail"; then
echo "Gate passed"
else
echo "Gate failed" && exit 1
filayout: image-right image: https://images.unsplash.com/photo-1522071820081-009f0129c71c?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80 backgroundSize: cover
- Be specific about what you want to achieve
- Provide context about goals and constraints
- Use file references to ground the conversation
- Iterate for complex tasks
- Include examples when possible
- Start in default mode - Get comfortable first
- Enable checkpointing - Safety net for mistakes
- Review generated code - Don't blindly accept
- Use sandbox for exploratory work
- Commit often - Git is your safety net
- Create a comprehensive AGENTS.md
- Set up project-specific settings.json
- Configure relevant MCP servers
- Create custom commands for common tasks
- Establish team conventions
- Keep it focused - Relevant project info only
- Update regularly - Reflect current state
- Use imports - Modularize large contexts
- Include examples - Show expected patterns
- Document conventions - Style guides, patterns
- Share AGENTS.md in version control
- Standardize settings.json across team
- Create shared custom commands
- Document AI-assisted workflows
- Review AI-generated code together
- Overly broad prompts → Be specific
- Missing context → Use AGENTS.md
- Skipping review → Always verify output
- Skipping permissions → Don't reach for
--dangerously-skip-permissionsearly - Ignoring Artifact Review → Inspect diffs before applying
- Authentication issues: Re-run
agyto sign in, or checkANTIGRAVITY_API_KEY - Rate limits: Check
/quota; G1 credits cover overflow - Tool failures: Verify
mcp_config.jsonand server status - Context not loading: Confirm
AGENTS.mdlocation, reload session - Logs: Override the log path with
--log-file
# Write logs to a known path for troubleshooting
agy --log-file ./agy.log
# Inspect loaded context and token usage
> /contexthttps://antigravity.google/docs
https://github.com/google-antigravity/antigravity-cli
https://modelcontextprotocol.io/registry
https://github.com/kousen/gemini-training
# Interactive mode
agy
# One-shot (print) mode
agy -p "prompt"
# Interactive with initial prompt
agy -i "context"# Run in sandbox mode
agy --sandbox
# Auto-approve all tool calls (use with care)
agy --dangerously-skip-permissions
# Manage permission rules in-session
> /permissions# Continue the most recent conversation
agy -c
# Resume a conversation by ID
agy --conversation <id>
# Browse conversations in-session
> /resume# Print mode for scripting
agy -p "prompt"
# Bound how long print mode waits
agy --print-timeout 2m -p "prompt"
# Write logs to a file
agy --log-file ./agy.log