Skip to content

Commit a1a2027

Browse files
author
codegen-bot
committed
.
1 parent 73be8af commit a1a2027

File tree

4 files changed

+27
-62
lines changed

4 files changed

+27
-62
lines changed

docs/building-with-codegen/symbol-api.mdx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ icon: "shapes"
55
iconType: "solid"
66
---
77

8-
The [`Symbol`](/api-reference/core/Symbol) is the primary way developers interact with code in Codegen. It maps to how developers think about code - as functions, classes, variables, and other named entities.
8+
The [Symbol](/api-reference/core/Symbol) is the primary way developers interact with code in Codegen. It maps to how developers think about code - as functions, classes, variables, and other named entities.
99

10-
Both the [`Function`](/api-reference/core/Function) and [`Class`](/api-reference/core/Class) symbols are subclasses of the [`Symbol`](/api-reference/core/Symbol) class.
10+
Both the [Function](/api-reference/core/Function) and [Class](/api-reference/core/Class) symbols are subclasses of the [Symbol](/api-reference/core/Symbol) class.
1111

1212
## Accessing Symbols
1313

14-
The [`Codebase`](/api-reference/core/Codebase) class provides getters and iterators for functions, classes and symbols:
14+
The [Codebase](/api-reference/core/Codebase) class provides getters and iterators for functions, classes and symbols:
1515

1616
```python
1717
# Core symbol types
@@ -32,17 +32,17 @@ for symbol in codebase.functions + codebase.classes:
3232

3333
All symbols share common APIs for manipulation:
3434

35-
- The [`Editable`](/api-reference/core/Editable) API
35+
- The [Editable](/api-reference/core/Editable) API
3636
- Metadata
37-
- [`symbol.name`](/api-reference/core/Symbol#name)
38-
- [`symbol.source`](/api-reference/core/Symbol#source)
39-
- [`symbol.docstring`](/api-reference/core/Symbol#docstring)
37+
- [symbol.name](/api-reference/core/Symbol#name)
38+
- [symbol.source](/api-reference/core/Symbol#source)
39+
- [symbol.docstring](/api-reference/core/Symbol#docstring)
4040
- Edit operations
41-
- [`symbol.set_docstring`](/api-reference/core/Symbol#add_comment)
42-
- [`symbol.move_to_file`](/api-reference/core/Symbol#move-to-file) (see [Moving Symbols](/building-with-codegen/moving-symbols))
41+
- [symbol.set_docstring](/api-reference/core/Symbol#add_comment)
42+
- [symbol.move_to_file](/api-reference/core/Symbol#move-to-file) (see [Moving Symbols](/building-with-codegen/moving-symbols))
4343
- Graph relations (See [Usages and Dependencies](/building-with-codegen/dependencies-and-usages))
44-
- [`symbol.usages`](/api-reference/core/Symbol#usages)
45-
- [`symbol.dependencies`](/api-reference/core/Symbol#dependencies)
44+
- [symbol.usages](/api-reference/core/Symbol#usages)
45+
- [symbol.dependencies](/api-reference/core/Symbol#dependencies)
4646

4747
## Name operations
4848

docs/introduction/community.mdx

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -36,35 +36,6 @@ Join the growing Codegen community! We're excited to have you be part of our jou
3636
Please help us improve this library and documentation by submitting a PR!
3737
</Tip>
3838

39-
## Community Channels
40-
41-
### Slack
42-
43-
Our [Slack community](https://community.codegen.com) is where you can:
44-
45-
- Get help and support
46-
- Share your Codegen projects
47-
- Connect with other developers
48-
- Stay updated on new features
49-
50-
### GitHub
51-
52-
Codegen is [open source](https://github.com/codegen-sh/codegen-sdk) and we welcome contributions! On GitHub you can:
53-
54-
- Report issues
55-
- Submit pull requests
56-
- Star the project
57-
- Browse the source code
58-
59-
### Twitter (X)
60-
61-
Follow us on [Twitter/X](https://x.com/codegen) to:
62-
63-
- Get the latest updates
64-
- See community highlights
65-
- Connect with the team
66-
- Share your Codegen wins
67-
6839
## Contributing
6940

7041
We welcome contributions of all kinds! Whether you're fixing a typo in documentation, reporting a bug, or implementing a new feature, we appreciate your help in making Codegen better.
@@ -75,5 +46,3 @@ Check out our [Contributing Guide](https://github.com/codegen-sh/codegen-sdk/blo
7546
- Submit pull requests
7647
- Report issues
7748
- Contribute to documentation
78-
79-
Together, we can build better tools for code transformation!

docs/introduction/how-it-works.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Codegen performs advanced static analysis to build a rich graph representation o
2121

2222
## The Codebase Graph
2323

24-
At the heart of Codegen is a comprehensive graph representation of your code. When you initialize a `[Codebase](/api-reference/core/Codebase)`, it performs static analysis to construct a rich graph structure connecting code elements:
24+
At the heart of Codegen is a comprehensive graph representation of your code. When you initialize a [Codebase](/api-reference/core/Codebase), it performs static analysis to construct a rich graph structure connecting code elements:
2525

2626
```python
2727
# Initialize and analyze the codebase

docs/introduction/overview.mdx

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,16 @@ iconType: "solid"
99

1010
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/).
1111

12-
export const intoSnippet = `# grabs codebase content
13-
14-
file = codebase.files[0] # or .get_file("test.py")
15-
function = codebase.functions[0] # or .get_symbol("my_func")
16-
17-
# print logs
18-
19-
print(f'# of files: {len(codebase.files)}')
20-
print(f'# of functions: {len(codebase.functions)}')
21-
22-
# make edits
23-
24-
file.edit('🌈' + file.content) # edit contents
25-
function.rename('new_name') # rename
26-
function.set_docstring('new docstring') # set docstring
27-
28-
# ... etc.
29-
12+
export const intoSnippet = `# Codegen builds a complete graph connecting
13+
# functions, classes, imports and their relationships
14+
from codegen import Codebase
15+
16+
# Work with code without dealing with syntax trees or parsing
17+
for function in codebase.functions:
18+
# Comprehensive static analysis for references, dependencies, etc.
19+
if not function.usages:
20+
# Auto-handles references and imports to maintain correctness
21+
function.remove()
3022
`
3123

3224
<iframe
@@ -45,7 +37,11 @@ function.set_docstring('new docstring') # set docstring
4537
## Installation
4638

4739
```bash
40+
# Install CLI
4841
uv tool install codegen
42+
43+
# Install inside existing project
44+
pip install codegen
4945
```
5046

5147
## Get Started
@@ -86,7 +82,7 @@ Codegen was engineered backwards from real-world refactors we performed for ente
8682

8783
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."
8884

89-
We built Codegen with a key insight: future AI agents will need to ["act via code,"](https://voyager.minedojo.org/) building their own sophisticated tools for code manipulation. Rather than generating diffs or making direct text changes, these agents will:
85+
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:
9086

9187
1. Express transformations as composable programs
9288
2. Build higher-level tools by combining primitive operations

0 commit comments

Comments
 (0)