Skip to content
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
77 changes: 77 additions & 0 deletions docs/introduction/api.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
---
title: "Codegen SDK"
sidebarTitle: "API"
icon: "code"
iconType: "solid"
---

The [Codegen SDK](https://github.com/codegen-sh/codegen-sdk) enables developers to programmatically interact with [Codegen](https://codegen.com) SWE agents via API.

<Tip>
Go to [developer settings](https://codegen.sh/token) to generate an API token
</Tip>

```python
from codegen import Agent

# Initialize the Agent with your organization ID and API token
agent = Agent(org_id="...", token="...")

# Run an agent with a prompt
task = agent.run(prompt="Leave a review on PR #123")

# Check the initial status
print(task.status)

# Refresh the task to get updated status (tasks can take time)
task.refresh()

if task.status == "completed":
print(task.result) # Result often contains code, summaries, or links
```

<Note>
Codegen agents can research code, create PRs, modify Linear tickets, and more.
</Note>

## Installation

Install the SDK using pip or uv:

```bash
pip install codegen
# or
uv pip install codegen
```

## What can I do with the Codegen SDK?

The Codegen SDK is your gateway to programmatically interacting with your AI Software Engineer. You can use it to:

- **Automate development tasks**: Assign tasks like implementing features, fixing bugs, writing tests, or improving documentation to the agent.
- **Integrate AI into your workflows**: Trigger agent tasks from your CI/CD pipelines, scripts, or other development tools.
- **Provide context and guidance**: Supply the agent with specific instructions, relevant code snippets, or background information to ensure it performs tasks according to your requirements.

Essentially, the SDK allows you to leverage Codegen's AI capabilities wherever you can run Python code.

## Get Started

import {
COMMUNITY_SLACK_URL,
CODEGEN_SDK_GITHUB_URL,
} from "/snippets/links.mdx";

<CardGroup cols={2}>
<Card title="Create Account" icon="user-plus" href="https://codegen.sh/login">
Sign up for a free account and get your API token.
</Card>
<Card title="Join our Slack" icon="slack" href={COMMUNITY_SLACK_URL}>
Get help and connect with the Codegen community.
</Card>
<Card title="Tutorials" icon="diagram-project" href="/tutorials/at-a-glance">
Learn how to use Codegen for common code transformation tasks.
</Card>
<Card title="View on GitHub" icon="github" href={CODEGEN_SDK_GITHUB_URL}>
Star us on GitHub and contribute to the project.
</Card>
</CardGroup>
145 changes: 91 additions & 54 deletions docs/introduction/overview.mdx
Original file line number Diff line number Diff line change
@@ -1,77 +1,114 @@
---
title: "Codegen"
title: "Overview"
sidebarTitle: "Overview"
icon: "code"
icon: "robot"
iconType: "solid"
---

The [Codegen SDK](https://github.com/codegen-sh/codegen-sdk) enables developers to programmatically interact with [Codegen](https://codegen.com) SWE agents via API.
<img
src="/images/codegen.jpeg"
alt="Codegen Agent"
style={{ borderRadius: "8px", marginBottom: "1.5em" }}
/>

<Tip>
Go to [developer settings](https://codegen.sh/token) to generate an API token
</Tip>
## Codegen - The SWE that Never Sleeps

```python
from codegen import Agent
Codegen provides intelligent AI agents designed to seamlessly integrate into your existing developer workflows and automate a wide range of software engineering tasks. Think of it as an AI coworker that can understand and solve coding challenges, access your codebase instantly without pre-indexing, and interact directly with your development tools.

# Initialize the Agent with your organization ID and API token
agent = Agent(org_id="...", token="...")
Our mission is to build fully-autonomous software engineering, empowering human developers to focus on higher-level problems by handling routine tasks.

# Run an agent with a prompt
task = agent.run(prompt="Leave a review on PR #123")
## What Can Codegen Agents Do?

# Check the initial status
print(task.status)
Codegen agents come equipped with a versatile set of tools and capabilities:

# Refresh the task to get updated status (tasks can take time)
task.refresh()

if task.status == "completed":
print(task.result) # Result often contains code, summaries, or links
```

<Note>
Codegen agents can research code, create PRs, modify Linear tickets, and more.
</Note>

## Installation

Install the SDK using pip or uv:

```bash
pip install codegen
# or
uv pip install codegen
```
<CardGroup cols={2}>
<Card title="Understand & Solve Code Tasks" icon="code-branch">
Analyze requirements, implement features, fix bugs, write tests, and improve
documentation based on your prompts.
</Card>
<Card
title="Seamless GitHub Integration"
icon="github"
href="/integrations/github"
>
Review PRs, suggest changes, comment on issues, create branches, commit
code, and manage repositories.
</Card>
<Card
title="Linear Task Management"
icon="pencil"
href="/integrations/linear"
>
Update ticket statuses, add comments, link PRs to issues, and create new
tasks based on findings.
</Card>
<Card title="Slack Communication" icon="slack" href="/integrations/slack">
Send notifications, ask for clarification, report progress, and interact
directly with your team in Slack channels.
</Card>
<Card
title="Code Execution Sandbox"
icon="box"
href="/integrations/sandboxes"
>
Safely run code, install dependencies, and test changes in an isolated
environment.
</Card>
<Card title="Web Search" icon="globe" href="/integrations/web-search">
Access up-to-date information, research libraries, and find documentation
online.
</Card>
</CardGroup>

## What can I do with the Codegen SDK?
## Get Started in Minutes

The Codegen SDK is your gateway to programmatically interacting with your AI Software Engineer. You can use it to:
Integrating Codegen into your workflow is designed to be quick and easy:

- **Automate development tasks**: Assign tasks like implementing features, fixing bugs, writing tests, or improving documentation to the agent.
- **Integrate AI into your workflows**: Trigger agent tasks from your CI/CD pipelines, scripts, or other development tools.
- **Provide context and guidance**: Supply the agent with specific instructions, relevant code snippets, or background information to ensure it performs tasks according to your requirements.
<CardGroup cols={2}>
<Card
title="One-Click GitHub Install"
icon="github"
href="https://github.com/apps/codegen-sh"
>
Install the GitHub App to grant the agent access to your repositories. No
complex setup required.
</Card>
<Card
title="Connect Slack"
icon="slack"
href="https://codegen.sh/integrations"
>
Add the Codegen Slack App to communicate with the agent directly in your
workspace.
</Card>
<Card
title="Link Linear"
icon="pencil"
href="https://codegen.sh/integrations"
>
Connect your Linear workspace to enable agent interactions with your issues.
</Card>
<Card title="Use the API/SDK" icon="code" href="/introduction/api">
Programmatically interact with agents using the Python SDK for advanced
automation.
</Card>
</CardGroup>

Essentially, the SDK allows you to leverage Codegen's AI capabilities wherever you can run Python code.
## Enterprise-Grade Security

## Get Started
Codegen is SOC 2 Type II certified, ensuring your code and data are handled with the highest standards for security, privacy, and compliance.

import {
COMMUNITY_SLACK_URL,
CODEGEN_SDK_GITHUB_URL,
} from "/snippets/links.mdx";
## Ready to Start?

<CardGroup cols={2}>
<Card title="Create Account" icon="user-plus" href="https://codegen.sh/login">
Sign up for a free account and get your API token.
<Card title="Install Now" icon="download" href="https://codegen.sh/install">
Codegen is free to install. Get started in just a few clicks.
</Card>
<Card title="Join our Slack" icon="slack" href={COMMUNITY_SLACK_URL}>
Get help and connect with the Codegen community.
</Card>
<Card title="Tutorials" icon="diagram-project" href="/tutorials/at-a-glance">
<Card
title="Explore Tutorials"
icon="diagram-project"
href="/tutorials/at-a-glance"
>
Learn how to use Codegen for common code transformation tasks.
</Card>
<Card title="View on GitHub" icon="github" href={CODEGEN_SDK_GITHUB_URL}>
Star us on GitHub and contribute to the project.
</Card>
</CardGroup>
1 change: 1 addition & 0 deletions docs/mint.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
"pages": [
"introduction/overview",
"introduction/capabilities",
"introduction/api",
"introduction/prompting",
"introduction/community",
"introduction/about",
Expand Down
Loading