{"id":50046751,"url":"https://github.com/princepal9120/testgen","last_synced_at":"2026-05-21T06:02:39.882Z","repository":{"id":329010986,"uuid":"1116063166","full_name":"princepal9120/testgen","owner":"princepal9120","description":"One test engine, for people, CLI, and coding agents.","archived":false,"fork":false,"pushed_at":"2026-04-30T11:55:54.000Z","size":22476,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-30T12:13:52.051Z","etag":null,"topics":["claude","claude-code","claude-code-plugin","codex","codex-cli","mcp","opencode-plugin","opencode-skills"],"latest_commit_sha":null,"homepage":"https://testgen-cli.vercel.app","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/princepal9120.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":"SUPPORT.md","governance":null,"roadmap":"ROADMAP.md","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-14T05:43:21.000Z","updated_at":"2026-04-30T10:12:50.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/princepal9120/testgen","commit_stats":null,"previous_names":["princepal9120/testgen-cli","princepal9120/testgen"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/princepal9120/testgen","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/princepal9120%2Ftestgen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/princepal9120%2Ftestgen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/princepal9120%2Ftestgen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/princepal9120%2Ftestgen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/princepal9120","download_url":"https://codeload.github.com/princepal9120/testgen/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/princepal9120%2Ftestgen/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33290928,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-21T02:57:32.698Z","status":"ssl_error","status_checked_at":"2026-05-21T02:57:31.990Z","response_time":62,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["claude","claude-code","claude-code-plugin","codex","codex-cli","mcp","opencode-plugin","opencode-skills"],"created_at":"2026-05-21T06:02:36.429Z","updated_at":"2026-05-21T06:02:39.877Z","avatar_url":"https://github.com/princepal9120.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"website/images/logo.png\" alt=\"TestGen logo\" width=\"140\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003eAgent-native test generation for Codex, Claude Code, OpenCode, and MCP\u003c/strong\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/princepal9120/testgen/actions\"\u003e\u003cimg src=\"https://github.com/princepal9120/testgen/actions/workflows/ci.yml/badge.svg\" alt=\"CI\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/princepal9120/testgen/releases\"\u003e\u003cimg src=\"https://img.shields.io/github/v/release/princepal9120/testgen\" alt=\"Release\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.apache.org/licenses/LICENSE-2.0\"\u003e\u003cimg src=\"https://img.shields.io/badge/License-Apache%202.0-blue.svg\" alt=\"License: Apache 2.0\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/princepal9120/testgen\"\u003e\u003cimg src=\"https://img.shields.io/github/stars/princepal9120/testgen?style=social\" alt=\"GitHub stars\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#installation\"\u003eInstall\u003c/a\u003e \u0026bull;\n  \u003ca href=\"#quick-start\"\u003eQuick Start\u003c/a\u003e \u0026bull;\n  \u003ca href=\"#agent-skills\"\u003eAgent Skills\u003c/a\u003e \u0026bull;\n  \u003ca href=\"#how-it-works\"\u003eHow It Works\u003c/a\u003e \u0026bull;\n  \u003ca href=\"docs/LLM_AGENT_ADOPTION.md\"\u003eLLM Adoption Roadmap\u003c/a\u003e \u0026bull;\n  \u003ca href=\"docs/integrations/README.md\"\u003eDocs\u003c/a\u003e\n\u003c/p\u003e\n\n---\n\nTestGen gives coding agents a production-safe test-generation layer.\n\nInstall it into a repo, then ask Codex, Claude Code, OpenCode, Cursor, Cline, Continue, Roo Code, Gemini CLI, or an MCP host to analyze the codebase and generate review-first tests. TestGen handles source scanning, framework detection, capability discovery, existing-test style detection, cost-aware planning, generated test artifacts, patch output, and validation through one agent-friendly workflow.\n\nThe public product is the **agent skill**. The `testgen` binary is the local engine that the skill calls behind the scenes.\n\nSupported languages: **JavaScript/TypeScript, Python, Go, Rust, Java, C#, PHP, Ruby, C++, and Kotlin**.\n\n## Why TestGen\n\nPlain agent prompts are good for one-off test files. TestGen is for repeatable, production-grade test generation inside real repos.\n\n| Agent need | What TestGen provides |\n|------------|------------------------|\n| Generate tests safely | Dry-run first, patch artifacts, explicit write controls |\n| Match the repo | Detects nearby test files and adapts to existing framework, fixtures, mocks, naming, and assertions |\n| Avoid blind edits | Agents inspect JSON results before touching files |\n| Plan cost before API calls | Offline code analysis and provider-aware cost estimates |\n| Work across stacks | JS/TS, Python, Go, Rust, Java, C#, PHP, Ruby, C++, and Kotlin adapters |\n| Fit agent workflows | Codex skill, Claude command, OpenCode command, and MCP server |\n| Help LLM hosts discover capabilities | `testgen languages --output-format=json` and planned capability manifests |\n| Keep logic consistent | One shared engine across every agent integration |\n\nFor the open-source roadmap that makes TestGen easier to use from LLM tools like Cursor, Cline, Continue, Roo Code, and Gemini CLI, see [`docs/LLM_AGENT_ADOPTION.md`](docs/LLM_AGENT_ADOPTION.md).\n\n### Why not just ask Claude or Codex directly?\n\nYou still use Claude, Codex, or OpenCode. TestGen gives them a dedicated workflow instead of a loose prompt:\n\n- analyze first, so the agent knows what files and functions exist\n- reuse existing tests as style context, so output fits the repo\n- dry-run patches before writes, so changes are reviewable\n- report token and cost usage, so large repos stay controlled\n- validate generated tests through the local project toolchain\n\n## Installation\n\n### 1. Install the TestGen engine\n\nLinux/macOS:\n\n```bash\ncurl -fsSL https://raw.githubusercontent.com/princepal9120/testgen/main/install.sh | bash\n```\n\nWindows PowerShell:\n\n```powershell\nirm https://raw.githubusercontent.com/princepal9120/testgen/main/install.ps1 | iex\n```\n\nGo install alternative:\n\n```bash\ngo install github.com/princepal9120/testgen-cli@latest\n```\n\n### 2. Install the agent skill into your repo\n\nFrom inside the repo you want your agent to work on:\n\n```bash\ncurl -fsSL https://raw.githubusercontent.com/princepal9120/testgen/main/scripts/install-agent-skill.sh | bash\n```\n\nIf you cloned the repo, you can use the shorter local entrypoint:\n\n```bash\n./skills.sh --agent all\n```\n\nSkills CLI install alternative:\n\n```bash\nnpx skills add princepal9120/testgen@testgen\n```\n\nCodex only:\n\n```bash\ncurl -fsSL https://raw.githubusercontent.com/princepal9120/testgen/main/scripts/install-agent-skill.sh | bash -s -- --agent codex\n```\n\nClaude Code only:\n\n```bash\ncurl -fsSL https://raw.githubusercontent.com/princepal9120/testgen/main/scripts/install-agent-skill.sh | bash -s -- --agent claude\n```\n\nOpenCode only:\n\n```bash\ncurl -fsSL https://raw.githubusercontent.com/princepal9120/testgen/main/scripts/install-agent-skill.sh | bash -s -- --agent opencode\n```\n\nCursor, Cline, Continue, Roo Code, or Gemini CLI:\n\n```bash\ncurl -fsSL https://raw.githubusercontent.com/princepal9120/testgen/main/scripts/install-agent-skill.sh | bash -s -- --agent cursor\ncurl -fsSL https://raw.githubusercontent.com/princepal9120/testgen/main/scripts/install-agent-skill.sh | bash -s -- --agent cline\ncurl -fsSL https://raw.githubusercontent.com/princepal9120/testgen/main/scripts/install-agent-skill.sh | bash -s -- --agent continue\ncurl -fsSL https://raw.githubusercontent.com/princepal9120/testgen/main/scripts/install-agent-skill.sh | bash -s -- --agent roo\ncurl -fsSL https://raw.githubusercontent.com/princepal9120/testgen/main/scripts/install-agent-skill.sh | bash -s -- --agent gemini\n```\n\nInstall into another repo:\n\n```bash\ncurl -fsSL https://raw.githubusercontent.com/princepal9120/testgen/main/scripts/install-agent-skill.sh | bash -s -- --target /path/to/repo --agent all\n```\n\nInstalled files:\n\n- `.codex/skills/testgen/SKILL.md`\n- `.claude/commands/testgen.md`\n- `.opencode/commands/testgen.md`\n- `.cursor/rules/testgen.mdc`\n- `.clinerules/testgen.md`\n- `.continue/prompts/testgen.md`\n- `.roo/commands/testgen.md`\n- `GEMINI.md`\n\n### 3. Set one provider key\n\n```bash\nexport ANTHROPIC_API_KEY=\"...\"\n# or OPENAI_API_KEY / GEMINI_API_KEY / GROQ_API_KEY\n```\n\n## Quick Start\n\nAsk your coding agent:\n\n```text\nUse TestGen to analyze this repo and generate review-first unit tests for ./src.\nDo not write files until you inspect the dry-run patch.\n```\n\nFor a single file:\n\n```text\nUse TestGen to create unit tests for ./src/utils.py.\nStart with a dry-run patch, then validate the generated test after review.\n```\n\nFor a larger repo:\n\n```text\nUse TestGen to estimate test generation cost for ./src first.\nThen generate review-first patches folder by folder.\n```\n\nThe agent skill will run the safe flow:\n\n```bash\ntestgen doctor --path=. --output-format json\ntestgen capabilities --output-format json\ntestgen cost --path=./src --output-format json\ntestgen generate --path=./src --recursive --type=unit --dry-run --emit-patch --report-usage --output-format json\n```\n\nFriendly command aliases and capability discovery are included for agent and human workflows:\n\n```bash\ntestgen doctor --path=. --output-format json\ntestgen capabilities --output-format json\ntestgen testcase --file=./src/utils.py --dry-run --emit-patch\ntestgen comparison --path=./src\ntestgen languages --output-format json\n```\n\nThen it writes only when approved or explicitly requested:\n\n```bash\ntestgen generate --path=./src --recursive --type=unit --validate --output-format json\n```\n\n## Agent Skills\n\n### Skills CLI\n\nTestGen is also packaged as a standard agent skill at `skills/testgen/SKILL.md`:\n\n```bash\nnpx skills add princepal9120/testgen@testgen\n```\n\n### Codex\n\nTestGen installs a repo-local skill at:\n\n```text\n.codex/skills/testgen/SKILL.md\n```\n\nCodex uses this skill when you ask for AI-generated tests, dry-run patches, test coverage improvement, or validation.\n\n### Claude Code\n\nTestGen installs a command wrapper at:\n\n```text\n.claude/commands/testgen.md\n```\n\nUse it when you want Claude Code to run the same review-first generation flow.\n\n### OpenCode\n\nTestGen installs a command wrapper at:\n\n```text\n.opencode/commands/testgen.md\n```\n\nUse it for the same agent-safe workflow in OpenCode.\n\n### MCP\n\nRun the MCP server for MCP-compatible hosts:\n\n```bash\ntestgen mcp\n```\n\nPrint a config snippet from the TestGen repo:\n\n```bash\n./scripts/print-mcp-config.sh testgen\n```\n\n## How It Works\n\n```\nCoding agent\n     |\n     v\nTestGen skill or command wrapper\n     |\n     v\nLocal TestGen engine\n     |\n     +--\u003e estimate cost with testgen cost\n     +--\u003e generate dry-run test artifacts with testgen generate/testcase\n     +--\u003e compare plain LLM vs TestGen skill with testgen comparison\n     +--\u003e emit structured patches\n     +--\u003e validate generated tests when writing is allowed\n     |\n     v\nAgent reviews JSON, explains the patch, then applies changes\n```\n\nFour principles guide the workflow:\n\n1. **Agent-first onboarding**. Users install a skill into their repo and talk to their agent.\n2. **Review before write**. Dry-run and patch artifacts come before file edits.\n3. **Machine-readable by default**. Agents get JSON results, artifacts, patches, usage, and errors.\n4. **One engine, many agents**. Codex, Claude Code, OpenCode, and MCP all use the same behavior.\n\n## Upgrade\n\nUpdate the local engine:\n\n```bash\ncurl -fsSL https://raw.githubusercontent.com/princepal9120/testgen/main/install.sh | bash\n```\n\nRefresh the repo-local agent skill:\n\n```bash\ncurl -fsSL https://raw.githubusercontent.com/princepal9120/testgen/main/scripts/install-agent-skill.sh | bash\n```\n\n## Documentation\n\n- [Agent integrations](docs/integrations/README.md)\n- [Codex integration](docs/integrations/codex.md)\n- [Claude Code integration](docs/integrations/claude-code.md)\n- [OpenCode integration](docs/integrations/opencode.md)\n- [MCP integration](docs/integrations/mcp.md)\n- [Architecture](docs/ARCHITECTURE.md)\n- [Release and distribution guide](docs/release/AGENT_DISTRIBUTION.md)\n\n## License\n\nApache 2.0. See [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprincepal9120%2Ftestgen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprincepal9120%2Ftestgen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprincepal9120%2Ftestgen/lists"}