This is a cli tool written in Go language for sending requests to LLM services that are compatible with the OpenAI protocol.
main.go: application entry point, just callscmd.Execute()cmd: this package is the CLI entry point, using Cobra: A Commander for modern Go CLI interactions as the frameworkcmd/root.go: the entry point of the application, please read the command-line argument generation section to understand the available parameters.
internal: these are some internal packagesinternal/llm: a wrapper around the OpenAI Go SDK for sending/receiving LLM requests, handling MCP calls, etc. it provide a function namedChatto send requests to LLM servicesinternal/mcps: aggregates multiple MCP services into one for use by large modelsinternal/utils: some utility functions
other directories don't need to care about them.
- Analyze user needs and design the feature
- Review the existing codebase to understand how similar features are implemented
- Implement the feature
- Write tests to ensure the feature works as expected
- Update documentation to reflect the new feature
- Perform code reviews and testing to ensure quality
- use
make localto build a local binary, also use it as check syntax errors - use
go test ./...to run tests - use default
GOCACHEis okay, don't need to set it manually
Follow standard Go 1.20 practices: tabs for indentation, exported identifiers use CamelCase, and packages stay lower*snake for clarity. Run gofmt -w on touched files and goimports if available to keep imports tidy