You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Motivation
<!-- Why is this change necessary? -->
# Content
<!-- Please include a summary of the change -->
# Testing
<!-- How was the change tested? -->
# Please check the following before marking your PR as ready for review
- [ ] I have added tests for my changes
- [ ] I have updated the documentation or added new documentation as
needed
- [ ] I have read and agree to the [Contributor License
Agreement](../CLA.md)
---------
Co-authored-by: codegen-bot <team+codegenbot@codegen.sh>
Copy file name to clipboardExpand all lines: docs/introduction/getting-started.mdx
+9-33Lines changed: 9 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,68 +15,44 @@ Install [codegen](https://pypi.org/project/codegen/) on Pypi via [uv](https://gi
15
15
uv tool install codegen
16
16
```
17
17
18
-
<Note>
19
-
This makes the `codegen` command available globally in your terminal, while
20
-
keeping its dependencies isolated.
21
-
</Note>
22
-
23
-
24
18
## Quick Start with Jupyter
25
19
26
20
The [codgen 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.
27
21
28
-
<Tip>
29
-
Prefer working in your IDE? See [IDE Usage](/introduction/ide-usage)
30
-
</Tip>
31
-
32
-
33
22
```bash
34
-
# Navigate to your repository
35
-
cd path/to/git/repository
36
-
37
-
# Initialize codegen and launch Jupyter with a demo notebook
23
+
# Launch Jupyter with a demo notebook
38
24
codegen notebook --demo
39
25
```
40
26
41
-
This will:
42
-
43
-
1. Create a `.codegen/` directory with:
44
-
-`.venv/` - A dedicated virtual environment for this project
45
-
-`jupyter/` - Jupyter notebooks for exploring your code
46
-
-`config.toml` - Project configuration
47
-
2. Launch Jupyter Lab with a pre-configured notebook
48
27
49
28
<Tip>
50
-
The `notebook --demo` comes pre-configured to load [FastAPI](https://github.com/fastapi/fastapi)'s codebase, so you can start
29
+
The `notebook --demo` comes pre-configured to load [FastAPI](https://github.com/fastapi/fastapi)'s codebase, so you can start
51
30
exploring right away!
52
31
</Tip>
53
32
33
+
<Note>
34
+
Prefer working in your IDE? See [IDE Usage](/introduction/ide-usage)
35
+
</Note>
36
+
54
37
## Initializing a Codebase
55
38
56
39
Instantiating a [Codebase](/api-reference/core/Codebase) will automatically parse a codebase and make it available for manipulation.
57
40
58
41
```python
59
42
from codegen import Codebase
60
43
61
-
# Initialize FastAPI codebase
62
-
print('Cloning and parsing FastAPI to /tmp/codegen/fastapi...')
44
+
# Clone + parse fastapi/fastapi
63
45
codebase = Codebase.from_repo('fastapi/fastapi')
64
46
65
-
#To initialize an existing local codebase, use this constructor
66
-
#codebase = Codebase("path/to/git/repo")
47
+
#Or, parse a local repository
48
+
codebase = Codebase("path/to/git/repo")
67
49
```
68
50
69
51
<Note>
70
52
This will automatically infer the programming language of the codebase and
71
53
parse all files in the codebase. Learn more about [parsing codebases here](/building-with-codegen/parsing-codebases)
72
54
</Note>
73
55
74
-
<Tip>
75
-
The initial parse may take a few minutes for large codebases. This
76
-
pre-computation enables constant-time operations afterward. [Learn more
0 commit comments