Skip to content

docs: prioritizes agent info #1033

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Apr 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 28 additions & 64 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</p>

<h2 align="center">
Scriptable interface to a powerful, multi-lingual language server.
The SWE that Never Sleeps
</h2>

<div align="center">
Expand All @@ -22,72 +22,48 @@

<br />

[Codegen](https://docs.codegen.com) is a python library for manipulating codebases.
The Codegen SDK provides a programmatic interface to code agents provided by [Codegen](https://codegen.com).

```python
from codegen import Codebase

# Codegen builds a complete graph connecting
# functions, classes, imports and their relationships
codebase = Codebase("./")

# Work with code without dealing with syntax trees or parsing
for function in codebase.functions:
# Comprehensive static analysis for references, dependencies, etc.
if not function.usages:
# Auto-handles references and imports to maintain correctness
function.move_to_file("deprecated.py")
```

Write code that transforms code. Codegen combines the parsing power of [Tree-sitter](https://tree-sitter.github.io/tree-sitter/) with the graph algorithms of [rustworkx](https://github.com/Qiskit/rustworkx) to enable scriptable, multi-language code manipulation at scale.
from codegen.agents.agent import Agent

## Installation and Usage
# Initialize the Agent with your organization ID and API token
agent = Agent(
org_id="YOUR_ORG_ID", # Find this at codegen.com/developer
token="YOUR_API_TOKEN", # Get this from codegen.com/developer
# base_url="https://codegen-sh-rest-api.modal.run", # Optional - defaults to production
)

We support
# Run an agent with a prompt
task = agent.run(prompt="Implement a new feature to sort users by last login.")

- Running Codegen in Python 3.12 - 3.13 (recommended: Python 3.13+)
- macOS and Linux
- macOS is supported
- Linux is supported on x86_64 and aarch64 with glibc 2.34+
- Windows is supported via WSL. See [here](https://docs.codegen.com/building-with-codegen/codegen-with-wsl) for more details.
- Python, Typescript, Javascript and React codebases
# Check the initial status
print(task.status)

```
# Install inside existing project
uv pip install codegen
# Refresh the task to get updated status (tasks can take time)
task.refresh()

# Install global CLI
uv tool install codegen --python 3.13
# Check the updated status
print(task.status)

# Create a codemod for a given repo
cd path/to/repo
codegen init
codegen create test-function

# Run the codemod
codegen run test-function

# Create an isolated venv with codegen => open jupyter
codegen notebook
# Once task is complete, you can access the result
if task.status == "completed":
print(task.result) # Result often contains code, summaries, or links
```

## Usage
## Installation and Usage

See [Getting Started](https://docs.codegen.com/introduction/getting-started) for a full tutorial.
Install the SDK using pip or uv:

```bash
pip install codegen
# or
uv pip install codegen
```
from codegen import Codebase
```

## Troubleshooting

Having issues? Here are some common problems and their solutions:

- **I'm hitting an UV error related to `[[ packages ]]`**: This means you're likely using an outdated version of UV. Try updating to the latest version with: `uv self update`.
- **I'm hitting an error about `No module named 'codegen.sdk.extensions.utils'`**: The compiled cython extensions are out of sync. Update them with `uv sync --reinstall-package codegen`.
- **I'm hitting a `RecursionError: maximum recursion depth exceeded` error while parsing my codebase**: If you are using python 3.12, try upgrading to 3.13. If you are already on 3.13, try upping the recursion limit with `sys.setrecursionlimit(10000)`.
Get started at [codegen.com](https://codegen.com) and get your API token at [codegen.com/developer](https://codegen.com/developer).

If you run into additional issues not listed here, please [join our slack community](https://community.codegen.com) and we'll help you out!
You can interact with your AI engineer via API, or chat with it in Slack, Linear, Github, or on our website.

## Resources

Expand All @@ -96,18 +72,6 @@ If you run into additional issues not listed here, please [join our slack commun
- [Contributing](CONTRIBUTING.md)
- [Contact Us](https://codegen.com/contact)

## Why Codegen?

Software development is fundamentally programmatic. Refactoring a codebase, enforcing patterns, or analyzing control flow - these are all operations that can (and should) be expressed as programs themselves.

We built Codegen backwards from real-world refactors performed on enterprise codebases. Instead of starting with theoretical abstractions, we focused on creating APIs that match how developers actually think about code changes:

- **Natural mental model**: Write transforms that read like your thought process - "move this function", "rename this variable", "add this parameter". No more wrestling with ASTs or manual import management.

- **Battle-tested on complex codebases**: Handle Python, TypeScript, and React codebases with millions of lines of code.

- **Built for advanced intelligences**: As AI developers become more sophisticated, they need expressive yet precise tools to manipulate code. Codegen provides a programmatic interface that both humans and AI can use to express complex transformations through code itself.

## Contributing

Please see our [Contributing Guide](CONTRIBUTING.md) for instructions on how to set up the development environment and submit contributions.
Expand Down
72 changes: 72 additions & 0 deletions docs/graph-sitter/about.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
---
title: "Codegen, Inc."
sidebarTitle: "About Us"
icon: "building"
iconType: "solid"
---

<Card
img="/images/codegen.jpeg"
title="Codegen, Inc."
href="https://codegen.com"
/>

## Our Mission

Our mission is to build fully-autonomous software engineering - the equivalent of self-driving cars for code.

We believe the highest leverage path to autonomous development is enabling AI agents to "act via code."

Just as self-driving cars need sophisticated sensors and controls to navigate the physical world, AI agents need powerful, precise tools to manipulate codebases. We're building that foundational layer: a programmatic interface that lets AI agents express complex code transformations through code itself.

This approach creates a shared language that both humans and AI can use to:

- Express powerful changes with precision and predictability
- Build sophisticated tools from primitive operations
- Create and maintain their own abstractions
- Scale transformations across massive codebases

## The Team

Based in San Francisco, we're a team of engineers and researchers passionate about:

- Making large-scale code changes more accessible
- Building tools that work the way developers think
- Creating the infrastructure for AI-powered code manipulation
- Advancing the state of the art in program transformation

## Open Source

We believe in the power of open source software. Our core library, [codegen](https://github.com/codegen-sh/codegen-sdk), is freely available and open to contributions from the community.

## Join Us

<CardGroup cols={2}>
<Card title="Careers" icon="briefcase" href="https://codegen.com/careers">
We're hiring! Join us in building the future of code transformation.
</Card>
<Card title="Community" icon="people-group" href="/introduction/community">
Connect with other developers and share your Codegen experiences.
</Card>
</CardGroup>

## Connect with Us

<CardGroup cols={2}>
<Card title="X (Twitter)" icon="twitter" href="https://x.com/codegen">
Follow us for updates and announcements
</Card>
<Card
title="LinkedIn"
icon="linkedin"
href="https://linkedin.com/company/codegen-dot-com"
>
Connect with our team and stay updated on company news
</Card>
</CardGroup>

<Note>
Want to learn more about what we're building? Check out our [getting started
guide](/introduction/getting-started) or join our [community
Slack](https://community.codegen.com).
</Note>
Loading
Loading