Skip to content

feat(codegen): optional local Claude Code agent via codegen-go#18

Merged
teslashibe merged 1 commit intomainfrom
feat/codegen-go-integration
Apr 22, 2026
Merged

feat(codegen): optional local Claude Code agent via codegen-go#18
teslashibe merged 1 commit intomainfrom
feat/codegen-go-integration

Conversation

@teslashibe
Copy link
Copy Markdown
Owner

Summary

  • Adds an opt-in local-execution path for the Claude Code CLI (and any other "prompt-on-stdin, edit-files-in-cwd" CLI like Codex / Aider / OpenHands / Cline / your-own) via the new teslashibe/codegen-go module.
  • Complementary to — not a replacement for — the Anthropic Managed Agents path. Managed Agents stays the default for chat-style agent products.
  • Reach for the new path when the agent needs to:
    • Run on this machine (filesystem access, on-prem, off-platform tools).
    • Drive a non-Anthropic CLI you've already integrated with.
    • Operate inside a long-running process under your direct control (e.g. an agent loop that opens PRs).

What's new

  • New dependency github.com/teslashibe/codegen-go v0.1.1.
  • backend/internal/codegen/codegen.go — ~100-LoC shim:
    • LoadFromEnv() — reads CODEGEN_* env vars and returns a configured Agent.
    • Re-exports Agent, Config, Result so callers stay on a single import.
  • backend/internal/codegen/codegen_test.go — defaults / generic / missing-command / CSV-parser coverage.
  • backend/cmd/codegen-demo/main.go — runnable proof:
    go run ./backend/cmd/codegen-demo "Summarise this directory in one paragraph."
  • New CODEGEN_* block in backend/.env.example (commented out, opt-in).
  • New "Local code-generation agent (optional)" section in README.md.

What's unchanged

  • Managed Agents flow: cmd/provision, internal/agent, the SSE event shape, every API route — all identical.
  • All existing tests pass (9 packages, zero failures).

Test plan

  • cd backend && go vet ./...
  • cd backend && go build ./...
  • cd backend && go test ./... — 9 packages green, including new internal/codegen suite
  • CI on this PR

Adds an opt-in local-execution path for the Claude Code CLI (and any
other "prompt-on-stdin, edit-files-in-cwd" CLI like Codex / Aider /
OpenHands / Cline) via the new teslashibe/codegen-go module.
Complementary to the Anthropic Managed Agents path — Managed Agents
stays the default; reach for this when the agent needs filesystem
access on this machine, on-prem execution, off-platform tools, or a
non-Anthropic CLI you've already integrated with.

- New dep github.com/teslashibe/codegen-go v0.1.1
- backend/internal/codegen/codegen.go — ~100-LoC shim:
  - LoadFromEnv() reads CODEGEN_* env vars and returns an Agent
  - Re-exports Agent, Config, Result so callers stay on a single import
- backend/internal/codegen/codegen_test.go — defaults / generic /
  missing-command / CSV-parser coverage
- backend/cmd/codegen-demo/main.go — runnable proof:
    go run ./backend/cmd/codegen-demo "Summarise this directory."
- backend/.env.example: opt-in CODEGEN_* block (commented out)
- README.md: new "Local code-generation agent (optional)" section

Tested: go vet ./..., go build ./..., go test ./... — all green
(9 packages, includes new internal/codegen tests).
@teslashibe teslashibe merged commit 7b119ac into main Apr 22, 2026
1 check passed
@teslashibe teslashibe deleted the feat/codegen-go-integration branch April 22, 2026 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant