Commit Graph

46 Commits

Author SHA1 Message Date
f0322a84bd chore(lint): enhance golangci configuration and add security annotations
Some checks failed
CI / Test (push) Successful in 33s
CI / Lint (push) Failing after 17s
CI / Build (push) Successful in 21s
- Expand .golangci.yml with more linters (bodyclose, errcheck, etc.), settings for govet, revive, gocritic, gosec
- Add // nolint:gosec comments for intentional file operations and subprocesses
- Change file write permissions from 0644 to 0600 for better security
- Refactor loops, error handling, and test parallelism with t.Parallel()
- Minor fixes: ignore unused args, use errors.Is, adjust mkdir permissions to 0750
2026-03-04 20:00:32 +00:00
b1d3a445ec feat(prdescribe): add configurable base branch flag
Some checks failed
Auto-complete TODO / move-todo (pull_request) Failing after 1s
CI / Test (pull_request) Successful in 34s
CI / Lint (pull_request) Successful in 24s
CI / Build (pull_request) Successful in 20s
Release / Create Release (push) Successful in 35s
Introduce a new --base flag (default: "master") to specify the base branch for diff comparison in the PR describe command. Update logic to use this base in git diff commands and fallback to origin/base. Adjust no-changes message accordingly. Add tests for custom base and default behavior.
2026-03-04 18:11:28 +00:00
Gregory Gauthier
cc6a2f642f feat(cmd): add query command for one-shot technical questions
- Implement new `query` command in cmd/query.go for non-interactive Grok queries focused on programming
- Add wordy flag for detailed responses
- Update root.go to include queryCmd
- Set default model for query in config.go
- Add .grok/settings.json with fast model configuration
2026-03-04 15:39:41 +00:00
5f93b43cd6 refactor(changelog): change version flag shorthand to uppercase V
All checks were successful
CI / Test (push) Successful in 33s
CI / Lint (push) Successful in 27s
CI / Build (push) Successful in 21s
Release / Create Release (push) Successful in 37s
Update the shorthand from "v" to "V" in the changelog command and adjust the corresponding test assertion.
2026-03-03 22:27:49 +00:00
ce5367c3a7 feat(cmd): add changelog command for AI-generated release notes
Some checks failed
CI / Test (push) Failing after 27s
CI / Lint (push) Has been skipped
CI / Build (push) Has been skipped
- Implement `grokkit changelog` command with flags for version, since, stdout, and commit reminder
- Add git helpers for latest/previous tags and formatted log since ref
- Include tests for message building and full changelog construction
2026-03-03 21:59:09 +00:00
f33e27cfbf refactor(safety): replace file backups with Git-based change management
All checks were successful
CI / Test (push) Successful in 33s
CI / Lint (push) Successful in 25s
CI / Build (push) Successful in 20s
Update safety features to leverage Git for version control and rollbacks instead of creating .bak files. This includes:
- Removing backup mentions from README.md, cmd/lint.go, ARCHITECTURE.md, and TROUBLESHOOTING.md
- Adding detailed Git workflow for managing changes in README.md
- Updating troubleshooting guide with Git rollback instructions
- Modifying feature lists and safety descriptions to emphasize Git integration
2026-03-03 20:49:27 +00:00
81fd65b14d refactor(cmd): remove automatic .bak backup creation
All checks were successful
CI / Test (push) Successful in 35s
CI / Lint (push) Successful in 25s
CI / Build (push) Successful in 19s
Eliminate .bak file backups from edit, docs, lint, testgen, and agent commands to simplify safety features, relying on previews and confirmations instead. Update README, architecture docs, troubleshooting, and TODOs to reflect changes. Adjust tests to remove backup assertions.
2026-03-03 20:44:39 +00:00
7881ac2446 refactor(testgen): enforce stricter rules in Go test prompt
All checks were successful
CI / Test (push) Successful in 27s
CI / Lint (push) Successful in 19s
CI / Build (push) Successful in 14s
Release / Create Release (push) Successful in 1m58s
Update the test generation prompt for Go to prohibit monkey-patching, global variable reassignments, and reflect tricks. Mandate use of only idiomatic Go with real function calls, table-driven tests, and simple happy/error path coverage. Simplify unit and live test structures for better production readiness.
2026-03-03 19:25:33 +00:00
fd9fbee655 refactor(testgen): enhance debugging for empty responses and refine Go test prompt
Some checks failed
CI / Test (push) Successful in 29s
CI / Lint (push) Failing after 7s
CI / Build (push) Failing after 6s
- Add user-facing message showing the selected model
- Implement detailed error logging when AI response is empty, including raw preview
- Update Go test generation prompt for better naming, rules against monkey-patching, and simplicity
2026-03-03 18:58:40 +00:00
b76aa6f800 refactor(testgen): generalize Go test generation prompt
All checks were successful
CI / Test (push) Successful in 28s
CI / Lint (push) Successful in 19s
CI / Build (push) Successful in 15s
- Remove Grokkit-specific references to make the prompt more versatile.
- Update unit and live test patterns for broader applicability, including standard testing.T usage.
- Adjust test name derivation and skip messages for consistency.
- Sync test assertions in testgen_test.go with the updated prompt.
2026-03-03 18:27:49 +00:00
b82016028e refactor(testgen): refine Go test prompt to match scaffold style exactly
All checks were successful
CI / Test (push) Successful in 28s
CI / Lint (push) Successful in 18s
CI / Build (push) Successful in 15s
- Updated getTestPrompt for Go to enforce exact test structure: unit with t.Parallel() and logs, optional live with precise skip message.
- Ensured test name derivation, no unused imports, and pure output.
- Added example TestTestgenCmd_Unit and _Live in testgen_test.go to demonstrate the new pattern.
- Minor fixes to Python and C prompts for consistency.
2026-03-03 18:06:13 +00:00
Gregory Gauthier
d1eaa5234b refactor(testgen): update Go prompt to enforce unit + live test pattern
All checks were successful
CI / Test (push) Successful in 28s
CI / Lint (push) Successful in 18s
CI / Build (push) Successful in 15s
- Modify user message to reference new pattern in system prompt
- Revise Go test prompt for exact unit/live structure matching scaffold_test.go
- Update testgen_test.go to match new prompt prefix
2026-03-03 16:52:50 +00:00
Gregory Gauthier
0ef58cb5a4 fix(cmd): use Fprintf for efficiency and handle Chdir error in tests
All checks were successful
CI / Test (push) Successful in 25s
CI / Lint (push) Successful in 37s
CI / Build (push) Successful in 15s
- Replace WriteString + Sprintf with Fprintf in harvestContext for better performance.
- Wrap deferred Chdir in scaffold tests with error logging to avoid silent failures.
2026-03-03 15:50:30 +00:00
Gregory Gauthier
1bcf55dedb test(cmd): add tests for scaffold command
Some checks failed
CI / Test (push) Successful in 58s
CI / Lint (push) Failing after 37s
CI / Build (push) Successful in 32s
Add fast unit test and live integration tests for the scaffold command, including
scenarios for basic usage, flags like --with-tests, --dry-run, and --force.

Remove unused charmbracelet dependencies (bubbles, bubbletea, lipgloss, etc.)
and add testify for assertions. Update go.mod and go.sum accordingly.
2026-03-03 15:24:06 +00:00
Gregory Gauthier
3ea26c403a feat(cmd): add scaffold command for AI-assisted file creation
All checks were successful
CI / Test (push) Successful in 39s
CI / Lint (push) Successful in 27s
CI / Build (push) Successful in 22s
Introduce a new `scaffold` command that uses Grok to generate new files based on a description.
Includes options for generating tests, dry runs, force overwrite, and language override.
Detects language from file extension and harvests project context for better generation.
2026-03-03 14:18:05 +00:00
34789c50a5 test(cmd): improve error handling in completion test writer close
All checks were successful
CI / Test (push) Successful in 33s
CI / Lint (push) Successful in 25s
CI / Build (push) Successful in 20s
Handle potential errors when closing the pipe writer in TestCompletionCmd,
and use a deferred anonymous function to ignore errors in defer.
2026-03-02 22:19:47 +00:00
ebb0cbcf3a test(cmd): add unit tests for completion, root execution, config, errors, and logger
Some checks failed
CI / Test (push) Failing after 26s
CI / Lint (push) Has been skipped
CI / Build (push) Has been skipped
- Add tests for shell completion generation in completion_test.go
- Add tests for root command execution and flags in root_test.go
- Expand config tests for temperature, timeout, and log level getters
- Add APIError unwrap test in errors_test.go
- Add WithContext tests in logger_test.go
- Stage test output artifact in .output.txt
2026-03-02 22:12:54 +00:00
c54bc511c9 feat(testgen): add AI unit test generation command
Some checks failed
CI / Test (push) Failing after 27s
CI / Lint (push) Has been skipped
CI / Build (push) Has been skipped
- Implement `grokkit testgen` for Go/Python/C/C++ files
- Add language-specific prompts and test file conventions
- Include backups, previews, auto-apply flag
- Update README with docs and examples
- Add unit tests for helper functions
- Mark todo as completed
2026-03-02 21:57:33 +00:00
918ccc01c8 refactor(tests): improve error handling and defer usage
All checks were successful
CI / Test (push) Successful in 31s
CI / Lint (push) Successful in 25s
CI / Build (push) Successful in 22s
Release / Create Release (push) Successful in 36s
- Add error checking for os.Setenv and io operations in test files
- Use anonymous functions in defer to ignore errors from os.Remove, os.Setenv, etc.
- Minor formatting and consistency fixes in tests and client code
2026-03-02 21:33:11 +00:00
99ef10b16b refactor(cmd): extract run funcs and add injectable deps for testability
Some checks failed
CI / Test (push) Successful in 34s
CI / Lint (push) Failing after 19s
CI / Build (push) Successful in 20s
- Introduce newGrokClient and gitRun vars to allow mocking in tests.
- Refactor commit, commitmsg, history, prdescribe, and review cmds into separate run funcs.
- Update docs, lint, and review to use newGrokClient.
- Add comprehensive unit tests in run_test.go covering happy paths, errors, and edge cases.
- Expand grok client tests with SSE server mocks for Stream* methods.
2026-03-02 20:47:16 +00:00
0aa806be70 feat(cmd): add AI documentation generation and command tests
Some checks failed
CI / Test (push) Failing after 25s
CI / Lint (push) Has been skipped
CI / Build (push) Has been skipped
- Implemented `grokkit docs` command for generating language-specific documentation comments (godoc, PEP 257, Doxygen, etc.) with previews, backups, and auto-apply option
- Extracted message builder functions for commit, history, pr-describe, and review commands
- Added comprehensive unit tests for all command message builders (commit_test.go, docs_test.go, history_test.go, lint_test.go, prdescribe_test.go, review_test.go)
- Enforced 70% test coverage threshold in CI workflow
- Added .golangci.yml configuration with linters like govet, errcheck, staticcheck
- Updated Makefile to include -race in tests and add help target
- Updated README.md with new docs command details, workflows, and quality features
- Added .claude/ to .gitignore
- Configured default model for docs command in config.go
2026-03-02 20:13:50 +00:00
Gregory Gauthier
24be047322 feat(config): add per-command model defaults
All checks were successful
CI / Test (push) Successful in 30s
CI / Lint (push) Successful in 25s
CI / Build (push) Successful in 19s
Introduce support for per-command model defaults in config.toml, overriding global default if set. Update GetModel to accept command name and prioritize: flag > command default > global default. Add example config file and adjust all commands to pass their name. Update tests accordingly.
2026-03-02 16:56:56 +00:00
b8482b6fb0 feat(release): add automated release workflow and install script
Some checks failed
CI / Test (push) Successful in 26s
CI / Lint (push) Successful in 20s
CI / Build (push) Successful in 14s
Release / Create Release (push) Failing after 10s
- Embed version info in binaries via ldflags
- Create multi-platform builds, archives, and checksums
- Add Gitea release creation and asset upload in CI
- Introduce GoReleaser config for standardized builds
- Add version command and install script for easy deployment
- Update README with pre-built installation instructions
2026-03-01 23:25:31 +00:00
cdcbd245d7 fix(cmd): add error handling for user input in edit and lint commands
Some checks failed
CI / Test (push) Successful in 27s
CI / Lint (push) Successful in 18s
CI / Build (push) Failing after 33s
- Handle errors from fmt.Scanln in cmd/edit.go and cmd/lint.go to prevent crashes on input failures, providing user feedback and preserving backups.
- Update .gitea/workflows/release.yml to use 'ubuntu-gitea' runner for CI consistency.
2026-03-01 14:14:55 +00:00
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
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
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
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
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