|
22 | 22 |
|
23 | 23 | <br /> |
24 | 24 |
|
25 | | -The Codegen SDK provides a programmatic interface to code agents provided by [Codegen](https://codegen.com). |
| 25 | +The Codegen SDK provides both AI-powered code agents and a comprehensive programmatic interface for codebase manipulation. Whether you need an AI agent to handle complex software engineering tasks or want to build custom code transformation tools, Codegen has you covered. |
| 26 | + |
| 27 | +## Overview |
| 28 | + |
| 29 | +Codegen serves three primary use cases: |
| 30 | + |
| 31 | +**🤖 AI Code Agents** - Deploy intelligent agents that integrate with GitHub, Slack, and Linear to review PRs, implement features, fix bugs, and manage issues automatically. |
| 32 | + |
| 33 | +**🔧 Codebase SDK** - Build custom tools for code analysis, refactoring, and transformation across Python, TypeScript, JavaScript, and React codebases with automatic import and dependency management. |
| 34 | + |
| 35 | +**📊 SWE-Bench Evaluation** - Benchmark and evaluate code generation models against real-world software engineering tasks with automated evaluation pipelines. |
| 36 | + |
| 37 | +### AI Agent API |
| 38 | + |
| 39 | +Deploy intelligent agents for automated software engineering tasks: |
26 | 40 |
|
27 | 41 | ```python |
28 | 42 | from codegen.agents.agent import Agent |
@@ -51,26 +65,79 @@ if task.status == "completed": |
51 | 65 | print(task.result) # Result often contains code, summaries, or links |
52 | 66 | ``` |
53 | 67 |
|
54 | | -## Installation and Usage |
| 68 | +### Codebase SDK |
| 69 | + |
| 70 | +Programmatically analyze and transform your codebase: |
| 71 | + |
| 72 | +```python |
| 73 | +from codegen.sdk.codebase import Codebase |
| 74 | + |
| 75 | +# Load a codebase for analysis and transformation |
| 76 | +codebase = Codebase.from_repo("path/to/your/repo") |
| 77 | + |
| 78 | +# Analyze code structure |
| 79 | +for function in codebase.functions: |
| 80 | + print(f"Function: {function.name}") |
| 81 | + print(f"File: {function.file.path}") |
| 82 | + print(f"Usages: {len(function.usages)}") |
| 83 | + |
| 84 | +# Find and modify specific patterns |
| 85 | +for file in codebase.files: |
| 86 | + if file.path.endswith('.py'): |
| 87 | + # Analyze imports, dependencies, and symbols |
| 88 | + for import_stmt in file.imports: |
| 89 | + print(f"Import: {import_stmt}") |
| 90 | +``` |
| 91 | + |
| 92 | +## Installation |
| 93 | + |
| 94 | +**Requirements:** Python 3.12 - 3.13 |
55 | 95 |
|
56 | | -Install the SDK using pip or uv: |
| 96 | +Install the SDK using uv (recommended) or pip: |
57 | 97 |
|
58 | 98 | ```bash |
59 | | -pip install codegen |
60 | | -# or |
| 99 | +# Recommended: using uv |
61 | 100 | uv pip install codegen |
| 101 | + |
| 102 | +# Alternative: using pip |
| 103 | +pip install codegen |
62 | 104 | ``` |
63 | 105 |
|
64 | | -Get started at [codegen.com](https://codegen.com) and get your API token at [codegen.com/developer](https://codegen.com/developer). |
| 106 | +For development setup, see our [Contributing Guide](CONTRIBUTING.md). |
| 107 | + |
| 108 | +## Getting Started |
| 109 | + |
| 110 | +**For AI Agents:** Get started at [codegen.com](https://codegen.com) and get your API token at [codegen.com/developer](https://codegen.com/developer). You can interact with your AI engineer via API, or chat with it in Slack, Linear, GitHub, or on our website. |
| 111 | + |
| 112 | +**For SDK Development:** Check out our comprehensive documentation and tutorials to start building with the Codebase SDK. |
| 113 | + |
| 114 | +## Features |
65 | 115 |
|
66 | | -You can interact with your AI engineer via API, or chat with it in Slack, Linear, Github, or on our website. |
| 116 | +- **🤖 AI Code Agents** - Intelligent agents for automated software engineering |
| 117 | +- **🔧 Multi-Language Support** - Python, TypeScript, JavaScript, and React |
| 118 | +- **📊 Code Analysis** - Dependency graphs, symbol resolution, and usage tracking |
| 119 | +- **🔄 Code Transformation** - Safe, large-scale refactoring and modernization |
| 120 | +- **🔗 Integrations** - GitHub, Slack, Linear, and MCP (Model Context Protocol) |
| 121 | +- **📈 SWE-Bench Evaluation** - Benchmark code generation models |
| 122 | +- **🛠️ Developer Tools** - CLI, Jupyter notebooks, and IDE extensions |
67 | 123 |
|
68 | 124 | ## Resources |
69 | 125 |
|
70 | | -- [Docs](https://docs.codegen.com) |
71 | | -- [Getting Started](https://docs.codegen.com/introduction/getting-started) |
72 | | -- [Contributing](CONTRIBUTING.md) |
73 | | -- [Contact Us](https://codegen.com/contact) |
| 126 | +### Documentation |
| 127 | +- [Documentation](https://docs.codegen.com) - Complete guides and API reference |
| 128 | +- [Graph-sitter Getting Started](https://docs.codegen.com/graph-sitter/getting-started) - SDK tutorials and examples |
| 129 | +- [API Reference](https://docs.codegen.com/api-reference/index) - Detailed API documentation |
| 130 | + |
| 131 | +### Integrations |
| 132 | +- [GitHub Integration](https://docs.codegen.com/integrations/github) - Automated PR reviews and issue management |
| 133 | +- [Slack Integration](https://docs.codegen.com/integrations/slack) - Chat-based code assistance |
| 134 | +- [Linear Integration](https://docs.codegen.com/integrations/linear) - Issue tracking integration |
| 135 | +- [MCP Servers](https://docs.codegen.com/integrations/mcp) - Model Context Protocol support |
| 136 | + |
| 137 | +### Community & Support |
| 138 | +- [Slack Community](https://community.codegen.com) - Join our developer community |
| 139 | +- [Contributing Guide](CONTRIBUTING.md) - How to contribute to the project |
| 140 | +- [Contact Us](https://codegen.com/contact) - Get in touch with our team |
74 | 141 |
|
75 | 142 | ## Contributing |
76 | 143 |
|
|
0 commit comments