{"id":50642358,"url":"https://github.com/rcarmo/gi","last_synced_at":"2026-06-07T09:30:48.760Z","repository":{"id":353116915,"uuid":"1217796049","full_name":"rcarmo/gi","owner":"rcarmo","description":"An elegant Go coding agent, for more civilized times","archived":false,"fork":false,"pushed_at":"2026-05-25T08:24:40.000Z","size":39591,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-05-25T10:14:15.363Z","etag":null,"topics":["agents","clojure","go","harness"],"latest_commit_sha":null,"homepage":"https://rcarmo.github.io/projects/gi/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rcarmo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-04-22T08:20:22.000Z","updated_at":"2026-05-25T08:24:44.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/rcarmo/gi","commit_stats":null,"previous_names":["rcarmo/gi"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rcarmo/gi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rcarmo%2Fgi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rcarmo%2Fgi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rcarmo%2Fgi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rcarmo%2Fgi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rcarmo","download_url":"https://codeload.github.com/rcarmo/gi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rcarmo%2Fgi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34016491,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-07T02:00:07.652Z","response_time":124,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agents","clojure","go","harness"],"created_at":"2026-06-07T09:30:47.930Z","updated_at":"2026-06-07T09:30:48.739Z","avatar_url":"https://github.com/rcarmo.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gi\n\n\u003cimg src=\"docs/icon-256.png\" width=\"128\" alt=\"gi\"\u003e\n\nA coding agent built on `go-ai`, informed by lessons learned from Pi, Piclaw, and Vibes.\n\n## Status\n\n**Phase 1 functional** — turn engine, inference, web UI, and Playwright tests working.\n\nThe web UI uses Piclaw's TypeScript source verbatim with a gi-specific API adapter and entry point. Inference runs through `go-ai` with GitHub Copilot enterprise token exchange.\n\n## Goals\n\n- unified **web / TUI / CLI** experience\n- boringly reliable **turn handling** via append-only event log\n- workspace-centric operation with **SQLite-backed state**\n- **Piclaw compatibility** for settings, message model, keychain, prompt templates, and UX conventions\n- **Clojure-first** scripting and skills via Joker\n- **go-ai** as the model/provider layer\n\n## Architecture\n\n- `cmd/gi/` — main binary entrypoint for web server or TUI mode (`-tui`)\n- `internal/config/` — Pi/Piclaw config loader (settings, auth, AGENTS.md)\n- `internal/store/` — SQLite state store (sessions, messages, turns, events)\n- `internal/turn/` — append-only turn engine with queue/cancel/streaming\n- `internal/inference/` — go-ai inference with provider auth and SSE broadcasting\n- `internal/web/` — HTTP server, REST API, SSE streaming, workspace file APIs\n- `web/src/` — Piclaw TypeScript web source (verbatim) + gi `api.ts`/`app.ts` adapters\n- `docs/` — ADRs, internal shipped-reference source docs, implementation checklist, transcripts\n- `scripts/` — build/check scripts (hook TDZ checker)\n- `tests/` — Playwright base UX tests\n\n## Internal reference\n\nThe repo includes a growing internal documentation subtree under `docs/internal/`.\n\nThis is intended to become a shipped read-only reference surface for the agent itself, likely exposed later as `vfs://reference/...`.\n\nIf a change adds or materially changes an internal tool, scripting bridge capability, hook, managed `vfs://` behavior, or skill/package contract, the same change should update `docs/internal/`.\n\n## Development\n\n### Prerequisites\n\n- Go 1.22+\n- Bun (build-time only, not runtime)\n- Playwright + Chromium (for `make test-ux`)\n\n### Targets\n\nStart with:\n\n```sh\nmake bootstrap\n```\n\nThat installs Go/Bun dependencies, installs Playwright Chromium, and builds `gi` on a fresh machine.\n\n| Target | Description |\n|---|---|\n| `make help` | Show the grouped target list |\n| `make bootstrap` | Install dependencies, install Playwright Chromium, and build `gi` |\n| `make deps` | Download Go modules and install Bun packages |\n| `make start` | Build and start gi detached on port 8090 |\n| `make stop` | Stop the detached process |\n| `make restart` | Restart it |\n| `make status` | Show status/listener |\n| `make logs` | Tail the log file |\n| `make run` | Foreground run |\n| `make build` | Build the main `gi` binary (includes `build-web`) |\n| `make build-web` | Bundle web assets via Bun |\n| `make test` | Go unit tests |\n| `make vet` | Go vet |\n| `make bun-checks` | Hook TDZ checker |\n| `make check` | Run the standard verification suite |\n| `make test-ux` | Playwright tests against isolated instance (artifacts under `test-results/`) |\n| `make test-tui-smoke` | tmux-driven TUI smoke test (artifacts under `test-results/tui-smoke/`) |\n| `make test-tui-gherkin` | TUI gherkin harness |\n| `make clean` | Remove build/run artifacts |\n\n### Override defaults\n\n```sh\nmake start PORT=3000 BIND=0.0.0.0 MODEL=github-copilot/gpt-5-mini WORKSPACE=/workspace\n```\n\n### CLI flags\n\n| Flag | Default | Description |\n|---|---|---|\n| `-listen` | (none) | Full listen address, overrides bind/port |\n| `-bind` | `127.0.0.1` | Bind host/interface |\n| `-port` | `8081` | HTTP port |\n| `-model` | (from settings) | Override default model |\n| `-tui` | `false` | Run the terminal UI instead of the web server |\n| `-db` | `./gi.db` | SQLite database path |\n| `-workspace` | `/workspace` | Workspace root |\n| `-log-file` | (none) | Log file path |\n| `-pid-file` | (none) | PID file path |\n\n### TUI mode\n\nRun the terminal UI from the same binary:\n\n```sh\ngi -tui -db .gi-run/gi.db -workspace /workspace\n```\n\nThe current TUI uses `go-tui`, supports terminal resize handling through the runtime event loop, and enables mouse clicks so the input can regain focus.\n\n## Web UI\n\nThe web UI uses **Piclaw's TypeScript source files verbatim** (199 files). Only two files are gi-specific:\n\n- `web/src/api.ts` — API adapter implementing Piclaw's function signatures against gi's REST endpoints\n- `web/src/app.ts` — Entry point wiring gi sessions into Piclaw's component tree\n\nAll Piclaw components, theme runtime, CSS, icons, and vendor libraries work without modification.\n\n### Vendored libraries\n\n| Library | Path |\n|---|---|\n| Preact + HTM | `/js/vendor/preact-htm.js` |\n| Marked | `/js/marked.min.js` |\n| KaTeX | `/js/vendor/katex.min.js` |\n| Beautiful Mermaid | `/js/vendor/beautiful-mermaid.js` |\n| CodeMirror | `/editor-vendor/codemirror.js` |\n\n### SSE streaming\n\nThe server provides a Piclaw-compatible SSE endpoint at `/sse/stream?chat_jid=...` that broadcasts:\n- `connected`, `heartbeat`\n- `agent_status`, `agent_draft_delta`, `agent_thought_delta`\n- `new_post`, `agent_response`\n\n## Inference\n\ngi uses `go-ai` for model inference. Supported providers:\n\n- OpenAI (completions + responses)\n- Anthropic\n- GitHub Copilot (with automatic enterprise/individual endpoint detection)\n\nAuth is loaded from `~/.pi/agent/auth.json`. The system prompt is loaded from `AGENTS.md` in the workspace root.\n\n## Testing\n\n```sh\nmake test       # Go unit tests\nmake test-ux    # Playwright tests against an isolated fresh instance\nmake vet        # go vet\nmake bun-checks # hook TDZ checker\nmake check      # standard verification suite\n```\n\nThe `test-ux` target creates a completely isolated test environment with its own database, workspace, and config — no state leaks between test runs.\n\nThe `test-tui-smoke` target launches `gi -tui` inside tmux, captures the pane, submits input, verifies blur handling, exercises transcript scrolling keys, resizes the terminal, and writes pane captures plus session artifacts under `test-results/tui-smoke/`. Mouse click focus is covered in unit tests.\n\n## License\n\nTBD\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frcarmo%2Fgi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frcarmo%2Fgi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frcarmo%2Fgi/lists"}