Commit Graph

80 Commits

Author SHA1 Message Date
ec5c43163b refactor(cmd): improve error handling in commands and tests
Some checks failed
CI / Test (push) Successful in 26s
CI / Lint (push) Failing after 14s
CI / Build (push) Failing after 31s
- Add error checking for filepath.Walk and fmt.Scanln in agent.go
- Ignore MkdirAll error in chat.go, add checks in chat_test.go
- Add Scanln error handling in commit.go
- Capture and exit on completion generation errors in completion.go
- Add WriteFile error checks in edit_test.go
2026-03-01 14:10:24 +00:00
47e7b51d1e ci(workflow): add XAI_API_KEY env to tests and switch lint/build to ubuntu-gitea runner
Some checks failed
CI / Test (push) Successful in 1m3s
CI / Lint (push) Failing after 39s
CI / Build (push) Failing after 33s
- Inject XAI_API_KEY from secrets for test execution.
- Update lint and build jobs to run on ubuntu-gitea instead of ubuntu-latest.
2026-03-01 14:01:13 +00:00
e7eb17c564 chore(ci): change runner to ubuntu-gitea
Some checks failed
CI / Test (push) Failing after 54s
CI / Lint (push) Failing after 5s
CI / Build (push) Failing after 4s
Update the CI workflow to use the ubuntu-gitea runner instead of ubuntu-latest.
2026-03-01 13:40:22 +00:00
4f6e0df698 chore(license): add Unlicense file
Some checks failed
CI / Test (push) Failing after 1m22s
CI / Lint (push) Failing after 24s
CI / Build (push) Failing after 5s
Release the software into the public domain using the Unlicense.
2026-03-01 13:29:14 +00:00
9f1309ba1a feat(lint): add lint command with AI-powered fixes
Introduce new `grokkit lint` command for automatic language detection,
linting, and AI-suggested fixes. Supports 9 languages including Go, Python,
JavaScript, TypeScript, Rust, Ruby, Java, C/C++, and Shell.

- Add cmd/lint.go for command implementation
- Create internal/linter package with detection and execution logic
- Update README.md with usage examples and workflows
- Enhance docs/ARCHITECTURE.md and docs/TROUBLESHOOTING.md
- Add comprehensive tests for linter functionality
2026-03-01 13:21:44 +00:00
cbd779c882 docs: enhance README with badges, TOC, and detailed sections
Add comprehensive documentation files:
- ARCHITECTURE.md: System design overview
- CONFIGURATION.md: Advanced config guide
- TROUBLESHOOTING.md: Common issues and solutions

Update README with:
- Badges for coverage, Go version, license
- Expanded commands, workflows, features sections
- Improved quick start and logging examples
2026-03-01 12:57:08 +00:00
13519438a2 test: add unit tests for chat history, edit helper, and code cleaning
- Introduce tests for chat history file handling, loading/saving, and error cases in cmd/chat_test.go
- Add tests for removeLastModifiedComments in cmd/edit_helper_test.go
- Add comprehensive tests for CleanCodeResponse in internal/grok/cleancode_test.go
- Update Makefile to centralize build artifacts in build/ directory for coverage reports and binary
- Adjust .gitignore to ignore chat_history.json and remove obsolete coverage file entries
2026-03-01 12:44:20 +00:00
8b6449c947 feat(logging): implement structured logging with slog
- Refactor logger package to use Go's slog for JSON-structured logs
- Add configurable log levels (debug, info, warn, error) via config and flags
- Integrate logging across commands, git operations, and API client with metrics like timing and sizes
- Update README with logging documentation and usage examples
- Add global --debug and --verbose flags
- Enhance tests for logger initialization, levels, and structured output
2026-03-01 12:35:21 +00:00
d9ebe20ae4 chore(cmd): remove init function for completion command
This removes the redundant init() that adds the completion command to rootCmd, likely handled elsewhere in the codebase.
2026-03-01 12:25:52 +00:00
e355142c05 feat: add CI/CD workflows, persistent chat, shell completions, and testing
- Add Gitea CI workflow for testing, linting, and building
- Add release workflow for multi-platform builds and GitHub releases
- Implement persistent chat history with JSON storage
- Add shell completion generation for bash, zsh, fish, powershell
- Introduce custom error types and logging system
- Add interfaces for git and AI client for better testability
- Enhance config with temperature and timeout settings
- Add comprehensive unit tests for config, errors, git, grok, and logger
- Update README with installation, features, and development instructions
- Make model flag persistent across commands
- Add context timeouts to API requests
2026-03-01 12:17:22 +00:00
9bd3e1d00e refactor: add error handling and refactor git utilities
- Enhance error checking in all commands using git.Run
- Refactor git helper to return errors properly
- Fix README.md filename typo
- Update .gitignore with additional ignores
- Add fallback for config home dir
- Improve request handling in grok client
2026-03-01 12:08:49 +00:00
f1dc9b457d test(cmd): refactor edit command test to use direct logic
Update TestEditCommand to test the core editing functionality directly
using a Grok client instead of executing the full command. This makes
the test non-interactive and focuses on the editing logic. Also, adjust
the verification to trim whitespace before checking for the comment prefix.
2026-03-01 00:32:55 +00:00
9927b1fb6a chore(build): add Makefile and tests for commands and utilities
- Introduced Makefile with targets for testing (all, coverage, agent-specific), building, installing, cleaning, and help
- Added unit and integration tests for agent command, edit command, and CleanCodeResponse function
- Refactored CleanCodeResponse to use regex for robust markdown fence removal in agent and client modules
- Ensured tests cover code cleaning, plan generation placeholders, and file editing functionality
2026-03-01 00:24:48 +00:00
dc5665cdf8 feat(install): add installation script
Introduce install.sh script to build optimized grokkit binary from Go source, install it to ~/.local/bin, and provide usage instructions for setup and PATH configuration.
2026-02-28 23:13:35 +00:00
28f75965bb refactor(chat): simplify to CLI interface
Replace Bubble Tea TUI with a simple bufio-based CLI loop for chatting.
Add strong system prompt to history for model identity.
Update quitting logic and output formatting with colors.
2026-02-28 23:03:53 +00:00
f540f5fc24 refactor(cmd): remove unnecessary last modified comments and timestamps
- Eliminate header comments with timestamps and ownership from all source files
- Update agent and edit commands to clean such comments and simplify response handling
- Add helper to remove last modified lines in edit command
- Minor formatting and import cleanups across codebase
2026-02-28 22:59:16 +00:00
98eb5505a5 chore(headers): add last modified timestamps to source files
Implemented automatic addition of "// Last modified: [timestamp]" headers across command and internal files for better tracking. Updated prompts in agent and edit commands to enforce header format. Added logic to prepend header if missing in generated content. Fixed minor issues like missing newlines at end of files.
2026-02-28 22:47:30 +00:00
ed614ae0db refactor(agent): refine prompts and code cleaning logic
- Remove unnecessary comments in agent.go for cleaner code
- Update system prompt to enforce exact header comment format
- Adjust progress logging format
- Fix CleanCodeResponse to properly strip markdown fences
- Update StreamSilent comment to include agent usage
2026-02-28 22:40:31 +00:00
8e0d06d8a1 feat(cmd): add agent command for multi-file AI editing
Introduce new `agent` command that scans .go files in the project, generates an AI-driven plan for changes based on user instruction, and applies edits with previews and backups. Includes integration with Grok client for planning and content generation.

Update existing files with timestamp comments as part of the agent's editing demonstration. Add agentCmd to root command.
2026-02-28 22:29:16 +00:00
363733c2e6 feat(chat): add interactive TUI with Bubble Tea and streaming
- Replace basic CLI chat with Bubble Tea-based TUI featuring viewport, textarea, colored history, and streaming replies.
- Add StreamSilent method to client for TUI integration without live printing.
- Introduce model flag for chat command.
- Update dependencies to include charmbracelet libraries.
2026-02-28 21:53:35 +00:00
349346eb4e refactor(config): centralize config loading and add model selection
- Introduce config.Load() to handle centralized configuration loading in TOML format
- Add --model flag support across commands with alias resolution via GetModel
- Update root command to load config in PersistentPreRun
- Remove redundant config init and set defaults for model and temperature
2026-02-28 20:52:03 +00:00
5112f13fdd refactor(edit): improve response handling and add diff preview
- Strengthen system prompt to enforce pure content output
- Introduce CleanCodeResponse to strip markdown fences from Grok responses
- Display proposed file changes as a unified diff for better preview
- Clean up .gitignore and add ignores for logs/tmp files
- Delete built binary grokkit file
2026-02-28 20:31:02 +00:00
56360808d7 chore: add grokkit and backup files to gitignore
Update .gitignore to ignore the 'grokkit' directory and all '.bak' files.
2026-02-28 20:20:38 +00:00
f0858e08c1 refactor(cli): simplify commands and remove TUI dependencies
- Switch chat command from Bubble Tea TUI to basic CLI with bufio.
- Hardcode Grok model in commands, remove Viper config.
- Stream responses directly in client, remove channel-based streaming.
- Add safe previews/backups in edit, simplify prompts across tools.
- Update git helper and trim unused deps in go.mod.
2026-02-28 20:17:12 +00:00
917bab2adc pretty up the client interface 2026-02-28 19:56:23 +00:00
4498f6fdf9 initial client and helper skeletons 2026-02-28 18:41:20 +00:00
e5c2fae925 stub out commands and get help working 2026-02-28 18:28:27 +00:00
59b47fd533 stub out project 2026-02-28 18:03:12 +00:00
1f571aac4d fix gitignore 2026-02-28 17:50:39 +00:00
7e163e8631 initial commit 2026-02-28 17:50:05 +00:00