Demonstrates the agentic loop β the LLM autonomously uses tools to complete tasks.
# 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:
- Call
list_dirto get directory contents - Call
view_fileon key files (README, go.mod, etc.) - Return a summary
go run ./cmd/testclient \
--api-key=$GEMINI_API_KEY \
--prompt "Create a file called hello.go with a simple Hello World program"# 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"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_commandis disabled by default for safety. Pass--enable-commandsto allow the agent to run shell commands.
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..."
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"