Skip to main content
adk run executes a TypeScript script with the ADK runtime fully initialized. Your script can use all of your agent’s primitives, integrations, and runtime utilities like client, actions, bot, and user.

Basic usage

Writing a script

Your script exports a function that the runner calls:
The runner looks for exports in this order:
  1. export default function
  2. export function run
  3. export function main
  4. Top-level code (runs on import)

Arguments

Extra arguments after the script path are passed to your function. Positional arguments pass through directly; put flag-like arguments (anything starting with -) after a -- separator so Commander doesn’t try to parse them:

Production mode

By default, scripts run against your dev bot. Use --prod to run against the production bot:

Use cases

  • Seed data into tables for development or testing
  • Run migrations to update table schemas or transform data
  • Generate reports by querying tables and knowledge bases
  • Maintenance tasks like cleaning up old data or re-indexing
  • Test actions by calling them directly outside a conversation
Last modified on April 27, 2026