Skip to content

Latest commit

Β 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Β 
Β 

README.md

Tool Usage Example

Demonstrates the agentic loop β€” the LLM autonomously uses tools to complete tasks.

File Operations

# List, read, and analyze files
go run ./cmd/testclient \
  --api-key=$GEMINI_API_KEY \
  --prompt "List the files in this directory and summarize the project structure"

The agent will:

  1. Call list_dir to get directory contents
  2. Call view_file on key files (README, go.mod, etc.)
  3. Return a summary

Create a File

go run ./cmd/testclient \
  --api-key=$GEMINI_API_KEY \
  --prompt "Create a file called hello.go with a simple Hello World program"

Search & Edit

# Search for a pattern and edit files
go run ./cmd/testclient \
  --api-key=$GEMINI_API_KEY \
  --prompt "Find all TODO comments in the Go files and list them"

Shell Commands (must enable explicitly)

go run ./cmd/testclient \
  --api-key=$GEMINI_API_KEY \
  --enable-commands \
  --prompt "Run 'go version' and tell me what Go version is installed"

Note: run_command is disabled by default for safety. Pass --enable-commands to allow the agent to run shell commands.

Multi-Step Agentic Task

go run ./cmd/testclient \
  --api-key=$GEMINI_API_KEY \
  --enable-commands \
  --system "You are a Go developer. Be concise." \
  --prompt "Create a new file called fizzbuzz.go with a FizzBuzz implementation, then run it"

Expected flow:

πŸ”§ write_to_file β†’ fizzbuzz.go
πŸ”§ run_command β†’ go run fizzbuzz.go
πŸ€– "Here's the output of the FizzBuzz program..."

Custom System Instructions

go run ./cmd/testclient \
  --api-key=$GEMINI_API_KEY \
  --system "You are a senior Go developer. Always use idiomatic Go patterns. Prefer table-driven tests." \
  --prompt "Add unit tests for the workspace validator"