2026-02-28 19:56:23 +00:00
|
|
|
# Grokkit
|
|
|
|
|
|
2026-03-01 12:57:08 +00:00
|
|
|
Grokkit is a fast Go CLI integrating Grok AI with git workflows and general chat/edit functionality.
|
|
|
|
|
|
2026-03-01 14:26:47 +00:00
|
|
|
|
2026-03-01 12:57:08 +00:00
|
|
|
[]()
|
2026-03-02 18:56:20 +00:00
|
|
|
[]()
|
2026-03-01 12:57:08 +00:00
|
|
|
[]()
|
2026-02-28 19:56:23 +00:00
|
|
|
|
|
|
|
|
## 🚀 Quick Start
|
|
|
|
|
|
|
|
|
|
```bash
|
2026-03-01 12:57:08 +00:00
|
|
|
# Set your API key
|
2026-02-28 19:56:23 +00:00
|
|
|
export XAI_API_KEY=sk-...
|
|
|
|
|
|
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
|
|
|
# Install from source
|
2026-03-02 18:56:20 +00:00
|
|
|
git clone https://repos.gmgauthier.com/gmgauthier/grokkit.git
|
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
|
|
|
cd grokkit
|
|
|
|
|
make install
|
|
|
|
|
|
|
|
|
|
# Or build locally
|
|
|
|
|
make build
|
2026-02-28 19:56:23 +00:00
|
|
|
|
2026-03-01 12:57:08 +00:00
|
|
|
# Verify installation
|
2026-02-28 19:56:23 +00:00
|
|
|
grokkit --help
|
2026-03-01 23:25:31 +00:00
|
|
|
|
|
|
|
|
### From pre-built release (recommended)
|
|
|
|
|
```bash
|
2026-03-02 18:56:20 +00:00
|
|
|
VERSION=0.1.3 # Replace with latest version tag (omit 'v')
|
2026-03-01 23:25:31 +00:00
|
|
|
curl -L https://repos.gmgauthier.com/gmgauthier/grokkit/releases/download/v${VERSION}/grokkit-install.sh | VERSION=${VERSION} bash -
|
|
|
|
|
```
|
|
|
|
|
Verify:
|
|
|
|
|
```bash
|
|
|
|
|
grokkit version
|
2026-02-28 19:56:23 +00:00
|
|
|
```
|
|
|
|
|
|
2026-03-01 12:57:08 +00:00
|
|
|
## 📋 Table of Contents
|
2026-02-28 19:56:23 +00:00
|
|
|
|
2026-03-01 12:57:08 +00:00
|
|
|
- [Commands](#commands)
|
|
|
|
|
- [Configuration](#configuration)
|
|
|
|
|
- [Workflows](#workflows)
|
|
|
|
|
- [Shell Completions](#shell-completions)
|
|
|
|
|
- [Features](#features)
|
|
|
|
|
- [Development](#development)
|
|
|
|
|
- [Documentation](#documentation)
|
|
|
|
|
- [License](#license)
|
2026-03-01 12:35:21 +00:00
|
|
|
|
2026-02-28 19:56:23 +00:00
|
|
|
## Commands
|
|
|
|
|
|
|
|
|
|
### 💬 `grokkit chat`
|
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
|
|
|
Interactive CLI chat with Grok. Features persistent history across sessions.
|
2026-02-28 19:56:23 +00:00
|
|
|
|
2026-03-01 12:57:08 +00:00
|
|
|
```bash
|
|
|
|
|
grokkit chat # Start chat session
|
|
|
|
|
grokkit chat -m grok-beta # Use specific model
|
|
|
|
|
grokkit chat --debug # Enable debug logging
|
2026-02-28 19:56:23 +00:00
|
|
|
```
|
2026-03-01 12:57:08 +00:00
|
|
|
|
|
|
|
|
**Tips:**
|
|
|
|
|
- Type `/quit`, `/q`, or `exit` to exit
|
|
|
|
|
- History is saved automatically between sessions
|
|
|
|
|
- Use `--debug` to see API request timing
|
|
|
|
|
|
|
|
|
|
### ✏️ `grokkit edit FILE "instruction"`
|
|
|
|
|
AI-powered file editing with preview and automatic backups.
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
# Basic usage
|
|
|
|
|
grokkit edit main.go "add error handling to all functions"
|
|
|
|
|
|
|
|
|
|
# Complex refactoring
|
|
|
|
|
grokkit edit server.go "convert this to use context for cancellation"
|
|
|
|
|
|
|
|
|
|
# Add features
|
|
|
|
|
grokkit edit api.go "add rate limiting middleware"
|
|
|
|
|
|
|
|
|
|
# Documentation
|
|
|
|
|
grokkit edit utils.go "add detailed docstrings to all exported functions"
|
2026-02-28 19:56:23 +00:00
|
|
|
```
|
|
|
|
|
|
2026-03-01 12:57:08 +00:00
|
|
|
**Safety features:**
|
|
|
|
|
- Creates `.bak` backup before any changes
|
|
|
|
|
- Shows preview with diff-style output
|
|
|
|
|
- Requires confirmation before applying
|
|
|
|
|
- Uses silent streaming (no console spam)
|
|
|
|
|
|
2026-02-28 19:56:23 +00:00
|
|
|
### 📝 `grokkit commitmsg`
|
2026-03-01 12:57:08 +00:00
|
|
|
Generate conventional commit messages from staged changes.
|
2026-02-28 19:56:23 +00:00
|
|
|
|
2026-03-01 12:57:08 +00:00
|
|
|
```bash
|
2026-02-28 19:56:23 +00:00
|
|
|
git add .
|
2026-03-01 12:57:08 +00:00
|
|
|
grokkit commitmsg # Generate message only
|
|
|
|
|
grokkit commitmsg -m grok-4 # Use specific model
|
2026-02-28 19:56:23 +00:00
|
|
|
```
|
|
|
|
|
|
2026-03-01 12:57:08 +00:00
|
|
|
Output format: `type(scope): subject\n\nbody`
|
|
|
|
|
|
2026-02-28 19:56:23 +00:00
|
|
|
### ✅ `grokkit commit`
|
2026-03-01 12:57:08 +00:00
|
|
|
Generate commit message and commit in one step.
|
2026-02-28 19:56:23 +00:00
|
|
|
|
2026-03-01 12:57:08 +00:00
|
|
|
```bash
|
|
|
|
|
git add .
|
|
|
|
|
grokkit commit # Generate + confirm + commit
|
2026-02-28 19:56:23 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### 🔍 `grokkit review`
|
2026-03-01 12:57:08 +00:00
|
|
|
AI code review of staged or unstaged changes.
|
2026-02-28 19:56:23 +00:00
|
|
|
|
2026-03-01 12:57:08 +00:00
|
|
|
```bash
|
|
|
|
|
# Review staged changes
|
|
|
|
|
git add feature.go
|
|
|
|
|
grokkit review
|
|
|
|
|
|
|
|
|
|
# Review all changes
|
2026-02-28 19:56:23 +00:00
|
|
|
grokkit review
|
2026-03-01 12:57:08 +00:00
|
|
|
|
|
|
|
|
# Get detailed review
|
|
|
|
|
grokkit review --debug # See API timing info
|
2026-02-28 19:56:23 +00:00
|
|
|
```
|
|
|
|
|
|
2026-03-01 12:57:08 +00:00
|
|
|
Output includes:
|
|
|
|
|
- Summary of changes
|
|
|
|
|
- 3-5 actionable improvements
|
|
|
|
|
- Potential bugs or issues
|
|
|
|
|
- Best practice suggestions
|
|
|
|
|
|
2026-02-28 19:56:23 +00:00
|
|
|
### 📋 `grokkit pr-describe`
|
2026-03-01 12:57:08 +00:00
|
|
|
Generate comprehensive PR descriptions.
|
2026-02-28 19:56:23 +00:00
|
|
|
|
2026-03-01 12:57:08 +00:00
|
|
|
```bash
|
|
|
|
|
# From current branch vs main
|
2026-02-28 19:56:23 +00:00
|
|
|
grokkit pr-describe
|
2026-03-01 12:57:08 +00:00
|
|
|
|
|
|
|
|
# With specific model
|
|
|
|
|
grokkit pr-describe -m grok-4
|
2026-02-28 19:56:23 +00:00
|
|
|
```
|
|
|
|
|
|
2026-03-01 12:57:08 +00:00
|
|
|
Output includes:
|
|
|
|
|
- Title suggestion
|
|
|
|
|
- Summary of changes
|
|
|
|
|
- Motivation/context
|
|
|
|
|
- Testing notes
|
|
|
|
|
|
2026-02-28 19:56:23 +00:00
|
|
|
### 📜 `grokkit history`
|
2026-03-01 12:57:08 +00:00
|
|
|
Summarize recent git commits.
|
2026-02-28 19:56:23 +00:00
|
|
|
|
2026-03-01 12:57:08 +00:00
|
|
|
```bash
|
|
|
|
|
grokkit history # Last 10 commits
|
2026-02-28 19:56:23 +00:00
|
|
|
```
|
2026-03-01 12:57:08 +00:00
|
|
|
|
|
|
|
|
### 🤖 `grokkit agent`
|
|
|
|
|
Multi-file agent for complex refactoring (experimental).
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
grokkit agent "refactor authentication to use JWT"
|
2026-02-28 19:56:23 +00:00
|
|
|
```
|
|
|
|
|
|
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
|
|
|
### 🔧 `grokkit lint FILE`
|
|
|
|
|
Automatically detect language, run linter, and apply AI-suggested fixes.
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
# Just check for issues (no fixes)
|
|
|
|
|
grokkit lint main.go --dry-run
|
|
|
|
|
|
|
|
|
|
# Interactive fix (preview + confirmation)
|
|
|
|
|
grokkit lint app.py
|
|
|
|
|
|
|
|
|
|
# Auto-fix without confirmation
|
|
|
|
|
grokkit lint server.js --auto-fix
|
|
|
|
|
|
|
|
|
|
# Use specific model
|
|
|
|
|
grokkit lint script.rb -m grok-4
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
**Supported languages:**
|
|
|
|
|
- **Go** (golangci-lint, go vet)
|
|
|
|
|
- **Python** (pylint, flake8, ruff)
|
|
|
|
|
- **JavaScript/JSX** (eslint)
|
|
|
|
|
- **TypeScript/TSX** (eslint, tsc)
|
|
|
|
|
- **Rust** (clippy)
|
|
|
|
|
- **Ruby** (rubocop)
|
|
|
|
|
- **Java** (checkstyle)
|
|
|
|
|
- **C/C++** (clang-tidy)
|
|
|
|
|
- **Shell** (shellcheck)
|
|
|
|
|
|
|
|
|
|
**Safety features:**
|
|
|
|
|
- Creates `.bak` backup before changes
|
|
|
|
|
- Shows preview of fixes
|
|
|
|
|
- Verifies fixes by re-running linter
|
|
|
|
|
- Requires confirmation (unless `--auto-fix`)
|
|
|
|
|
|
2026-03-01 12:57:08 +00:00
|
|
|
## Configuration
|
|
|
|
|
|
|
|
|
|
### Environment Variables
|
2026-02-28 19:56:23 +00:00
|
|
|
|
2026-03-01 12:57:08 +00:00
|
|
|
```bash
|
|
|
|
|
export XAI_API_KEY=sk-... # Required: Your xAI API key
|
2026-02-28 19:56:23 +00:00
|
|
|
```
|
2026-03-01 12:57:08 +00:00
|
|
|
|
|
|
|
|
### Config File (Optional)
|
|
|
|
|
|
|
|
|
|
Create `~/.config/grokkit/config.toml`:
|
|
|
|
|
|
|
|
|
|
```toml
|
|
|
|
|
default_model = "grok-4"
|
|
|
|
|
temperature = 0.7
|
|
|
|
|
timeout = 60 # API timeout in seconds
|
|
|
|
|
log_level = "info" # debug, info, warn, error
|
|
|
|
|
|
|
|
|
|
[aliases]
|
|
|
|
|
beta = "grok-beta-2"
|
2026-03-02 18:56:20 +00:00
|
|
|
fast = "grok-4-1-fast-non-reasoning"
|
2026-03-01 12:57:08 +00:00
|
|
|
|
|
|
|
|
[chat]
|
|
|
|
|
history_file = "~/.config/grokkit/chat_history.json"
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
**See also:** [docs/CONFIGURATION.md](docs/CONFIGURATION.md) for advanced configuration options.
|
|
|
|
|
|
|
|
|
|
### Logging
|
|
|
|
|
|
|
|
|
|
Logs are written to `~/.config/grokkit/grokkit.log` in JSON format.
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
# View logs in real-time
|
|
|
|
|
tail -f ~/.config/grokkit/grokkit.log
|
|
|
|
|
|
|
|
|
|
# Find errors
|
|
|
|
|
cat ~/.config/grokkit/grokkit.log | jq 'select(.level=="ERROR")'
|
|
|
|
|
|
|
|
|
|
# Track API performance
|
|
|
|
|
cat ~/.config/grokkit/grokkit.log | jq 'select(.msg=="API request completed") | {model, duration_ms, response_length}'
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Workflows
|
|
|
|
|
|
|
|
|
|
### Git Workflow Integration
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
# 1. Make changes
|
|
|
|
|
vim src/api.go
|
|
|
|
|
|
|
|
|
|
# 2. Review with AI
|
|
|
|
|
git add src/api.go
|
|
|
|
|
grokkit review
|
|
|
|
|
|
|
|
|
|
# 3. Fix issues, then commit
|
|
|
|
|
git add src/api.go
|
|
|
|
|
grokkit commit
|
|
|
|
|
|
|
|
|
|
# 4. Generate PR description
|
|
|
|
|
grokkit pr-describe
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### Code Refactoring Workflow
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
# 1. Chat to plan approach
|
|
|
|
|
grokkit chat
|
|
|
|
|
> "How should I refactor this authentication code to use middleware?"
|
|
|
|
|
|
|
|
|
|
# 2. Apply changes with edit
|
|
|
|
|
grokkit edit auth.go "implement middleware pattern as discussed"
|
|
|
|
|
|
|
|
|
|
# 3. Review changes
|
|
|
|
|
grokkit review
|
|
|
|
|
|
|
|
|
|
# 4. Commit
|
|
|
|
|
grokkit commit
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### Debugging Workflow
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
# 1. Describe issue in chat
|
|
|
|
|
grokkit chat --debug
|
|
|
|
|
> "I'm getting a nil pointer error in handler.go:42"
|
|
|
|
|
|
|
|
|
|
# 2. Apply suggested fixes
|
|
|
|
|
grokkit edit handler.go "add nil checks before dereferencing user object"
|
|
|
|
|
|
|
|
|
|
# 3. Verify and commit
|
|
|
|
|
grokkit review
|
|
|
|
|
grokkit commit
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### Batch File Editing
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
# Edit multiple files with consistent changes
|
|
|
|
|
for file in src/*.go; do
|
|
|
|
|
grokkit edit "$file" "add context parameter to all exported functions"
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
# Review all changes together
|
|
|
|
|
grokkit review
|
2026-02-28 19:56:23 +00:00
|
|
|
```
|
|
|
|
|
|
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
|
|
|
### Code Quality Workflow
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
# 1. Check a file for linting issues
|
|
|
|
|
grokkit lint app.py --dry-run
|
|
|
|
|
|
|
|
|
|
# 2. Apply AI-suggested fixes with preview
|
|
|
|
|
grokkit lint app.py
|
|
|
|
|
|
|
|
|
|
# 3. Auto-fix multiple files
|
|
|
|
|
for file in src/*.js; do
|
|
|
|
|
grokkit lint "$file" --auto-fix
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
# 4. Review and commit
|
|
|
|
|
grokkit review
|
|
|
|
|
grokkit commit
|
|
|
|
|
```
|
|
|
|
|
|
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
|
|
|
## Shell Completions
|
|
|
|
|
|
2026-03-01 12:57:08 +00:00
|
|
|
Generate shell completions for faster command entry:
|
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
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
# Bash
|
2026-03-01 12:57:08 +00:00
|
|
|
grokkit completion bash | sudo tee /etc/bash_completion.d/grokkit
|
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
|
|
|
|
2026-03-01 12:57:08 +00:00
|
|
|
# Zsh (oh-my-zsh)
|
|
|
|
|
grokkit completion zsh > ~/.oh-my-zsh/completions/_grokkit
|
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
|
|
|
|
|
|
|
|
# Fish
|
|
|
|
|
grokkit completion fish > ~/.config/fish/completions/grokkit.fish
|
|
|
|
|
|
|
|
|
|
# PowerShell
|
2026-03-01 12:57:08 +00:00
|
|
|
grokkit completion powershell | Out-String | Invoke-Expression
|
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
|
|
|
```
|
|
|
|
|
|
2026-02-28 19:56:23 +00:00
|
|
|
## Flags
|
|
|
|
|
|
2026-03-01 12:57:08 +00:00
|
|
|
### Global Flags (work with all commands)
|
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
|
|
|
|
2026-03-01 12:57:08 +00:00
|
|
|
| Flag | Short | Description |
|
|
|
|
|
|------|-------|-------------|
|
|
|
|
|
| `--model` | `-m` | Override model (e.g., grok-4, grok-beta) |
|
|
|
|
|
| `--debug` | | Enable debug logging (stderr + file) |
|
|
|
|
|
| `--verbose` | `-v` | Enable verbose logging |
|
|
|
|
|
| `--help` | `-h` | Show help |
|
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
|
|
|
|
2026-03-01 12:57:08 +00:00
|
|
|
### Examples
|
2026-03-01 12:35:21 +00:00
|
|
|
|
|
|
|
|
```bash
|
2026-03-01 12:57:08 +00:00
|
|
|
# Use different model
|
|
|
|
|
grokkit chat -m grok-beta
|
2026-03-01 12:35:21 +00:00
|
|
|
|
2026-03-01 12:57:08 +00:00
|
|
|
# Debug API issues
|
|
|
|
|
grokkit edit main.go "refactor" --debug
|
2026-03-01 12:35:21 +00:00
|
|
|
|
2026-03-01 12:57:08 +00:00
|
|
|
# Verbose logging
|
|
|
|
|
grokkit review -v
|
2026-03-01 12:35:21 +00:00
|
|
|
```
|
|
|
|
|
|
2026-03-01 12:57:08 +00:00
|
|
|
## Features
|
|
|
|
|
|
|
|
|
|
### Core Features
|
|
|
|
|
- ✅ **Structured logging with slog** - JSON logs with request tracing, timing, and context
|
|
|
|
|
- ✅ **Context-aware HTTP requests** - 60s timeout, proper cancellation
|
|
|
|
|
- ✅ **Comprehensive error handling** - Custom error types with context
|
|
|
|
|
- ✅ **Persistent chat history** - Never lose your conversations
|
|
|
|
|
- ✅ **Configurable parameters** - Temperature, timeout, model selection
|
|
|
|
|
- ✅ **Shell completions** - Bash, Zsh, Fish, PowerShell
|
|
|
|
|
- ✅ **Safe file editing** - Automatic backups, preview, confirmation
|
|
|
|
|
- ✅ **Git workflow integration** - Commit messages, reviews, PR descriptions
|
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
|
|
|
- ✅ **Multi-language linting** - 9 languages supported with AI-powered fixes
|
2026-03-01 12:57:08 +00:00
|
|
|
|
|
|
|
|
### Quality & Testing
|
|
|
|
|
- ✅ **Test coverage 72%** - Comprehensive unit tests
|
|
|
|
|
- ✅ **CI/CD with Gitea Actions** - Automated testing and builds
|
|
|
|
|
- ✅ **Interface-based design** - Testable and maintainable
|
|
|
|
|
- ✅ **Zero external dependencies** - Only stdlib + well-known libs
|
|
|
|
|
|
|
|
|
|
### Observability
|
|
|
|
|
|
2026-03-01 12:35:21 +00:00
|
|
|
**Logged metrics:**
|
|
|
|
|
- API request/response timing and sizes
|
|
|
|
|
- Git command execution and output
|
|
|
|
|
- File operations with size tracking
|
2026-03-01 12:57:08 +00:00
|
|
|
- Error context with full details
|
|
|
|
|
|
|
|
|
|
**Example log entry:**
|
|
|
|
|
```json
|
|
|
|
|
{
|
|
|
|
|
"time": "2026-03-01T10:30:47.890Z",
|
|
|
|
|
"level": "INFO",
|
|
|
|
|
"msg": "API request completed",
|
|
|
|
|
"model": "grok-4",
|
|
|
|
|
"response_length": 1024,
|
|
|
|
|
"chunks_received": 42,
|
|
|
|
|
"duration_ms": 2434,
|
|
|
|
|
"duration": "2.434s"
|
|
|
|
|
}
|
|
|
|
|
```
|
2026-03-01 12:35:21 +00:00
|
|
|
|
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
|
|
|
## Development
|
|
|
|
|
|
|
|
|
|
```bash
|
2026-03-02 18:56:20 +00:00
|
|
|
# All tests pass without XAI_API_KEY (unit tests only)
|
|
|
|
|
|
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
|
|
|
# Run tests
|
|
|
|
|
make test
|
|
|
|
|
|
2026-03-02 18:56:20 +00:00
|
|
|
# Agent-specific tests
|
|
|
|
|
make test-agent
|
|
|
|
|
|
2026-03-01 12:57:08 +00:00
|
|
|
# Run tests with coverage report
|
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
|
|
|
make test-cover
|
2026-03-01 12:57:08 +00:00
|
|
|
open build/coverage.html
|
|
|
|
|
|
2026-03-02 18:56:20 +00:00
|
|
|
# Linting (matches CI)
|
|
|
|
|
make lint
|
|
|
|
|
# Install golangci-lint if needed:
|
|
|
|
|
# go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
|
|
|
|
|
|
2026-03-01 12:57:08 +00:00
|
|
|
# Run specific tests
|
|
|
|
|
go test -run TestEditCommand ./cmd -v
|
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
|
|
|
|
2026-03-01 12:57:08 +00:00
|
|
|
# Build binary
|
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
|
|
|
make build
|
|
|
|
|
|
|
|
|
|
# Install locally
|
|
|
|
|
make install
|
2026-03-01 12:57:08 +00:00
|
|
|
|
|
|
|
|
# Clean build artifacts
|
|
|
|
|
make clean
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### Project Structure
|
|
|
|
|
|
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
|
|
|
```
|
2026-03-01 12:57:08 +00:00
|
|
|
grokkit/
|
2026-03-02 18:56:20 +00:00
|
|
|
├── cmd/ # CLI commands (Cobra)
|
|
|
|
|
├── config/ # Viper configuration
|
|
|
|
|
├── docs/ # Documentation
|
2026-03-02 19:03:27 +00:00
|
|
|
├── todo/ # TODO tracking: queued/ (pending) and completed/ (historical record)
|
|
|
|
|
│ ├── queued/ # Pending TODO items
|
|
|
|
|
│ └── completed/ # Completed TODO items with history
|
2026-03-01 12:57:08 +00:00
|
|
|
├── internal/
|
|
|
|
|
│ ├── errors/ # Custom error types
|
2026-03-02 18:56:20 +00:00
|
|
|
│ ├── git/ # Git operations
|
|
|
|
|
│ ├── grok/ # xAI Grok API client
|
|
|
|
|
│ ├── linter/ # Multi-language linting
|
|
|
|
|
│ ├── logger/ # Structured slog logging
|
|
|
|
|
│ └── version/ # Build/version info
|
|
|
|
|
├── main.go # Application entrypoint
|
|
|
|
|
├── go.mod # Dependencies
|
|
|
|
|
├── Makefile # Build automation
|
|
|
|
|
└── scripts/ # Install scripts
|
2026-03-01 12:57:08 +00:00
|
|
|
```
|
|
|
|
|
|
2026-03-02 19:18:20 +00:00
|
|
|
### TODO Workflow
|
|
|
|
|
|
|
|
|
|
**Policy:**
|
|
|
|
|
From now on, the only thing to be committed directly to the `master` branch will be to-do items (.md files in `todo/queued/`).
|
|
|
|
|
|
|
|
|
|
**Process:**
|
|
|
|
|
1. When deciding to work on a to-do item: create a branch, implement on the branch, submit PR to `master`.
|
|
|
|
|
2. After PR merge: move the item to `todo/completed/`.
|
|
|
|
|
|
|
|
|
|
**Example workflow:**
|
|
|
|
|
```bash
|
|
|
|
|
git checkout -b feature/some-todo
|
|
|
|
|
# Implement changes, test with make test lint
|
|
|
|
|
git add .
|
|
|
|
|
git commit -m "feat: implement some-todo"
|
|
|
|
|
git push -u origin feature/some-todo
|
|
|
|
|
# Create and merge PR to master
|
|
|
|
|
|
|
|
|
|
# Post-merge:
|
|
|
|
|
git checkout master
|
|
|
|
|
git pull
|
|
|
|
|
mv "todo/queued/SOME_TODO.md" "todo/completed/SOME_TODO.md"
|
|
|
|
|
git add todo/
|
|
|
|
|
git commit -m "chore: complete some-todo"
|
|
|
|
|
git push origin master
|
|
|
|
|
```
|
|
|
|
|
|
2026-03-01 12:57:08 +00:00
|
|
|
## Documentation
|
|
|
|
|
|
|
|
|
|
- 📖 [Troubleshooting Guide](docs/TROUBLESHOOTING.md) - Common issues and solutions
|
|
|
|
|
- 🏗️ [Architecture Overview](docs/ARCHITECTURE.md) - System design and patterns
|
|
|
|
|
- ⚙️ [Configuration Guide](docs/CONFIGURATION.md) - Advanced configuration options
|
|
|
|
|
|
|
|
|
|
## API Usage & Costs
|
|
|
|
|
|
|
|
|
|
Grokkit uses the xAI Grok API. Be aware:
|
|
|
|
|
- API calls consume credits/tokens
|
|
|
|
|
- Default timeout: 60 seconds
|
|
|
|
|
- Streaming reduces perceived latency
|
|
|
|
|
- Consider using model aliases for different use cases (fast/expensive)
|
|
|
|
|
|
|
|
|
|
## Requirements
|
|
|
|
|
|
2026-03-02 18:56:20 +00:00
|
|
|
- Go 1.24.2 (for building)
|
2026-03-01 12:57:08 +00:00
|
|
|
- Git (for git-related commands)
|
|
|
|
|
- XAI API key
|
|
|
|
|
|
|
|
|
|
## Troubleshooting
|
|
|
|
|
|
|
|
|
|
**Common issues:**
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
# API key not set
|
|
|
|
|
Error: XAI_API_KEY environment variable not set
|
|
|
|
|
→ Solution: export XAI_API_KEY=sk-your-key
|
|
|
|
|
|
|
|
|
|
# Request timeout
|
|
|
|
|
Error: Request failed: context deadline exceeded
|
|
|
|
|
→ Solution: Increase timeout in config.toml or check network
|
|
|
|
|
|
|
|
|
|
# Permission denied on log file
|
|
|
|
|
→ Solution: chmod 644 ~/.config/grokkit/grokkit.log
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
**See [docs/TROUBLESHOOTING.md](docs/TROUBLESHOOTING.md) for more details.**
|
2026-02-28 19:56:23 +00:00
|
|
|
|
|
|
|
|
## License
|
|
|
|
|
|
2026-03-01 12:57:08 +00:00
|
|
|
[Unlicense](https://unlicense.org/) - Free for any use, no attribution required.
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
**Made with ❤️ using Grok AI**
|