An open API service indexing awesome lists of open source software.

https://github.com/ginkida/gokin

A powerful CLI tool that brings AI assistance directly to your terminal. Gokin understands your codebase and helps with file operations, code search, shell commands, git workflows, task management, and more - all through natural language.
https://github.com/ginkida/gokin

ai anthropic cli coding-assistant deepseek developer-tools gemini glm golang kimi llm minimax ollama tui

Last synced: 18 days ago
JSON representation

A powerful CLI tool that brings AI assistance directly to your terminal. Gokin understands your codebase and helps with file operations, code search, shell commands, git workflows, task management, and more - all through natural language.

Awesome Lists containing this project

README

          

![Gokin](https://minio.ginkida.dev/minion/github/gokin.jpg)


Release
Stars
Downloads
License
Go Version


Gokin Demo

πŸ€– AI-powered coding assistant for your terminal
Multi-provider β€’ Multi-agent β€’ 100% Open Source


Install β€’
Quick Start β€’
Why Gokin? β€’
Features β€’
Providers β€’
Config β€’
Contribute

---

## ✨ Why Gokin?

Most AI coding tools are closed-source, route your code through third-party servers, and give you zero control over what gets sent to the model. Gokin was built with a different goal: **a fast, secure, zero-telemetry CLI where your code goes directly to the provider you chose β€” and nothing else leaves your machine.**

This matters especially when you work with multiple LLM providers across different jurisdictions (DeepSeek, GLM, Kimi, MiniMax, Gemini, Claude, OpenAI). Gokin ensures that secrets, credentials, and sensitive code are automatically redacted before reaching any model, TLS is enforced on every connection, and no proxy or middleware ever touches your data. You pick the provider β€” Gokin handles the rest.

| Feature | Gokin | Claude Code | Cursor |
|---------|-------|-------------|--------|
| **Price** | Free β†’ Pay-per-use | $20+/month | $20+/month |
| **Providers** | 8 (Gemini, Claude, OpenAI, DeepSeek, GLM, Kimi, MiniMax, Ollama) | 1 (Claude) | Multi |
| **Offline** | βœ… Ollama | ❌ | ❌ |
| **54 Tools** | βœ… | ~30 | ~30 |
| **Multi-agent** | βœ… 5 parallel | Basic | ❌ |
| **Direct API** | βœ… Zero proxies | βœ… | ❌ Routes through Cursor servers |
| **Security** | βœ… TLS 1.2+, secret redaction (24 patterns), sandbox, 3-level permissions | Basic | Basic |
| **Open Source** | βœ… | ❌ | ❌ |
| **Self-hosting** | βœ… | ❌ | ❌ |

**Choose your price tier:**

| Stack | Cost | Best For |
|-------|------|----------|
| **Gokin + Ollama** | πŸ†“ Free | Privacy, offline, no API costs |
| **Gokin + Gemini Flash** | πŸ†“ Free tier | Fast iterations, prototyping |
| **Gokin + DeepSeek** | ~$1/month | Daily coding, best value |
| **Gokin + Kimi** | Pay-per-use | Fast reasoning, 256K context |
| **Gokin + MiniMax** | Pay-per-use | 1M context, strong coding |
| **Gokin + Claude** | Pay-per-use | Complex reasoning |
| **Gokin + OpenAI** | Pay-per-use | Codex models, o3 reasoning |

---

## πŸš€ Installation

### One-liner (recommended)

```bash
curl -fsSL https://raw.githubusercontent.com/ginkida/gokin/main/install.sh | sh
```

### From source

```bash
git clone https://github.com/ginkida/gokin.git
cd gokin
go build -o gokin ./cmd/gokin
./gokin --setup
```

### Requirements

- **Go 1.25+** (build from source)
- **One AI provider** (see [Providers](#providers) below)

---

## ⚑ Quick Start

```bash
# Launch with interactive setup
gokin --setup

# Or set API key and run
export GEMINI_API_KEY="your-key"
gokin
```

**Then just talk naturally:**

```
> Explain how auth works in this project
> Add user registration endpoint with validation
> Run the tests and fix any failures
> Refactor this module to use dependency injection
> Create a PR for these changes
```

---

## 🎯 Key Features

### 🧠 Smart Code Understanding
- **Semantic Search** β€” Find code by meaning, not just keywords
- **Code Graph** β€” Dependency visualization
- **Multi-file Analysis** β€” Understand entire modules

### βš’οΈ 54 Built-in Tools
- **Files**: read, write, edit, diff, batch, copy, move, delete
- **Search**: glob, grep, semantic_search, tree, code_graph
- **Git**: status, commit, diff, branch, log, blame, PR
- **Run**: bash, run_tests, ssh, env
- **Plan**: todo, task, enter_plan_mode, coordinate
- **Memory**: memorize, shared_memory, pin_context

### 🀝 Multi-Agent System
```
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Explore │────▢│ General │────▢│ Bash β”‚
β”‚ (read) β”‚ β”‚ (write) β”‚ β”‚ (execute) β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚ β”‚ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚
[Progress UI]
```
- Up to 5 parallel agents
- Shared memory between agents
- Automatic task decomposition

### πŸ›‘οΈ Safety & Permissions
- **3-level permissions**: Low (auto), Medium (ask once), High (always ask)
- **Sandbox mode** for bash commands
- **Diff preview** before applying changes
- **Undo/Redo** for all file operations
- **Audit logging**

---

## πŸ”’ Security & Privacy

### Zero Proxies β€” Your Code Goes Nowhere Except the LLM

```
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Gokin β”‚ ──TLS──▢ β”‚ Provider API β”‚
β”‚ (local) β”‚ β”‚ (Gemini/Claude/ β”‚
β”‚ β”‚ ◀──TLS── β”‚ DeepSeek/etc.) β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

No middle servers. No Vercel. No telemetry proxies.
Your API key, your code, your conversation β€” direct.
```

Some CLI tools route requests through their own proxy servers (Vercel Edge, custom gateways) for telemetry, analytics, or API key management. **Gokin does none of this.** Every API call goes directly from your machine to the provider's endpoint. You can verify this β€” it's open source.

### Secret Redaction in Terminal Output

LLM tool calls can accidentally expose secrets found in your codebase. Gokin automatically redacts them **before** they reach the model or your terminal:

| Category | Examples |
|----------|----------|
| API keys | `AKIA...`, `ghp_...`, `sk_live_...`, `AIza...` |
| Tokens | Bearer tokens, JWT (`eyJ...`), Slack/Discord tokens |
| Credentials | Database URIs (`postgres://user:pass@...`), Redis, MongoDB |
| Crypto material | PEM private keys, SSH keys |

24 regex patterns, applied to every tool result and audit log. Handles any data type β€” strings, maps, typed slices, structs. Custom patterns supported via API.

### Defense in Depth

| Layer | What it does |
|-------|-------------|
| **TLS 1.2+ enforced** | No weak ciphers, certificate verification always on |
| **Sandbox mode** | Bash runs in isolated namespace (Linux), safe env whitelist (~35 vars) β€” API keys never leak to subprocesses |
| **Command validation** | 50+ blocked patterns: fork bombs, reverse shells, `rm -rf /`, credential theft, env injection |
| **SSH validation** | Host allowlist, loopback blocked, username injection prevention |
| **Path validation** | Symlink resolution, directory traversal blocked, TOCTOU prevention |
| **SSRF protection** | Private IPs, loopback, link-local blocked; all DNS results checked |
| **Audit trail** | Every tool call logged with sanitized args |

### Keys Stay Local

- API keys loaded from env vars or local config (`~/.config/gokin/config.yaml`)
- Keys are **masked** in all UI displays (`sk-12****cdef`)
- Keys are **never** included in conversation history or tool results
- Ollama mode: **zero network calls** β€” fully airgapped

### πŸ’Ύ Memory That Persists
```
> Remember we use PostgreSQL with pgx driver
> What were our database conventions?
```
- Project-specific memories
- Auto-inject relevant context
- Stored locally (your data stays yours)

---

## ☁️ Providers

| Provider | Models | Auth | Notes |
|----------|--------|------|-------|
| **Gemini** | 3.1-pro, 3-flash, 2.5-pro | API key / OAuth | Free tier, native tools |
| **Anthropic** | Opus 4, Sonnet 4.5, Haiku | API key | Best reasoning |
| **OpenAI** | GPT-5.3 Codex, o3, o4-mini | OAuth | Codex models |
| **DeepSeek** | Chat, Reasoner | API key | Best price/quality |
| **Kimi** | K2.5, K2 Thinking Turbo, K2 Turbo | API key | Fast reasoning, 256K context |
| **MiniMax** | M2.5 | API key | 1M context, strong coding |
| **GLM** | GLM-5, GLM-4.7 | API key | Budget option |
| **Ollama** | Any local model | None | 100% offline |

Switch anytime:
```
> /provider gemini
> /model 3-flash
> /provider anthropic
> /model sonnet
> /provider openai
> /oauth-login openai
```

---

## ⌨️ Commands

| Command | Description |
|---------|-------------|
| `/login ` | Set API key |
| `/oauth-login ` | OAuth login (Gemini, OpenAI) |
| `/provider ` | Switch provider |
| `/model ` | Switch model |
| `/plan` | Enter planning mode |
| `/save` / `/load` | Session management |
| `/commit [-m "msg"]` | Git commit |
| `/pr --title "..."` | Create GitHub PR |
| `/undo` | Undo last file change |
| `/theme` | Switch UI theme |
| `/help` | Show all commands |

### Keyboard Shortcuts

| Key | Action |
|-----|--------|
| `Enter` | Send message |
| `Ctrl+C` | Interrupt |
| `Ctrl+P` | Command palette |
| `↑/↓` | History |
| `Tab` | Autocomplete |
| `?` | Show help |

---

## βš™οΈ Configuration

**Location:** `~/.config/gokin/config.yaml`

### Minimal

```yaml
api:
gemini_key: "your-key"
active_provider: "gemini"
model:
name: "gemini-3-flash-preview"
```

### Full Reference

```yaml
api:
gemini_key: ""
anthropic_key: ""
deepseek_key: ""
glm_key: ""
kimi_key: ""
minimax_key: ""
openai_oauth: # OAuth-only provider
access_token: ""
refresh_token: ""
active_provider: "gemini"
ollama_base_url: "http://localhost:11434"
retry:
max_retries: 10
retry_delay: 1s
http_timeout: 120s
stream_idle_timeout: 30s
providers:
anthropic:
http_timeout: 5m
stream_idle_timeout: 120s
deepseek:
http_timeout: 5m
stream_idle_timeout: 120s
minimax:
http_timeout: 5m
stream_idle_timeout: 120s
kimi:
http_timeout: 5m
stream_idle_timeout: 120s

model:
name: "gemini-3-flash-preview"
temperature: 1.0
max_output_tokens: 8192
enable_thinking: false # Anthropic extended thinking

tools:
timeout: 2m
model_round_timeout: 5m
bash:
sandbox: true
allowed_dirs: []

permission:
enabled: true
default_policy: "ask" # allow, ask, deny

plan:
enabled: true
require_approval: true

ui:
theme: "dark" # dark, macos, light
stream_output: true
markdown_rendering: true
```

---

## πŸ—οΈ Architecture

```
gokin/
β”œβ”€β”€ cmd/gokin/ # CLI entry point
β”œβ”€β”€ internal/
β”‚ β”œβ”€β”€ app/ # Orchestrator & message loop
β”‚ β”œβ”€β”€ agent/ # Multi-agent system
β”‚ β”œβ”€β”€ client/ # 8 API providers
β”‚ β”œβ”€β”€ tools/ # 54 built-in tools
β”‚ β”œβ”€β”€ ui/ # Bubble Tea TUI
β”‚ β”œβ”€β”€ config/ # YAML config
β”‚ β”œβ”€β”€ permission/ # 3-level security
β”‚ β”œβ”€β”€ memory/ # Persistent memory
β”‚ β”œβ”€β”€ semantic/ # Embeddings & search
β”‚ └── ...
```

**~120K LOC β€’ 100% Go β€’ Production-ready**

---

## 🀝 Contributing

Contributions welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for:

- Development setup
- Code style guide
- Pull request process

```bash
# Dev setup
git clone https://github.com/ginkida/gokin.git
cd gokin
go mod download
go build -o gokin ./cmd/gokin

# Test
go test -race ./...

# Format
go fmt ./...
go vet ./...
```

---

## πŸ“ License

[MIT](LICENSE) β€” Use freely, modify, distribute.

---

## πŸ™ Acknowledgments

- [Bubble Tea](https://github.com/charmbracelet/bubbletea) β€” TUI framework
- [Gemini API](https://github.com/google/generative-ai-go) β€” Google AI SDK
- [Lipgloss](https://github.com/charmbracelet/lipgloss) β€” Terminal styling

---


Made with ❀️ by developers, for developers