Skip to content

Commit 53fd322

Browse files
idoubiclaude
andcommitted
feat: initial release of codeany - open-source terminal AI agent
Built in Go with Bubble Tea TUI, powered by open-agent-sdk-go. Features: - Interactive REPL with streaming, tool display, markdown rendering - 31 slash commands (/help /model /commit /review /plan /mcp /skills ...) - Skills system (.codeany/skills/) - Plugin system (.codeany/plugins/) - MCP server management - Permission system with disk persistence - CLAUDE.md + CODEANY.md + rules/ support - Memory system - Session management - Pipe mode (-p) with JSON/text/stream output - Chinese/IME input support - Mouse wheel + keyboard scrolling - Self-update (codeany update) - GitHub Actions release workflow - One-line install script Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
0 parents  commit 53fd322

24 files changed

Lines changed: 4982 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
19+
- uses: actions/setup-go@v5
20+
with:
21+
go-version: "1.23"
22+
23+
- name: Build binaries
24+
run: |
25+
mkdir -p dist
26+
VERSION="${GITHUB_REF_NAME}"
27+
COMMIT="${GITHUB_SHA}"
28+
DATE="$(date -u +%Y-%m-%dT%H:%M:%SZ)"
29+
LDFLAGS="-s -w -X github.com/codeany-ai/codeany/internal/version.Version=${VERSION} -X github.com/codeany-ai/codeany/internal/version.Commit=${COMMIT} -X github.com/codeany-ai/codeany/internal/version.Date=${DATE}"
30+
31+
for pair in darwin/arm64 darwin/amd64 linux/arm64 linux/amd64 windows/arm64 windows/amd64; do
32+
GOOS="${pair%/*}" GOARCH="${pair#*/}" CGO_ENABLED=0 \
33+
go build -ldflags "${LDFLAGS}" \
34+
-o "dist/codeany_${pair%/*}_${pair#*/}/codeany$( [ "${pair%/*}" = windows ] && echo .exe )" \
35+
./cmd/codeany
36+
done
37+
38+
- name: Package artifacts
39+
run: |
40+
cd dist
41+
for d in codeany_darwin_* codeany_linux_*; do
42+
tar -czf "${d}.tar.gz" -C "$d" codeany
43+
done
44+
for d in codeany_windows_*; do
45+
(cd "$d" && zip -q "../${d}.zip" codeany.exe)
46+
done
47+
48+
- name: Create release
49+
uses: softprops/action-gh-release@v2
50+
with:
51+
generate_release_notes: true
52+
files: |
53+
dist/*.tar.gz
54+
dist/*.zip

.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Binary (only root level)
2+
/codeany
3+
/codeany.exe
4+
/dist/
5+
6+
# OS
7+
.DS_Store
8+
Thumbs.db
9+
10+
# IDE
11+
.idea/
12+
.vscode/
13+
*.swp
14+
*.swo
15+
*~
16+
17+
# Go
18+
vendor/
19+
20+
# Sensitive
21+
.env
22+
*.pem
23+
*.key
24+
credentials.json

Makefile

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo dev)
2+
COMMIT ?= $(shell git rev-parse --short HEAD 2>/dev/null || echo unknown)
3+
DATE ?= $(shell date -u +%Y-%m-%dT%H:%M:%SZ)
4+
LDFLAGS = -s -w \
5+
-X github.com/codeany-ai/codeany/internal/version.Version=$(VERSION) \
6+
-X github.com/codeany-ai/codeany/internal/version.Commit=$(COMMIT) \
7+
-X github.com/codeany-ai/codeany/internal/version.Date=$(DATE)
8+
9+
.PHONY: build install clean dev vet
10+
11+
build:
12+
go build -ldflags "$(LDFLAGS)" -o codeany ./cmd/codeany
13+
14+
install:
15+
go install -ldflags "$(LDFLAGS)" ./cmd/codeany
16+
17+
dev:
18+
go run ./cmd/codeany
19+
20+
vet:
21+
go vet ./...
22+
23+
clean:
24+
rm -f codeany
25+
rm -rf dist
26+
27+
dist:
28+
mkdir -p dist
29+
@for pair in darwin/arm64 darwin/amd64 linux/arm64 linux/amd64 windows/arm64 windows/amd64; do \
30+
os=$${pair%/*}; arch=$${pair#*/}; \
31+
ext=""; [ "$$os" = "windows" ] && ext=".exe"; \
32+
echo "Building $$os/$$arch..."; \
33+
GOOS=$$os GOARCH=$$arch CGO_ENABLED=0 \
34+
go build -ldflags "$(LDFLAGS)" \
35+
-o "dist/codeany_$${os}_$${arch}/codeany$$ext" \
36+
./cmd/codeany; \
37+
done
38+
@cd dist && for d in codeany_darwin_* codeany_linux_*; do \
39+
tar -czf "$${d}.tar.gz" -C "$$d" codeany; \
40+
done
41+
@cd dist && for d in codeany_windows_*; do \
42+
(cd "$$d" && zip -q "../$${d}.zip" codeany.exe); \
43+
done

README.md

Lines changed: 198 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,198 @@
1+
# Codeany
2+
3+
An open-source AI-powered terminal agent for software engineering. Built in Go with [Bubble Tea](https://github.com/charmbracelet/bubbletea) TUI and the [Open Agent SDK](https://github.com/codeany-ai/open-agent-sdk-go).
4+
5+
## Quick Install
6+
7+
```bash
8+
curl -fsSL https://raw.githubusercontent.com/codeany-ai/codeany/main/install.sh | sh
9+
```
10+
11+
Or install from source:
12+
13+
```bash
14+
go install github.com/codeany-ai/codeany/cmd/codeany@latest
15+
```
16+
17+
## Setup
18+
19+
Set your API key:
20+
21+
```bash
22+
export ANTHROPIC_API_KEY="sk-ant-..."
23+
# Or for OpenRouter / custom providers:
24+
export CODEANY_API_KEY="sk-or-..."
25+
export CODEANY_BASE_URL="https://openrouter.ai/api"
26+
export CODEANY_MODEL="anthropic/claude-sonnet-4-5"
27+
```
28+
29+
## Usage
30+
31+
```bash
32+
# Interactive mode
33+
codeany
34+
35+
# With initial prompt
36+
codeany "explain this codebase"
37+
38+
# Pipe mode
39+
echo "what is 2+2" | codeany -p
40+
41+
# Print mode (non-interactive)
42+
codeany --print -y "list files in src/"
43+
44+
# JSON output
45+
echo "hello" | codeany -p -y --output-format json
46+
47+
# Skip permission prompts
48+
codeany -y
49+
50+
# Use specific model
51+
codeany -m opus-4-6
52+
```
53+
54+
## Slash Commands
55+
56+
| Command | Description |
57+
|---------|-------------|
58+
| `/help` | Show all commands |
59+
| `/model [name]` | Switch model |
60+
| `/fast` | Toggle faster model |
61+
| `/cost` | Show token usage and cost |
62+
| `/clear` | Clear conversation |
63+
| `/compact [hint]` | Compact conversation |
64+
| `/plan [task]` | Plan mode / plan a task |
65+
| `/commit [msg]` | Git commit helper |
66+
| `/review [target]` | Code review |
67+
| `/diff` | Show git diff summary |
68+
| `/bug <desc>` | Investigate a bug |
69+
| `/test [target]` | Run tests |
70+
| `/init` | Initialize project (create CODEANY.md) |
71+
| `/doctor` | Environment diagnostics |
72+
| `/mcp` | Manage MCP servers |
73+
| `/skills` | List available skills |
74+
| `/plugin` | List installed plugins |
75+
| `/hooks` | Show configured hooks |
76+
| `/context` | Show all context sources |
77+
| `/session` | Session details |
78+
| `/files` | Files accessed this session |
79+
| `/resume` | List recent sessions |
80+
| `/export` | Export conversation |
81+
| `/config` | Show configuration |
82+
| `/permissions` | Permission mode |
83+
| `/status` | Session status |
84+
| `/quit` | Exit |
85+
86+
## Keyboard Shortcuts
87+
88+
| Key | Action |
89+
|-----|--------|
90+
| `Enter` | Send message |
91+
| `Shift+Enter` | New line |
92+
| `Ctrl+C` | Cancel / Exit |
93+
| `Ctrl+D` | Exit (empty input) |
94+
| `Ctrl+L` | Clear conversation |
95+
| `Ctrl+O` | Toggle expand tool output |
96+
| `Up/Down` | Input history |
97+
| `PgUp/PgDown` | Scroll messages |
98+
| `Tab` | Complete slash command |
99+
| `Esc` | Clear input / close menu |
100+
| `! cmd` | Run shell command |
101+
102+
## Configuration
103+
104+
Config directory: `~/.codeany/`
105+
106+
```
107+
~/.codeany/
108+
├── settings.json # Main config (model, permissions, MCP, hooks)
109+
├── config.yaml # YAML config (alternative)
110+
├── permissions.json # Persisted permission rules
111+
├── memory/ # Memory files
112+
├── sessions/ # Session history
113+
├── skills/ # User skills
114+
│ └── my-skill/
115+
│ └── SKILL.md
116+
└── plugins/ # Plugins
117+
└── my-plugin/
118+
├── plugin.json
119+
└── skills/
120+
```
121+
122+
### settings.json
123+
124+
```json
125+
{
126+
"model": "sonnet-4-6",
127+
"permissionMode": "default",
128+
"maxTurns": 100,
129+
"mcpServers": {
130+
"filesystem": {
131+
"type": "stdio",
132+
"command": "npx",
133+
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"]
134+
}
135+
},
136+
"hooks": {
137+
"preToolUse": [],
138+
"postToolUse": []
139+
}
140+
}
141+
```
142+
143+
## Project Configuration
144+
145+
Create `CODEANY.md` (or `CLAUDE.md`) in your project root:
146+
147+
```markdown
148+
# Project Instructions
149+
150+
## Commands
151+
- `npm test` to run tests
152+
- `npm run build` to build
153+
154+
## Code Style
155+
- Use TypeScript strict mode
156+
- Prefer functional components
157+
```
158+
159+
Also supports:
160+
- `CODEANY.local.md` / `CLAUDE.local.md` — personal, gitignored
161+
- `.codeany/rules/*.md` / `.claude/rules/*.md` — modular rules
162+
163+
## Skills
164+
165+
Create custom skills in `.codeany/skills/<name>/SKILL.md`:
166+
167+
```markdown
168+
---
169+
name: deploy
170+
description: Deploy to production
171+
argumentHint: <environment>
172+
---
173+
174+
Deploy the application to $ARGUMENTS environment.
175+
Run the deployment script and verify health checks.
176+
```
177+
178+
Invoke with: `/deploy staging`
179+
180+
## MCP Servers
181+
182+
Configure MCP servers in `settings.json` or manage with `/mcp`:
183+
184+
```bash
185+
/mcp # List servers
186+
/mcp tools # List available tools
187+
/mcp reconnect X # Reconnect server
188+
```
189+
190+
## Update
191+
192+
```bash
193+
codeany update
194+
```
195+
196+
## License
197+
198+
MIT

cmd/codeany/main.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package main
2+
3+
import (
4+
"fmt"
5+
"os"
6+
7+
"github.com/codeany-ai/codeany/internal/cli"
8+
"github.com/codeany-ai/codeany/internal/version"
9+
)
10+
11+
func main() {
12+
// Set version from ldflags
13+
cli.SetVersion(version.Version, version.Commit, version.Date)
14+
15+
if err := cli.Execute(); err != nil {
16+
fmt.Fprintf(os.Stderr, "Error: %v\n", err)
17+
os.Exit(1)
18+
}
19+
}

go.mod

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
module github.com/codeany-ai/codeany
2+
3+
go 1.23.0
4+
5+
require (
6+
github.com/charmbracelet/bubbles v0.21.0
7+
github.com/charmbracelet/bubbletea v1.3.5
8+
github.com/charmbracelet/glamour v0.9.1
9+
github.com/charmbracelet/lipgloss v1.1.0
10+
github.com/codeany-ai/open-agent-sdk-go v0.0.0
11+
github.com/muesli/reflow v0.3.0
12+
github.com/spf13/cobra v1.9.1
13+
gopkg.in/yaml.v3 v3.0.1
14+
)
15+
16+
require (
17+
github.com/alecthomas/chroma/v2 v2.14.0 // indirect
18+
github.com/atotto/clipboard v0.1.4 // indirect
19+
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
20+
github.com/aymerick/douceur v0.2.0 // indirect
21+
github.com/charmbracelet/colorprofile v0.2.3-0.20250311203215-f60798e515dc // indirect
22+
github.com/charmbracelet/x/ansi v0.8.0 // indirect
23+
github.com/charmbracelet/x/cellbuf v0.0.13-0.20250311204145-2c3ea96c31dd // indirect
24+
github.com/charmbracelet/x/term v0.2.1 // indirect
25+
github.com/dlclark/regexp2 v1.11.0 // indirect
26+
github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect
27+
github.com/google/uuid v1.6.0 // indirect
28+
github.com/gorilla/css v1.0.1 // indirect
29+
github.com/inconshreveable/mousetrap v1.1.0 // indirect
30+
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
31+
github.com/mattn/go-isatty v0.0.20 // indirect
32+
github.com/mattn/go-localereader v0.0.1 // indirect
33+
github.com/mattn/go-runewidth v0.0.16 // indirect
34+
github.com/microcosm-cc/bluemonday v1.0.27 // indirect
35+
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect
36+
github.com/muesli/cancelreader v0.2.2 // indirect
37+
github.com/muesli/termenv v0.16.0 // indirect
38+
github.com/rivo/uniseg v0.4.7 // indirect
39+
github.com/spf13/pflag v1.0.6 // indirect
40+
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
41+
github.com/yuin/goldmark v1.7.8 // indirect
42+
github.com/yuin/goldmark-emoji v1.0.5 // indirect
43+
golang.org/x/net v0.33.0 // indirect
44+
golang.org/x/sync v0.13.0 // indirect
45+
golang.org/x/sys v0.32.0 // indirect
46+
golang.org/x/term v0.30.0 // indirect
47+
golang.org/x/text v0.23.0 // indirect
48+
)
49+
50+
replace github.com/codeany-ai/open-agent-sdk-go => ../open-agent-sdk-go

0 commit comments

Comments
 (0)