Skip to content

docs: fix initialization #504

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 1 commit into from
Feb 14, 2025
Merged
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
13 changes: 4 additions & 9 deletions docs/building-with-codegen/parsing-codebases.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,12 @@ codebase = Codebase("./", language="typescript")
To fetch and parse a repository directly from GitHub, use the `from_repo` function.

```python
import codegen

from codegen import Codebase
# Fetch and parse a repository (defaults to /tmp/codegen/{repo_name})
codebase = codegen.from_repo('fastapi/fastapi')
codebase = Codebase.from_repo('fastapi/fastapi')

# Customize temp directory, clone depth, specific commit, or programming language
codebase = codegen.from_repo(
codebase = Codebase.from_repo(
'fastapi/fastapi',
tmp_dir='/custom/temp/dir', # Optional: custom temp directory
commit='786a8ada7ed0c7f9d8b04d49f24596865e4b7901', # Optional: specific commit
Expand All @@ -70,18 +69,14 @@ You can customize the behavior of your Codebase instance by passing a `CodebaseC

```python
from codegen import Codebase
from codegen.sdk.codebase.config import CodebaseConfig, GSFeatureFlags, Secrets
from codegen.sdk.codebase.config import CodebaseConfig, Secrets

codebase = Codebase(
"path/to/repository",
config=CodebaseConfig(
secrets=Secrets(
openai_key="your-openai-key" # For AI-powered features
),
feature_flags=GSFeatureFlags(
sync_enabled=True, # Enable graph synchronization
... # Add other feature flags as needed
)
)
)
```
Expand Down
Loading