How to contribute
1. Fork and clone
2. Environment setup
3. Create a branch
4. Make your changes
- Follow existing code patterns
- Add tests for new features
- Keep commits small and focused
5. Submit the Pull Request
Project structure
The codebase follows a modular architecture with SOLID decomposition. Major monolithic files have been split into focused modules:cli/cli.go(~923 lines) + 7 extracted files (cli_helpers.go,cli_history.go,cli_mode.go,cli_output.go,cli_prompt.go,cli_session.go,cli_tools.go)cli/agent_mode.go(~1498 lines) + 4 extracted filescli/command_handler.go(~185 lines) + 4 extracted filesserver/handler.go(~420 lines) + 3 extracted filescli/context_handler.go(~385 lines) + 3 extracted files
cli/mcp, cli/ctxmgr, and llm/fallback packages.
Building with version information
For builds that inject version, commit, and date:Adding a new LLM provider
- Create a package in
llm/myprovider/ - Implement the
LLMClientinterface (andToolAwareClientif it supports tool use) - Add auto-registration via
init()inllm/registry - Define environment variables in
config/ - Add i18n translations in
i18n/
switch/case blocks.
Creating a plugin
See the full guide at Plugin System.Reporting bugs
Open an issue on GitHub with:- ChatCLI version (
chatcli --version) - Operating system and Go version
- Steps to reproduce
- Expected vs observed behavior
- Relevant logs (use
LOG_LEVEL=debug)