CLI
The @philschmid/agent package includes a CLI that lets you send prompts to the agent directly from your terminal — as an argument or via piped stdin.
Installation
Section titled “Installation”Install the package globally to use the agent command:
bun add -g @philschmid/agentnpm install -g @philschmid/agentSet your API key:
export GEMINI_API_KEY="your-api-key"Prompt as argument
Section titled “Prompt as argument”agent "Explain what a closure is in JavaScript"Piped stdin
Section titled “Piped stdin”echo "Summarize this" | agentcat README.md | agent "Explain this file"cat src/index.ts | agent --tools read,grep --system "You are a code reviewer"Options
Section titled “Options”| Flag | Short | Type | Default | Description |
|---|---|---|---|---|
--model | -m | string | gemini-3-flash-preview | Model ID |
--tools | -t | string | All tools | Comma-separated tool names |
--system | -s | string | — | System instruction |
--help | -h | boolean | — | Show usage |
Available tools
Section titled “Available tools”sleep, plan, read, write, grep, bash, web_fetch, web_search, skills, subagent
When --tools is omitted, all tools are loaded. Restrict tools to limit what the agent can do — e.g. --tools read,grep for read-only analysis.
Examples
Section titled “Examples”Code review a file:
cat src/utils.ts | agent --system "Review this code for bugs and suggest improvements"Summarize with a specific model:
cat report.md | agent -m gemini-3-flash-preview "Summarize in 3 bullet points"Read-only analysis (no write/bash access):
agent --tools read,grep "Find all TODO comments in the src/ directory"Next Steps
Section titled “Next Steps” Configuration Environment variables and settings.json
Built-in Tools Available tools reference