Commit Graph

23 Commits

Author SHA1 Message Date
Gregory Gauthier
79c28da120 feat(chat): add overrides for direct instruction passing in tool calls
Introduce temporary global variables `editInstructionOverride` and `scaffoldDescriptionOverride` to pass instructions from the AI agent directly to the edit and scaffold commands. This avoids interactive prompts and enables seamless tool integration without major refactoring. Resets overrides after execution.
2026-03-04 12:20:20 +00:00
Gregory Gauthier
3e2b8ee7bf refactor(chat): simplify tool call handling by directly setting command args
Update the handleToolCall function to use cmd.SetArgs and Execute for edit, scaffold, testgen, and lint tools, removing the need for custom RunE overrides. This streamlines the execution flow while maintaining functionality.
2026-03-04 12:08:51 +00:00
Gregory Gauthier
d42b5278c1 refactor(chat): integrate tool calls with Cobra command execution
Refactor handleToolCall to set RunE on existing Cobra commands (edit, scaffold, testgen, lint) and execute them for better integration and reuse of CLI logic. Update commit tool to ignore output. Remove unused model parameter and adjust comments for consistency.
2026-03-04 12:05:01 +00:00
Gregory Gauthier
a5fda5bbfd refactor(chat): move tool handling to cmd/chat.go to resolve import cycle
Relocate ToolCall struct and HandleToolCall function from internal/agent/tools.go
to cmd/chat.go, renaming to handleToolCall for package-internal use. This eliminates
the import cycle between cmd and agent packages while preserving agent mode functionality.
2026-03-04 11:59:23 +00:00
Gregory Gauthier
69c5d776e2 feat(agent): implement tool calling in agent mode
Add support for Grok to call tools (edit, scaffold, testgen, lint, commit) via JSON in ```tool blocks.
Introduce HandleToolCall to parse and execute tool requests, integrating with existing commands.
Update system prompt and chat loop to handle tool calls and feed results back.
2026-03-04 11:50:21 +00:00
Gregory Gauthier
875e34669c fix(chat): remove unnecessary nil check in history loading
Simplify the condition for initializing chat history, assuming loadChatHistory always returns a non-nil slice.
2026-03-04 11:19:50 +00:00
Gregory Gauthier
b5e1733952 feat(chat): add chat history persistence
Implement loading and saving of chat history to a JSON file. The history file path is configurable via Viper or defaults to ~/.config/grokkit/chat_history.json. Add functions to load, save, and get the history file path. Remove outdated comment in model selection.
2026-03-04 11:15:54 +00:00
Gregory Gauthier
6eeb919013 refactor(chat): improve chat command with better UI, prompts, and model handling
- Simplify model selection and defaults in config
- Enhance system prompt and history management
- Update CLI output with colors and exit commands
- Remove placeholder tool handling for cleaner agent mode
2026-03-04 11:04:08 +00:00
Gregory Gauthier
87851513f1 refactor(chat): deprecate agent command and integrate into chat with --agent flag
- Add deprecation warning to agent command, redirecting to `grokkit chat --agent`.
- Refactor chat command to support --agent mode with tool calling, custom models, and history management.
- Introduce basic tool call handling placeholder in agent mode.
- Update config defaults for chat and chat-agent models.
2026-03-04 10:49:53 +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
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
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
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
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
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