A Domain-Specific Language for AI-Powered Automation
AgentScript is a simple, powerful DSL that chains Gemini AI with Google APIs to automate complex workflows in just a few lines of code.
search "AI trends 2026" -> summarize -> translate "Spanish" -> email "[email protected]"
AgentScript turns natural workflows into executable pipelines. Instead of writing hundreds of lines of code to:
- Search the web
- Summarize results with AI
- Generate images
- Create videos
- Send emails
You write one line:
search "topic" -> summarize -> image_generate "visual" -> email "[email protected]"
Google Gemini API Developer Competition
- 34 Commands - Research, documents, multimedia, Google services
- Parallel Execution - Run multiple tasks concurrently
- Pipeline Chaining - Output of one command feeds into the next
- Natural Language Mode - Describe what you want in plain English
- Gemini Integration - Text, images, video, and speech generation
| API | Commands |
|---|---|
| Gemini 2.5 Flash | ask, summarize, analyze, translate |
| Imagen 4 | image_generate |
| Veo 3.1 | video_generate, images_to_video |
| Gemini TTS | text_to_speech |
| Gmail | email |
| Calendar | calendar, meet |
| Drive | drive_save |
| Docs | doc_create |
| Sheets | sheet_create, sheet_append |
| Forms | form_create, form_responses |
| YouTube | youtube_search, youtube_upload, youtube_shorts |
| Tasks | task |
| People | contact_find |
# Install Go 1.22+
brew install go # macOS
# or download from https://go.dev
# Install ffmpeg (for video/audio)
brew install ffmpeg # macOS
sudo apt install ffmpeg # Ubuntu# Clone the repository
git clone https://github.com/vinodhalaharvi/agentscript.git
cd agentscript
# Copy environment template
cp .env.example .env
# Add your API keys to .env
GEMINI_API_KEY=your_gemini_api_key
GOOGLE_CREDENTIALS_FILE=credentials.json
GOOGLE_TOKEN_FILE=token.json- Go to Google Cloud Console
- Create a project and enable APIs:
- Gmail API
- Google Calendar API
- Google Drive API
- Google Docs API
- Google Sheets API
- Google Forms API
- YouTube Data API v3
- Create OAuth 2.0 credentials (Desktop app)
- Download as
credentials.json
# Build
make build
# Run a simple command
make run EXPR='ask "Hello, what can you do?"'
# Run a script file
make run-file FILE=examples/simple-research.as
# Interactive natural language mode
make replcommand "arg" -> command "arg" -> command "arg"
parallel {
search "topic 1" -> summarize
search "topic 2" -> summarize
image_generate "visual"
}
-> merge
-> email "[email protected]"
// This is a comment
search "query" -> summarize
| Command | Description | Example |
|---|---|---|
search "query" |
Web search via Gemini | search "AI news" |
ask "prompt" |
Ask Gemini anything | ask "Explain quantum computing" |
summarize |
Summarize piped content | search "topic" -> summarize |
analyze |
Analyze piped content | read "data.csv" -> analyze |
save "file" |
Save to file | -> save "output.txt" |
read "file" |
Read file contents | read "input.txt" -> summarize |
stdin "prompt" |
Read user input | stdin "Enter topic: " -> search |
translate "lang" |
Translate text | -> translate "Japanese" |
| Command | Description | Example |
|---|---|---|
email "to" |
Send email | -> email "[email protected]" |
calendar "event" |
Create calendar event | -> calendar "Meeting tomorrow 2pm" |
meet "event" |
Create event with Meet link | -> meet "Team sync" |
drive_save "path" |
Save to Google Drive | -> drive_save "reports/q1" |
doc_create "title" |
Create Google Doc | -> doc_create "Report" |
sheet_create "title" |
Create spreadsheet | -> sheet_create "Data" |
sheet_append "id" |
Append to sheet | -> sheet_append "sheet_id" |
task "title" |
Create Google Task | -> task "Follow up" |
contact_find "name" |
Find contact | contact_find "John" |
form_create "title" |
Create Google Form | -> form_create "Survey" |
form_responses "id" |
Get form responses | form_responses "form_id" |
| Command | Description | Example |
|---|---|---|
youtube_search "query" |
Search YouTube | youtube_search "Go tutorials" |
youtube_upload "title" |
Upload video | -> youtube_upload "My Video" |
youtube_shorts "title" |
Upload as Short | -> youtube_shorts "Quick Tip" |
| Command | Description | Example |
|---|---|---|
image_generate "prompt" |
Generate image (Imagen 4) | image_generate "sunset" |
image_analyze "path" |
Analyze image | image_analyze "photo.jpg" |
video_generate "prompt" |
Generate video (Veo 3.1) | video_generate "ocean waves" |
video_analyze "path" |
Analyze video | video_analyze "clip.mp4" |
images_to_video "paths" |
Images to video | -> images_to_video |
text_to_speech "voice" |
Convert text to speech | -> text_to_speech "Kore" |
audio_video_merge "out" |
Merge audio + video | -> audio_video_merge "final.mp4" |
image_audio_merge "out" |
Image + audio to video | -> image_audio_merge "video.mp4" |
| Command | Description | Example |
|---|---|---|
places_search "query" |
Search for places | places_search "cafes Tokyo" |
maps_trip "name" |
Create trip map URL | -> maps_trip "Tokyo Trip" |
| Command | Description | Example |
|---|---|---|
merge |
Merge parallel outputs | parallel { ... } -> merge |
list "path" |
List directory | list "." |
make run EXPR='search "renewable energy 2026" -> summarize -> doc_create "Energy Report" -> email "[email protected]"'make run-file FILE=examples/travel-planner.asparallel {
places_search "attractions Dubrovnik"
places_search "restaurants Dubrovnik"
places_search "hotels Dubrovnik"
}
-> merge
-> ask "Create 5-day itinerary"
-> maps_trip "Dubrovnik Adventure"
-> translate "Croatian"
-> email "[email protected]"
make run-file FILE=examples/news-2min.asparallel {
search "top US news today"
-> ask "Write 2-minute news script"
-> text_to_speech "Charon"
-> save "narration.wav"
image_generate "news studio background" -> save "bg.png"
}
-> merge
-> image_audio_merge "news.mp4"
-> youtube_upload "Daily News Update"
make run EXPR='ask "Write a welcome message" -> translate "Spanish" -> translate "Japanese" -> translate "French" -> save "translations.txt"'make run EXPR='ask "Plan a team offsite agenda" -> form_create "Offsite RSVP" -> calendar "Team Offsite next Friday 9am" -> email "[email protected]"'make run-file FILE=examples/competitor-analysis.asmake repl
> search for latest AI research and summarize the top findings
> create an image of a futuristic city and save it
> translate "hello world" to 5 languagesagentscript/
βββ main.go # Entry point
βββ grammar.go # DSL parser (Participle)
βββ runtime.go # Command execution engine
βββ client.go # Gemini API client
βββ google.go # Google Workspace APIs
βββ github.go # GitHub Pages deployment
βββ translator.go # Natural language to DSL
βββ claude.go # Claude API (optional)
βββ examples/ # Example scripts
β βββ mega-showcase.as # 100-line comprehensive demo
β βββ travel-planner.as # Travel planning workflow
β βββ news-2min.as # 2-minute news video
β βββ youtube-shorts.as # YouTube Shorts creation
β βββ ...
βββ Makefile # Build commands
βββ .env.example # Environment template
βββ README.md # This file
make build # Build binary
make run EXPR='...' # Run inline expression
make run-file FILE=path.as # Run script file
make repl # Interactive mode
make test # Run tests
make clean # Clean build artifactsAvailable voices for text_to_speech:
Kore- Female, warmCharon- Male, deep (great for news)Puck- Male, energeticAoede- Female, calm
ask "Hello world" -> text_to_speech "Kore" -> save "greeting.wav"
# Required
GEMINI_API_KEY=your_gemini_api_key
# For Google Workspace integration
GOOGLE_CREDENTIALS_FILE=credentials.json
GOOGLE_TOKEN_FILE=token.json
# Optional - for GitHub Pages deployment
GITHUB_CLIENT_ID=your_client_id
GITHUB_CLIENT_SECRET=your_client_secret
# Optional - for Claude as alternative LLM
CLAUDE_API_KEY=your_claude_keyexport GEMINI_API_KEY=your_key
# or add to .env filebrew install ffmpeg # macOS
sudo apt install ffmpeg # Ubunturm token.json # Delete old token
make run EXPR='...' # Re-authenticate with new scopes- Use
image_audio_mergeinstead ofimages_to_video - Or wait for daily quota reset
- Or request quota increase in Google Cloud Console
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β AgentScript β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Natural Language βββΊ Translator βββΊ DSL Parser β
β β β β
β βΌ βΌ β
β "summarize AI news" search "AI" -> summarize β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Runtime Engine β
β βββββββββββ βββββββββββ βββββββββββ βββββββββββ β
β β Gemini β β Google β β GitHub β β ffmpeg β β
β β APIs β β APIs β β API β β β β
β βββββββββββ βββββββββββ βββββββββββ βββββββββββ β
β β β β β β
β βΌ βΌ βΌ βΌ β
β Text/Image Gmail/Cal Pages Audio/Video β
β Video/TTS Drive/Docs Deploy Processing β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| Traditional Approach | AgentScript |
|---|---|
| 500+ lines of Python | 5 lines of DSL |
| Multiple API libraries | One unified syntax |
| Complex async handling | Built-in parallelism |
| Manual error handling | Automatic retries |
| Separate scripts | Chainable pipelines |
MIT License - See LICENSE file
Vinod Halaharvi
- GitHub: @vinodhalaharvi
- Email: [email protected]
- Google Gemini API Team
- Anthropic Claude (alternative LLM support)
- Participle Parser Library
Built for the Google Gemini API Developer Competition 2026 π