From 90f6e33322dc8d634d661206b7143cce2862004b Mon Sep 17 00:00:00 2001 From: jayhack Date: Sun, 6 Apr 2025 20:25:32 -0700 Subject: [PATCH] . --- docs/introduction/getting-started.mdx | 314 +--------- docs/introduction/installation.mdx | 115 +--- docs/introduction/overview.mdx | 162 +----- docs/introduction/python-agents.mdx | 62 ++ docs/mint.json | 787 +++++++++++++------------- 5 files changed, 511 insertions(+), 929 deletions(-) create mode 100644 docs/introduction/python-agents.mdx diff --git a/docs/introduction/getting-started.mdx b/docs/introduction/getting-started.mdx index ad9e2c5f2..2fbbd591d 100644 --- a/docs/introduction/getting-started.mdx +++ b/docs/introduction/getting-started.mdx @@ -1,313 +1,51 @@ --- title: "Getting Started" sidebarTitle: "Getting Started" -icon: "bolt" +icon: "rocket" iconType: "solid" --- -A quick tour of Codegen in a Jupyter notebook. +The fastest way to start using Codegen agents is by signing up on our website. -## Installation - -Install [codegen](https://pypi.org/project/codegen/) on Pypi via [uv](https://github.com/astral-sh/uv): - -```bash -uv tool install codegen -``` - -## Quick Start with Jupyter - -The [codegen notebook](/cli/notebook) command creates a virtual environment and opens a Jupyter notebook for quick prototyping. This is often the fastest way to get up and running. - -```bash -# Launch Jupyter with a demo notebook -codegen notebook --demo -``` - - - - The `notebook --demo` comes pre-configured to load [FastAPI](https://github.com/fastapi/fastapi)'s codebase, so you can start - exploring right away! - - - - Prefer working in your IDE? See [IDE Usage](/introduction/ide-usage) - - -## Initializing a Codebase - -Instantiating a [Codebase](/api-reference/core/Codebase) will automatically parse a codebase and make it available for manipulation. - -```python -from codegen import Codebase - -# Clone + parse fastapi/fastapi -codebase = Codebase.from_repo('fastapi/fastapi') - -# Or, parse a local repository -codebase = Codebase("path/to/git/repo") -``` - - - This will automatically infer the programming language of the codebase and - parse all files in the codebase. Learn more about [parsing codebases here](/building-with-codegen/parsing-codebases) - - -## Exploring Your Codebase - -Let's explore the codebase we just initialized. - -Here are some common patterns for code navigation in Codegen: - -- Iterate over all [Functions](/api-reference/core/Function) with [Codebase.functions](/api-reference/core/Codebase#functions) -- View class inheritance with [Class.superclasses](/api-reference/core/Class#superclasses) -- View function usages with [Function.usages](/api-reference/core/Function#usages) -- View inheritance hierarchies with [inheritance APIs](https://docs.codegen.com/building-with-codegen/class-api#working-with-inheritance) -- Identify recursive functions by looking at [FunctionCalls](https://docs.codegen.com/building-with-codegen/function-calls-and-callsites) -- View function call-sites with [Function.call_sites](/api-reference/core/Function#call-sites) - -```python -# Print overall stats -print("πŸ” Codebase Analysis") -print("=" * 50) -print(f"πŸ“š Total Classes: {len(codebase.classes)}") -print(f"⚑ Total Functions: {len(codebase.functions)}") -print(f"πŸ”„ Total Imports: {len(codebase.imports)}") - -# Find class with most inheritance -if codebase.classes: - deepest_class = max(codebase.classes, key=lambda x: len(x.superclasses)) - print(f"\n🌳 Class with most inheritance: {deepest_class.name}") - print(f" πŸ“Š Chain Depth: {len(deepest_class.superclasses)}") - print(f" ⛓️ Chain: {' -> '.join(s.name for s in deepest_class.superclasses)}") - -# Find first 5 recursive functions -recursive = [f for f in codebase.functions - if any(call.name == f.name for call in f.function_calls)][:5] -if recursive: - print(f"\nπŸ”„ Recursive functions:") - for func in recursive: - print(f" - {func.name}") -``` - -## Analyzing Tests - -Let's specifically drill into large test files, which can be cumbersome to manage. - -```python -from collections import Counter - -# Filter to all test functions and classes -test_functions = [x for x in codebase.functions if x.name.startswith('test_')] -test_classes = [x for x in codebase.classes if x.name.startswith('Test')] + + Visit codegen.com to create your account and begin exploring agent capabilities. + -print("πŸ§ͺ Test Analysis") -print("=" * 50) -print(f"πŸ“ Total Test Functions: {len(test_functions)}") -print(f"πŸ”¬ Total Test Classes: {len(test_classes)}") -print(f"πŸ“Š Tests per File: {len(test_functions) / len(codebase.files):.1f}") +## Connecting Integrations -# Find files with the most tests -print("\nπŸ“š Top Test Files by Class Count") -print("-" * 50) -file_test_counts = Counter([x.file for x in test_classes]) -for file, num_tests in file_test_counts.most_common()[:5]: - print(f"πŸ” {num_tests} test classes: {file.filepath}") - print(f" πŸ“ File Length: {len(file.source)} lines") - print(f" πŸ’‘ Functions: {len(file.functions)}") -``` - -## Splitting Up Large Test Files - -Lets split up the largest test files into separate modules for better organization. - -This uses Codegen's [codebase.move_to_file(...)](/building-with-codegen/moving-symbols), which will: -- update all imports -- (optionally) move dependencies -- do so very fast ⚑️ - -While maintaining correctness. - -```python -filename = 'tests/test_path.py' -print(f"πŸ“¦ Splitting Test File: {filename}") -print("=" * 50) - -# Grab a file -file = codebase.get_file(filename) -base_name = filename.replace('.py', '') - -# Group tests by subpath -test_groups = {} -for test_function in file.functions: - if test_function.name.startswith('test_'): - test_subpath = '_'.join(test_function.name.split('_')[:3]) - if test_subpath not in test_groups: - test_groups[test_subpath] = [] - test_groups[test_subpath].append(test_function) - -# Print and process each group -for subpath, tests in test_groups.items(): - print(f"\\n{subpath}/") - new_filename = f"{base_name}/{subpath}.py" - - # Create file if it doesn't exist - if not codebase.has_file(new_filename): - new_file = codebase.create_file(new_filename) - file = codebase.get_file(new_filename) - - # Move each test in the group - for test_function in tests: - print(f" - {test_function.name}") - test_function.move_to_file(new_file, strategy="add_back_edge") - -# Commit changes to disk -codebase.commit() -``` - - - In order to commit changes to your filesystem, you must call - [codebase.commit()](/api-reference/core/Codebase#commit). Learn more about - [commit() and reset()](/building-with-codegen/commit-and-reset). - - -### Finding Specific Content - -Once you have a general sense of your codebase, you can filter down to exactly what you're looking for. Codegen's graph structure makes it straightforward and performant to find and traverse specific code elements: - -```python -# Grab specific content by name -my_resource = codebase.get_symbol('TestResource') - -# Find classes that inherit from a specific base -resource_classes = [ - cls for cls in codebase.classes - if cls.is_subclass_of('Resource') -] - -# Find functions with specific decorators -test_functions = [ - f for f in codebase.functions - if any('pytest' in d.source for d in f.decorators) -] +Once you've signed up, you can connect Codegen to your existing tools directly from your account settings on the Codegen website. See all available [integrations here](https://codegen.sh/integrations). -# Find files matching certain patterns -test_files = [ - f for f in codebase.files - if f.name.startswith('test_') -] -``` - -## Safe Code Transformations - -Codegen guarantees that code transformations maintain correctness. It automatically handles updating imports, references, and dependencies. Here are some common transformations: - -```python -# Move all Enum classes to a dedicated file -for cls in codebase.classes: - if cls.is_subclass_of('Enum'): - # Codegen automatically: - # - Updates all imports that reference this class - # - Maintains the class's dependencies - # - Preserves comments and decorators - # - Generally performs this in a sane manner - cls.move_to_file(f'enums.py') - -# Rename a function and all its usages -old_function = codebase.get_function('process_data') -old_function.rename('process_resource') # Updates all references automatically - -# Change a function's signature -handler = codebase.get_function('event_handler') -handler.get_parameter('e').rename('event') # Automatically updates all call-sites -handler.add_parameter('timeout: int = 30') # Handles formatting and edge cases -handler.add_return_type('Response | None') - -# Perform surgery on call-sites -for fcall in handler.call_sites: - arg = fcall.get_arg_by_parameter_name('env') - # f(..., env={ data: x }) => f(..., env={ data: x or None }) - if isinstance(arg.value, Collection): - data_key = arg.value.get('data') - data_key.value.edit(f'{data_key.value} or None') -``` - - - When moving symbols, Codegen will automatically update all imports and - references. See [Moving Symbols](/building-with-codegen/moving-symbols) to - learn more. - - -## Leveraging Graph Relations +### Slack -Codegen's graph structure makes it easy to analyze relationships between code elements across files: +1. Navigate to the 'Integrations' section in your Codegen account settings. +2. Find the Slack integration and click 'Connect'. +3. Follow the prompts to authorize Codegen to access your Slack workspace. +4. Once connected, you can start interacting with Codegen agents directly within Slack. -```python -# Find dead code -for func in codebase.functions: - if len(func.usages) == 0: - print(f'πŸ—‘οΈ Dead code: {func.name}') - func.remove() +### Linear -# Analyze import relationships -file = codebase.get_file('api/endpoints.py') -print("\nFiles that import endpoints.py:") -for import_stmt in file.inbound_imports: - print(f" {import_stmt.file.path}") +1. Navigate to the 'Integrations' section in your Codegen account settings. +2. Find the Linear integration and click 'Connect'. +3. Follow the prompts to authorize Codegen, providing necessary details like your team ID if required. +4. Once connected, you can ask Codegen agents to interact with your Linear issues. -print("\nFiles that endpoints.py imports:") -for import_stmt in file.imports: - if import_stmt.resolved_symbol: - print(f" {import_stmt.resolved_symbol.file.path}") - -# Explore class hierarchies -base_class = codebase.get_class('BaseModel') -if base_class: - print(f"\nClasses that inherit from {base_class.name}:") - for subclass in base_class.subclasses: - print(f" {subclass.name}") - # We can go deeper in the inheritance tree - for sub_subclass in subclass.subclasses: - print(f" └─ {sub_subclass.name}") -``` - Learn more about [dependencies and - references](/building-with-codegen/dependencies-and-usages) or [imports](/building-with-codegen/imports) and [exports](/building-with-codegen/exports). + You can also interact with Codegen via our **Python SDK** or **API** for more programmatic control. Refer to the relevant documentation sections for setup instructions. -## Advanced Settings - -Codegen also supports a number of advanced settings that can be used to customize the behavior of the graph construction process. - -These flags are helpful for debugging problematic repos, optimizing Codegen’s performance, or testing unreleased or experimental (potentially backwards-breaking) features. +## Installation -```python -from codegen import Codebase -from codegen.configs import CodebaseConfig +Install [codegen](https://pypi.org/project/codegen/) on Pypi via [uv](https://github.com/astral-sh/uv): -# Initialize a Codebase with custom configuration -codebase = Codebase( - "path/to/git/repo"", - config=CodebaseConfig( - verify_graph=True, - method_usages=False, - sync_enabled=True, - generics=False, - import_resolution_overrides={ - "old_module": "new_module" - }, - ts_language_engine=True, - v8_ts_engine=True - ) -) +```bash +uv tool install codegen ``` -To learn more about available settings, see the [Advanced Settings](/introduction/advanced-settings) page. - - -These are considered experimental and unstable features that may be removed or changed in the future. - ## What's Next? diff --git a/docs/introduction/installation.mdx b/docs/introduction/installation.mdx index 41188c64b..c037d1b6f 100644 --- a/docs/introduction/installation.mdx +++ b/docs/introduction/installation.mdx @@ -5,121 +5,26 @@ icon: "download" iconType: "solid" --- -Install and set up Codegen in your development environment. - -#### We currently support: -- 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 - -## Prerequisites - -We recommend using [uv](https://github.com/astral-sh/uv) for installation. If you haven't installed `uv` yet: -```bash -curl -LsSf https://astral.sh/uv/install.sh | sh -``` - -## Installing Codegen +Navigate to your project's directory in your terminal. If you're using [uv](https://github.com/astral-sh/uv) to manage your project's dependencies, add Codegen: ```bash -uv tool install codegen --python 3.13 +uv add codegen ``` - -This makes the `codegen` command available globally in your terminal, while keeping its dependencies isolated. +If you don't have `uv` installed yet, follow the instructions [here](https://github.com/astral-sh/uv?tab=readme-ov-file#installation). -## Quick Start - -Let's walk through a minimal example of using Codegen in a project: - -1. Navigate to your repository: - ```bash - cd path/to/your/project - ``` - -2. Initialize Codegen in your project with [codegen init](/cli/init): - ```bash - codegen init - ``` - - This creates a `.codegen/` directory with: - ```bash - .codegen/ - β”œβ”€β”€ .venv/ # Python virtual environment (gitignored) - β”œβ”€β”€ config.toml # Project configuration - β”œβ”€β”€ codemods/ # Your codemod implementations - β”œβ”€β”€ jupyter/ # Jupyter notebooks for exploration - └── codegen-system-prompt.txt # AI system prompt - ``` +## Authentication -3. Create your first codemod with [codegen create](/cli/create): - ```bash - codegen create organize-imports \ - -d "Sort and organize imports according to PEP8" - ``` - - The `-d` flag in `codegen create` generates an AI-powered implementation. This requires a Github account registered on [codegen.sh](https://codegen.sh) - +After installation, connect the CLI to your Codegen account: +```bash +codegen login +``` - -4. Run your codemod with [codegen run](/cli/run): - ```bash - codegen run organize-imports - ``` - -5. Reset any filesystem changes (excluding `.codegen/*`) with [codegen reset](/cli/reset): - ```bash - codegen reset - ``` - -## 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)`. - - -For more help, join our [community Slack](/introduction/community) or check the [FAQ](/introduction/faq). - +This will open your browser to authenticate and link your environment. ## Next Steps - - - Learn how to use Codegen effectively in VSCode, Cursor, and other IDEs. - - - Follow step-by-step tutorials for common code transformation tasks. - - - Leverage AI assistants like Copilot, Cursor and Devin - - - Learn more about building with Codegen - - - +Now that you're set up, head over to the **[Getting Started](/introduction/getting-started)** guide to learn how to use Codegen agents. diff --git a/docs/introduction/overview.mdx b/docs/introduction/overview.mdx index 4d428fc71..079d825d8 100644 --- a/docs/introduction/overview.mdx +++ b/docs/introduction/overview.mdx @@ -1,159 +1,39 @@ --- title: "Codegen" sidebarTitle: "Overview" -icon: "code" +icon: "robot" iconType: "solid" --- -[Codegen](https://github.com/codegen-sh/codegen-sdk) is a python library for manipulating codebases. +**Meet Codegen: AI agents for your codebase.** -It provides a scriptable interface to a powerful, multi-lingual language server built on top of [Tree-sitter](https://tree-sitter.github.io/tree-sitter/). +We provide intelligent **Code Agents** that act as partners in your development workflow, understanding, modifying, and managing codebases on your behalf. -```python -from codegen import Codebase +Our mission is to enable AI agents to collaborate seamlessly with developers, automating tasks and accelerating software creation. -# Codegen builds a complete graph connecting -# functions, classes, imports and their relationships -codebase = Codebase("./") +## What Can Codegen Agents Do? -# 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.remove() +Codegen agents leverage powerful tools to interact with code, allowing them to: -# Fast, in-memory code index -codebase.commit() -``` +- **Understand Code:** Explain functions, summarize changes, trace dependencies. +- **Modify Code:** Refactor, add documentation, implement features via prompts. +- **Manage Repositories:** Find usages, manage version control (GitHub), and handle issues (Linear). +- **Automate Tasks:** Streamline code reviews, generate boilerplate, and more. +- **Coordinate via Integrations:** Seamlessly manage tasks across connected tools like GitHub and Linear, with Codegen handling the execution flow. +This creates a shared understanding where both humans and AI can express and execute complex code operations reliably. - -Codegen handles complex refactors while maintaining correctness, enabling a broad set of advanced code manipulation programs. - +## How Do You Interact? -Codegen works with both Python and Typescript/JSX codebases. Learn more about language support [here](/building-with-codegen/language-support). +You can command Codegen agents using natural language through various platforms: -## Quick Started +- **Slack:** Integrate directly into your team's conversations. +- **GitHub:** Trigger agents via PR comments or actions. +- **Linear:** Interact with agents within your issue tracking workflow. +- **Web App:** Use our dedicated online interface. +- **Python SDK:** Programmatically control agents via `agent.run(...)`. +- **API:** Integrate agent capabilities into your own tools and services. - -Codegen requires Python 3.12 - 3.13 (recommended: Python 3.13+). - +Ready to get started? Head over to the **[Getting Started](/getting-started/installation)** guide to set up Codegen and run your first agent! -### Using UV (Recommended) -```bash -uv tool install codegen --python 3.13 -``` -### Using Pipx - - -Pipx is not officially supported by Codegen, but it should still work. - - -```bash -pipx install codegen -``` - - -For further & more in depth installation instructions, see the [installation guide](/introduction/installation). - - -## What can I do with Codegen? - -Codegen's simple yet powerful APIs enable a range of applications, including: - - - - Create an intelligent agent that can analyze and manipulate your codebase using natural language. - - - Generate interactive visualizations of your codebase's structure, dependencies, and relationships. - - - Create high-quality training data for fine-tuning LLMs on your codebase. - - - Create powerful code transformations to automate large-scale changes. - - - -See below for an example call graph visualization generated with Codegen. - - - - - -View source code on [modal/modal-client](https://github.com/modal-labs/modal-client/blob/cbac0d80dfd98588027ecd21850152776be3ab82/modal/client.py#L70). View codemod on [codegen.sh](https://www.codegen.sh/codemod/66e2e195-ceec-4935-876a-ed4cfc1731c7/public/diff) - - -## Get Started - -import { - COMMUNITY_SLACK_URL, - CODEGEN_SDK_GITHUB_URL, -} from "/snippets/links.mdx"; - - - - Follow our step-by-step tutorial to start manipulating code with Codegen. - - - Learn how to use Codegen for common code transformation tasks. - - - Star us on GitHub and contribute to the project. - - - Get help and connect with the Codegen community. - - - -## Why Codegen? - -Many software engineering tasks - refactors, enforcing patterns, analyzing control flow, etc. - are fundamentally programmatic operations. Yet the tools we use to express these transformations often feel disconnected from how we think about code. - -Codegen was engineered backwards from real-world refactors we performed for enterprises at [Codegen, Inc.](/introduction/about). Instead of starting with theoretical abstractions, we built the set of APIs that map directly to how humans and AI think about code changes: - -- **Natural Mental Model**: Express transformations through high-level operations that match how you reason about code changes, not low-level text or AST manipulation. -- **Clean Business Logic**: Let the engine handle the complexities of imports, references, and cross-file dependencies. -- **Scale with Confidence**: Make sweeping changes across large codebases consistently across Python, TypeScript, JavaScript, and React. - -As AI becomes increasingly sophisticated, we're seeing a fascinating shift: AI agents aren't bottlenecked by their ability to understand code or generate solutions. Instead, they're limited by their ability to efficiently manipulate codebases. The challenge isn't the "brain" - it's the "hands." - -We built Codegen with a key insight: future AI agents will need to ["act via code,"](/blog/act-via-code) building their own sophisticated tools for code manipulation. Rather than generating diffs or making direct text changes, these agents will: - -1. Express transformations as composable programs -2. Build higher-level tools by combining primitive operations -3. Create and maintain their own abstractions for common patterns - -This creates a shared language that both humans and AI can reason about effectively, making code changes more predictable, reviewable, and maintainable. Whether you're a developer writing a complex refactoring script or an AI agent building transformation tools, Codegen provides the foundation for expressing code changes as they should be: through code itself. diff --git a/docs/introduction/python-agents.mdx b/docs/introduction/python-agents.mdx new file mode 100644 index 000000000..ec9703723 --- /dev/null +++ b/docs/introduction/python-agents.mdx @@ -0,0 +1,62 @@ +--- +title: "Python Agents" +sidebarTitle: "Python SDK" +icon: "code" +iconType: "solid" +--- + +The Codegen Python SDK provides a simple way to programmatically interact with Codegen agents from your own scripts and applications. + +## Prerequisites + +1. **Installation:** Make sure you have the `codegen` package installed in your Python environment. Follow the steps in the [Installation guide](/introduction/installation). +2. **Authentication:** Ensure you have authenticated the CLI by running `codegen login`. The SDK will use these credentials. + +## Basic Usage + +Running an agent involves importing the library, instantiating an `Agent`, and calling its `run` method with your prompt and target codebase. + +```python +import codegen + +# Ensure you are authenticated (run `codegen login` first) + +# Instantiate the agent +agent = codegen.Agent() + +# Define the prompt and target codebase +prompt = "Refactor the main function in main.py to be more modular and add docstrings." +# Can be a GitHub repo (owner/repo) or a local path +codebase_target = "your_github_username/your_repository_name" +# codebase_target = "/path/to/your/local/project" + +# Run the agent (add error handling in production) +result = agent.run( + prompt=prompt, + codebase=codebase_target +) + +# Process the result +print("Agent run completed.") + +# Example: Check if the agent created a Pull Request +if hasattr(result, 'pr_url') and result.pr_url: + print(f"Pull Request created: {result.pr_url}") +else: + # You might check other attributes or logs depending on the agent's task + print("Check agent output or logs for more details.") + +``` + +### Explanation + +1. **`import codegen`**: Imports the necessary library. +2. **`agent = codegen.Agent()`**: Creates an instance of the Codegen agent. +3. **`agent.run(prompt=..., codebase=...)`**: Executes the agent. + * The `prompt` tells the agent what task to perform. + * The `codebase` specifies the target code, which can be a GitHub repository reference (`owner/repo`) or a path to a local directory. +4. **`result`**: The object returned by `run` contains information about the execution outcome. This might include URLs (like `pr_url` if a pull request was generated), summaries of changes, or status indicators. The exact attributes depend on the task performed by the agent. + +## Next Steps + +With the SDK, you can integrate Codegen agents into your CI/CD pipelines, custom developer tools, or other automated workflows. Explore the different ways you can prompt the agent and leverage integrations like [Slack](/introduction/getting-started) and [Linear](/introduction/getting-started). diff --git a/docs/mint.json b/docs/mint.json index 737c098ee..ddb4906f6 100644 --- a/docs/mint.json +++ b/docs/mint.json @@ -1,396 +1,393 @@ { - "$schema": "https://mintlify.com/schema.json", - "name": "Codegen", - "logo": { - "dark": "https://cdn.prod.website-files.com/67070304751b9b01bf6a161c/679bcf45a3e32761c42b324b_Codegen_Logomark_Dark.svg", - "light": "https://cdn.prod.website-files.com/67070304751b9b01bf6a161c/679bcf45bf55446746125835_Codegen_Logomark_Light.svg" - }, - "modeToggle": { - "default": "dark" - }, - "metadata": { - "og:site_name": "Codegen", - "og:title": "Codegen - Manipulate Code at Scale", - "og:description": "A scriptable interface to a powerful, multi-lingual language server built on top of Tree-sitter.", - "og:url": "https://docs.codegen.com", - "og:locale": "en_US", - "og:logo": "https://i.imgur.com/f4OVOqI.png", - "article:publisher": "Codegen, Inc.", - "twitter:site": "@codegen" - }, - "favicon": "/favicon.svg", - "colors": { - "primary": "#a277ff", - "light": "#a277ff", - "dark": "#a277ff", - "anchors": { - "from": "#61ffca", - "to": "#61ffca" - } - }, - "theme": "prism", - "background": { - "style": "gradient" - }, - "analytics": { - "posthog": { - "apiKey": "phc_GLxaINoQJnuyCyxDmTciQqzdKBYFVDkY7bRBO4bDdso" - } - }, - "feedback": { - "thumbsRating": true - }, - "topbarCtaButton": { - "name": "GitHub", - "url": "https://github.com/codegen-sh/codegen-sdk" - }, - "tabs": [ - { - "name": "API Reference", - "url": "/api-reference" - }, - { - "name": "CLI", - "url": "/cli" - }, - { - "name": "Blog", - "url": "/blog" - }, - { - "name": "Changelog", - "url": "/changelog" - }, - { - "name": "codegen", - "url": "/gen" - } - ], - "navigation": [ - { - "group": "Introduction", - "pages": [ - "introduction/overview", - "introduction/getting-started", - "introduction/installation", - "introduction/ide-usage", - "introduction/work-with-ai", - "introduction/how-it-works", - "introduction/advanced-settings", - "introduction/guiding-principles", - "introduction/community", - "introduction/about", - "introduction/faq" - ] - }, - { - "group": "Tutorials", - "pages": [ - "tutorials/at-a-glance", - "tutorials/build-code-agent", - "tutorials/slack-bot", - "tutorials/github-review-bot", - "tutorials/deep-code-research", - "tutorials/codebase-analytics-dashboard", - "tutorials/training-data", - "tutorials/codebase-visualization", - "tutorials/migrating-apis", - "tutorials/organize-your-codebase", - "tutorials/promise-to-async-await", - "tutorials/modularity", - "tutorials/manage-feature-flags", - "tutorials/deleting-dead-code", - "tutorials/increase-type-coverage", - "tutorials/managing-typescript-exports", - "tutorials/converting-default-exports", - "tutorials/creating-documentation", - "tutorials/react-modernization", - "tutorials/unittest-to-pytest", - "tutorials/sqlalchemy-1.6-to-2.0", - "tutorials/fixing-import-loops-in-pytorch", - "tutorials/python2-to-python3", - "tutorials/flask-to-fastapi", - "tutorials/build-mcp", - "tutorials/neo4j-graph", - "tutorials/attributions" - ] - }, - { - "group": "Building with Codegen", - "pages": [ - "building-with-codegen/at-a-glance", - "building-with-codegen/parsing-codebases", - "building-with-codegen/reusable-codemods", - "building-with-codegen/dot-codegen", - "building-with-codegen/function-decorator", - "building-with-codegen/language-support", - "building-with-codegen/commit-and-reset", - "building-with-codegen/git-operations", - "building-with-codegen/files-and-directories", - "building-with-codegen/the-editable-api", - "building-with-codegen/symbol-api", - "building-with-codegen/class-api", - "building-with-codegen/imports", - "building-with-codegen/exports", - "building-with-codegen/inheritable-behaviors", - "building-with-codegen/statements-and-code-blocks", - "building-with-codegen/dependencies-and-usages", - "building-with-codegen/function-calls-and-callsites", - "building-with-codegen/variable-assignments", - "building-with-codegen/local-variables", - "building-with-codegen/comments-and-docstrings", - "building-with-codegen/external-modules", - "building-with-codegen/type-annotations", - "building-with-codegen/moving-symbols", - "building-with-codegen/collections", - "building-with-codegen/traversing-the-call-graph", - "building-with-codegen/react-and-jsx", - "building-with-codegen/codebase-visualization", - "building-with-codegen/flagging-symbols", - "building-with-codegen/calling-out-to-llms", - "building-with-codegen/semantic-code-search", - "building-with-codegen/reducing-conditions" - ] - }, - { - "group": "CLI", - "pages": [ - "cli/about", - "cli/init", - "cli/notebook", - "cli/create", - "cli/run", - "cli/reset", - "cli/expert" - ] - }, - { - "group": "Changelog", - "pages": [ - "changelog/changelog" - ] - }, - { - "group": "Blog", - "pages": [ - "blog/posts", - "blog/devin", - "blog/act-via-code", - "blog/promise-to-async-await-twilio", - "blog/fixing-import-loops" - ] - }, - { - "group": "codegen", - "pages": [ - "gen/introduction", - "gen/capabilities", - "gen/integrations", - "gen/faq" - ] - }, - { - "group": "API Reference", - "pages": [ - "api-reference/index", - { - "group": "Core", - "icon": "code", - "pages": [ - "api-reference/core/Argument", - "api-reference/core/Assignment", - "api-reference/core/AssignmentStatement", - "api-reference/core/Attribute", - "api-reference/core/AwaitExpression", - "api-reference/core/BinaryExpression", - "api-reference/core/BlockStatement", - "api-reference/core/Boolean", - "api-reference/core/Callable", - "api-reference/core/CatchStatement", - "api-reference/core/ChainedAttribute", - "api-reference/core/Class", - "api-reference/core/CodeBlock", - "api-reference/core/CodeOwner", - "api-reference/core/Codebase", - "api-reference/core/Comment", - "api-reference/core/CommentGroup", - "api-reference/core/ComparisonExpression", - "api-reference/core/Decorator", - "api-reference/core/Dict", - "api-reference/core/Directory", - "api-reference/core/Editable", - "api-reference/core/Export", - "api-reference/core/ExportStatement", - "api-reference/core/Exportable", - "api-reference/core/Expression", - "api-reference/core/ExpressionGroup", - "api-reference/core/ExpressionStatement", - "api-reference/core/ExternalModule", - "api-reference/core/File", - "api-reference/core/FlagKwargs", - "api-reference/core/ForLoopStatement", - "api-reference/core/Function", - "api-reference/core/FunctionCall", - "api-reference/core/GenericType", - "api-reference/core/HasBlock", - "api-reference/core/HasName", - "api-reference/core/HasValue", - "api-reference/core/IfBlockStatement", - "api-reference/core/Import", - "api-reference/core/ImportStatement", - "api-reference/core/ImportType", - "api-reference/core/Importable", - "api-reference/core/Interface", - "api-reference/core/List", - "api-reference/core/MessageType", - "api-reference/core/MultiExpression", - "api-reference/core/MultiLineCollection", - "api-reference/core/Name", - "api-reference/core/NamedType", - "api-reference/core/NoneType", - "api-reference/core/Number", - "api-reference/core/Pair", - "api-reference/core/Parameter", - "api-reference/core/ParenthesizedExpression", - "api-reference/core/Placeholder", - "api-reference/core/PlaceholderType", - "api-reference/core/RaiseStatement", - "api-reference/core/ReturnStatement", - "api-reference/core/SourceFile", - "api-reference/core/Span", - "api-reference/core/Statement", - "api-reference/core/StatementType", - "api-reference/core/String", - "api-reference/core/StubPlaceholder", - "api-reference/core/SubscriptExpression", - "api-reference/core/SwitchCase", - "api-reference/core/SwitchStatement", - "api-reference/core/Symbol", - "api-reference/core/SymbolGroup", - "api-reference/core/SymbolStatement", - "api-reference/core/TernaryExpression", - "api-reference/core/TryCatchStatement", - "api-reference/core/Tuple", - "api-reference/core/TupleType", - "api-reference/core/Type", - "api-reference/core/TypeAlias", - "api-reference/core/TypePlaceholder", - "api-reference/core/Typeable", - "api-reference/core/UnaryExpression", - "api-reference/core/UnionType", - "api-reference/core/Unpack", - "api-reference/core/Unwrappable", - "api-reference/core/Usable", - "api-reference/core/Usage", - "api-reference/core/UsageKind", - "api-reference/core/UsageType", - "api-reference/core/Value", - "api-reference/core/WhileStatement", - "api-reference/core/WithStatement" - ] - }, - { - "group": "Python", - "icon": "python", - "pages": [ - "api-reference/python/PyAssignment", - "api-reference/python/PyAssignmentStatement", - "api-reference/python/PyAttribute", - "api-reference/python/PyBlockStatement", - "api-reference/python/PyBreakStatement", - "api-reference/python/PyCatchStatement", - "api-reference/python/PyChainedAttribute", - "api-reference/python/PyClass", - "api-reference/python/PyCodeBlock", - "api-reference/python/PyComment", - "api-reference/python/PyCommentGroup", - "api-reference/python/PyCommentType", - "api-reference/python/PyConditionalExpression", - "api-reference/python/PyDecorator", - "api-reference/python/PyFile", - "api-reference/python/PyForLoopStatement", - "api-reference/python/PyFunction", - "api-reference/python/PyGenericType", - "api-reference/python/PyHasBlock", - "api-reference/python/PyIfBlockStatement", - "api-reference/python/PyImport", - "api-reference/python/PyImportStatement", - "api-reference/python/PyMatchCase", - "api-reference/python/PyMatchStatement", - "api-reference/python/PyNamedType", - "api-reference/python/PyParameter", - "api-reference/python/PyPassStatement", - "api-reference/python/PyReturnTypePlaceholder", - "api-reference/python/PyString", - "api-reference/python/PySymbol", - "api-reference/python/PyTryCatchStatement", - "api-reference/python/PyUnionType", - "api-reference/python/PyWhileStatement" - ] - }, - { - "group": "Typescript", - "icon": "js", - "pages": [ - "api-reference/typescript/JSXElement", - "api-reference/typescript/JSXExpression", - "api-reference/typescript/JSXProp", - "api-reference/typescript/TSArrayType", - "api-reference/typescript/TSAssignment", - "api-reference/typescript/TSAssignmentStatement", - "api-reference/typescript/TSAttribute", - "api-reference/typescript/TSBlockStatement", - "api-reference/typescript/TSCatchStatement", - "api-reference/typescript/TSChainedAttribute", - "api-reference/typescript/TSClass", - "api-reference/typescript/TSCodeBlock", - "api-reference/typescript/TSComment", - "api-reference/typescript/TSCommentGroup", - "api-reference/typescript/TSCommentType", - "api-reference/typescript/TSConditionalType", - "api-reference/typescript/TSConfig", - "api-reference/typescript/TSDecorator", - "api-reference/typescript/TSDict", - "api-reference/typescript/TSEnum", - "api-reference/typescript/TSExport", - "api-reference/typescript/TSExpressionType", - "api-reference/typescript/TSFile", - "api-reference/typescript/TSForLoopStatement", - "api-reference/typescript/TSFunction", - "api-reference/typescript/TSFunctionType", - "api-reference/typescript/TSGenericType", - "api-reference/typescript/TSHasBlock", - "api-reference/typescript/TSIfBlockStatement", - "api-reference/typescript/TSImport", - "api-reference/typescript/TSImportStatement", - "api-reference/typescript/TSInterface", - "api-reference/typescript/TSLabeledStatement", - "api-reference/typescript/TSLookupType", - "api-reference/typescript/TSNamedType", - "api-reference/typescript/TSNamespace", - "api-reference/typescript/TSObjectType", - "api-reference/typescript/TSPair", - "api-reference/typescript/TSParameter", - "api-reference/typescript/TSQueryType", - "api-reference/typescript/TSReadonlyType", - "api-reference/typescript/TSReturnTypePlaceholder", - "api-reference/typescript/TSString", - "api-reference/typescript/TSSwitchCase", - "api-reference/typescript/TSSwitchStatement", - "api-reference/typescript/TSSymbol", - "api-reference/typescript/TSTernaryExpression", - "api-reference/typescript/TSTryCatchStatement", - "api-reference/typescript/TSTypeAlias", - "api-reference/typescript/TSUndefinedType", - "api-reference/typescript/TSUnionType", - "api-reference/typescript/TSWhileStatement" - ] - } - ] - } - ], - "footerSocials": { - "x": "https://x.com/codegen", - "linkedin": "https://linkedin.com/company/codegen-dot-com" - } -} \ No newline at end of file + "$schema": "https://mintlify.com/schema.json", + "name": "Codegen", + "logo": { + "dark": "https://cdn.prod.website-files.com/67070304751b9b01bf6a161c/679bcf45a3e32761c42b324b_Codegen_Logomark_Dark.svg", + "light": "https://cdn.prod.website-files.com/67070304751b9b01bf6a161c/679bcf45bf55446746125835_Codegen_Logomark_Light.svg" + }, + "modeToggle": { + "default": "dark" + }, + "metadata": { + "og:site_name": "Codegen", + "og:title": "Codegen - AI-driven Development", + "og:description": "Deploy code agents across code, Slack, Github and Linear", + "og:url": "https://docs.codegen.com", + "og:locale": "en_US", + "og:logo": "https://i.imgur.com/f4OVOqI.png", + "article:publisher": "Codegen, Inc.", + "twitter:site": "@codegen" + }, + "favicon": "/favicon.svg", + "colors": { + "primary": "#a277ff", + "light": "#a277ff", + "dark": "#a277ff", + "anchors": { + "from": "#61ffca", + "to": "#61ffca" + } + }, + "theme": "prism", + "background": { + "style": "gradient" + }, + "analytics": { + "posthog": { + "apiKey": "phc_GLxaINoQJnuyCyxDmTciQqzdKBYFVDkY7bRBO4bDdso" + } + }, + "feedback": { + "thumbsRating": true + }, + "topbarCtaButton": { + "name": "GitHub", + "url": "https://github.com/codegen-sh/codegen" + }, + "tabs": [ + { + "name": "API Reference", + "url": "/api-reference" + }, + { + "name": "CLI", + "url": "/cli" + }, + { + "name": "Blog", + "url": "/blog" + }, + { + "name": "Changelog", + "url": "/changelog" + }, + { + "name": "codegen", + "url": "/gen" + } + ], + "navigation": [ + { + "group": "Introduction", + "pages": [ + "introduction/overview", + "introduction/getting-started", + "introduction/installation", + "introduction/how-it-works", + "introduction/python-agents", + "introduction/advanced-settings", + "introduction/guiding-principles", + "introduction/community", + "introduction/about", + "introduction/faq" + ] + }, + { + "group": "Tutorials", + "pages": [ + "tutorials/at-a-glance", + "tutorials/build-code-agent", + "tutorials/slack-bot", + "tutorials/github-review-bot", + "tutorials/deep-code-research", + "tutorials/codebase-analytics-dashboard", + "tutorials/training-data", + "tutorials/codebase-visualization", + "tutorials/migrating-apis", + "tutorials/organize-your-codebase", + "tutorials/promise-to-async-await", + "tutorials/modularity", + "tutorials/manage-feature-flags", + "tutorials/deleting-dead-code", + "tutorials/increase-type-coverage", + "tutorials/managing-typescript-exports", + "tutorials/converting-default-exports", + "tutorials/creating-documentation", + "tutorials/react-modernization", + "tutorials/unittest-to-pytest", + "tutorials/sqlalchemy-1.6-to-2.0", + "tutorials/fixing-import-loops-in-pytorch", + "tutorials/python2-to-python3", + "tutorials/flask-to-fastapi", + "tutorials/build-mcp", + "tutorials/neo4j-graph", + "tutorials/attributions" + ] + }, + { + "group": "Building with Codegen", + "pages": [ + "building-with-codegen/at-a-glance", + "building-with-codegen/parsing-codebases", + "building-with-codegen/reusable-codemods", + "building-with-codegen/dot-codegen", + "building-with-codegen/function-decorator", + "building-with-codegen/language-support", + "building-with-codegen/commit-and-reset", + "building-with-codegen/git-operations", + "building-with-codegen/files-and-directories", + "building-with-codegen/the-editable-api", + "building-with-codegen/symbol-api", + "building-with-codegen/class-api", + "building-with-codegen/imports", + "building-with-codegen/exports", + "building-with-codegen/inheritable-behaviors", + "building-with-codegen/statements-and-code-blocks", + "building-with-codegen/dependencies-and-usages", + "building-with-codegen/function-calls-and-callsites", + "building-with-codegen/variable-assignments", + "building-with-codegen/local-variables", + "building-with-codegen/comments-and-docstrings", + "building-with-codegen/external-modules", + "building-with-codegen/type-annotations", + "building-with-codegen/moving-symbols", + "building-with-codegen/collections", + "building-with-codegen/traversing-the-call-graph", + "building-with-codegen/react-and-jsx", + "building-with-codegen/codebase-visualization", + "building-with-codegen/flagging-symbols", + "building-with-codegen/calling-out-to-llms", + "building-with-codegen/semantic-code-search", + "building-with-codegen/reducing-conditions" + ] + }, + { + "group": "CLI", + "pages": [ + "cli/about", + "cli/init", + "cli/notebook", + "cli/create", + "cli/run", + "cli/reset", + "cli/expert" + ] + }, + { + "group": "Changelog", + "pages": ["changelog/changelog"] + }, + { + "group": "Blog", + "pages": [ + "blog/posts", + "blog/devin", + "blog/act-via-code", + "blog/promise-to-async-await-twilio", + "blog/fixing-import-loops" + ] + }, + { + "group": "codegen", + "pages": [ + "gen/introduction", + "gen/capabilities", + "gen/integrations", + "gen/faq" + ] + }, + { + "group": "API Reference", + "pages": [ + "api-reference/index", + { + "group": "Core", + "icon": "code", + "pages": [ + "api-reference/core/Argument", + "api-reference/core/Assignment", + "api-reference/core/AssignmentStatement", + "api-reference/core/Attribute", + "api-reference/core/AwaitExpression", + "api-reference/core/BinaryExpression", + "api-reference/core/BlockStatement", + "api-reference/core/Boolean", + "api-reference/core/Callable", + "api-reference/core/CatchStatement", + "api-reference/core/ChainedAttribute", + "api-reference/core/Class", + "api-reference/core/CodeBlock", + "api-reference/core/CodeOwner", + "api-reference/core/Codebase", + "api-reference/core/Comment", + "api-reference/core/CommentGroup", + "api-reference/core/ComparisonExpression", + "api-reference/core/Decorator", + "api-reference/core/Dict", + "api-reference/core/Directory", + "api-reference/core/Editable", + "api-reference/core/Export", + "api-reference/core/ExportStatement", + "api-reference/core/Exportable", + "api-reference/core/Expression", + "api-reference/core/ExpressionGroup", + "api-reference/core/ExpressionStatement", + "api-reference/core/ExternalModule", + "api-reference/core/File", + "api-reference/core/FlagKwargs", + "api-reference/core/ForLoopStatement", + "api-reference/core/Function", + "api-reference/core/FunctionCall", + "api-reference/core/GenericType", + "api-reference/core/HasBlock", + "api-reference/core/HasName", + "api-reference/core/HasValue", + "api-reference/core/IfBlockStatement", + "api-reference/core/Import", + "api-reference/core/ImportStatement", + "api-reference/core/ImportType", + "api-reference/core/Importable", + "api-reference/core/Interface", + "api-reference/core/List", + "api-reference/core/MessageType", + "api-reference/core/MultiExpression", + "api-reference/core/MultiLineCollection", + "api-reference/core/Name", + "api-reference/core/NamedType", + "api-reference/core/NoneType", + "api-reference/core/Number", + "api-reference/core/Pair", + "api-reference/core/Parameter", + "api-reference/core/ParenthesizedExpression", + "api-reference/core/Placeholder", + "api-reference/core/PlaceholderType", + "api-reference/core/RaiseStatement", + "api-reference/core/ReturnStatement", + "api-reference/core/SourceFile", + "api-reference/core/Span", + "api-reference/core/Statement", + "api-reference/core/StatementType", + "api-reference/core/String", + "api-reference/core/StubPlaceholder", + "api-reference/core/SubscriptExpression", + "api-reference/core/SwitchCase", + "api-reference/core/SwitchStatement", + "api-reference/core/Symbol", + "api-reference/core/SymbolGroup", + "api-reference/core/SymbolStatement", + "api-reference/core/TernaryExpression", + "api-reference/core/TryCatchStatement", + "api-reference/core/Tuple", + "api-reference/core/TupleType", + "api-reference/core/Type", + "api-reference/core/TypeAlias", + "api-reference/core/TypePlaceholder", + "api-reference/core/Typeable", + "api-reference/core/UnaryExpression", + "api-reference/core/UnionType", + "api-reference/core/Unpack", + "api-reference/core/Unwrappable", + "api-reference/core/Usable", + "api-reference/core/Usage", + "api-reference/core/UsageKind", + "api-reference/core/UsageType", + "api-reference/core/Value", + "api-reference/core/WhileStatement", + "api-reference/core/WithStatement" + ] + }, + { + "group": "Python", + "icon": "python", + "pages": [ + "api-reference/python/PyAssignment", + "api-reference/python/PyAssignmentStatement", + "api-reference/python/PyAttribute", + "api-reference/python/PyBlockStatement", + "api-reference/python/PyBreakStatement", + "api-reference/python/PyCatchStatement", + "api-reference/python/PyChainedAttribute", + "api-reference/python/PyClass", + "api-reference/python/PyCodeBlock", + "api-reference/python/PyComment", + "api-reference/python/PyCommentGroup", + "api-reference/python/PyCommentType", + "api-reference/python/PyConditionalExpression", + "api-reference/python/PyDecorator", + "api-reference/python/PyFile", + "api-reference/python/PyForLoopStatement", + "api-reference/python/PyFunction", + "api-reference/python/PyGenericType", + "api-reference/python/PyHasBlock", + "api-reference/python/PyIfBlockStatement", + "api-reference/python/PyImport", + "api-reference/python/PyImportStatement", + "api-reference/python/PyMatchCase", + "api-reference/python/PyMatchStatement", + "api-reference/python/PyNamedType", + "api-reference/python/PyParameter", + "api-reference/python/PyPassStatement", + "api-reference/python/PyReturnTypePlaceholder", + "api-reference/python/PyString", + "api-reference/python/PySymbol", + "api-reference/python/PyTryCatchStatement", + "api-reference/python/PyUnionType", + "api-reference/python/PyWhileStatement" + ] + }, + { + "group": "Typescript", + "icon": "js", + "pages": [ + "api-reference/typescript/JSXElement", + "api-reference/typescript/JSXExpression", + "api-reference/typescript/JSXProp", + "api-reference/typescript/TSArrayType", + "api-reference/typescript/TSAssignment", + "api-reference/typescript/TSAssignmentStatement", + "api-reference/typescript/TSAttribute", + "api-reference/typescript/TSBlockStatement", + "api-reference/typescript/TSCatchStatement", + "api-reference/typescript/TSChainedAttribute", + "api-reference/typescript/TSClass", + "api-reference/typescript/TSCodeBlock", + "api-reference/typescript/TSComment", + "api-reference/typescript/TSCommentGroup", + "api-reference/typescript/TSCommentType", + "api-reference/typescript/TSConditionalType", + "api-reference/typescript/TSConfig", + "api-reference/typescript/TSDecorator", + "api-reference/typescript/TSDict", + "api-reference/typescript/TSEnum", + "api-reference/typescript/TSExport", + "api-reference/typescript/TSExpressionType", + "api-reference/typescript/TSFile", + "api-reference/typescript/TSForLoopStatement", + "api-reference/typescript/TSFunction", + "api-reference/typescript/TSFunctionType", + "api-reference/typescript/TSGenericType", + "api-reference/typescript/TSHasBlock", + "api-reference/typescript/TSIfBlockStatement", + "api-reference/typescript/TSImport", + "api-reference/typescript/TSImportStatement", + "api-reference/typescript/TSInterface", + "api-reference/typescript/TSLabeledStatement", + "api-reference/typescript/TSLookupType", + "api-reference/typescript/TSNamedType", + "api-reference/typescript/TSNamespace", + "api-reference/typescript/TSObjectType", + "api-reference/typescript/TSPair", + "api-reference/typescript/TSParameter", + "api-reference/typescript/TSQueryType", + "api-reference/typescript/TSReadonlyType", + "api-reference/typescript/TSReturnTypePlaceholder", + "api-reference/typescript/TSString", + "api-reference/typescript/TSSwitchCase", + "api-reference/typescript/TSSwitchStatement", + "api-reference/typescript/TSSymbol", + "api-reference/typescript/TSTernaryExpression", + "api-reference/typescript/TSTryCatchStatement", + "api-reference/typescript/TSTypeAlias", + "api-reference/typescript/TSUndefinedType", + "api-reference/typescript/TSUnionType", + "api-reference/typescript/TSWhileStatement" + ] + } + ] + } + ], + "footerSocials": { + "x": "https://x.com/codegen", + "linkedin": "https://linkedin.com/company/codegen-dot-com" + } +}