Skip to content

Commit 6b15d6b

Browse files
committed
update CLI references
1 parent 0a5fb3d commit 6b15d6b

File tree

35 files changed

+172
-172
lines changed

35 files changed

+172
-172
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,14 @@ uv tool install codegen --python 3.13
6161
6262
# Create a codemod for a given repo
6363
cd path/to/repo
64-
codegen init
65-
codegen create test-function
64+
gs init
65+
gs create test-function
6666
6767
# Run the codemod
68-
codegen run test-function
68+
gs run test-function
6969
7070
# Create an isolated venv with codegen => open jupyter
71-
codegen notebook
71+
gs notebook
7272
```
7373

7474
## Usage

codegen-examples/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ uv tool install codegen
1919
Initialize Codegen in your project
2020

2121
```bash
22-
codegen init
22+
gs init
2323
```
2424

2525
Activate the virtual environment

docs/building-with-codegen/dot-codegen.mdx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ icon: "folder"
55
iconType: "solid"
66
---
77

8-
The `.codegen` directory contains your project's Codegen configuration, codemods, and supporting files. It's automatically created when you run `codegen init`.
8+
The `.codegen` directory contains your project's Codegen configuration, codemods, and supporting files. It's automatically created when you run `gs init`.
99

1010
## Directory Structure
1111

@@ -20,10 +20,10 @@ The `.codegen` directory contains your project's Codegen configuration, codemods
2020

2121
## Initialization
2222

23-
The directory is created and managed using the `codegen init` command:
23+
The directory is created and managed using the `gs init` command:
2424

2525
```bash
26-
codegen init [--fetch-docs] [--repo-name NAME] [--organization-name ORG]
26+
gs init [--fetch-docs] [--repo-name NAME] [--organization-name ORG]
2727
```
2828

2929
<Note>
@@ -40,7 +40,7 @@ Codegen maintains its own virtual environment in `.codegen/.venv/` to ensure con
4040
- Used for running codemods and Jupyter notebooks
4141
- Gitignored to avoid committing environment-specific files
4242

43-
The environment is created during `codegen init` and used by commands like `codegen run` and `codegen notebook`.
43+
The environment is created during `gs init` and used by commands like `gs run` and `gs notebook`.
4444

4545
<Note>To debug codemods, you will need to set the python virtual environment in your IDE to `.codegen/.venv`</Note>
4646

@@ -78,7 +78,7 @@ Codegen automatically adds appropriate entries to your `.gitignore`:
7878
The `codemods/` directory is where your transformation functions live. You can create new codemods using:
7979

8080
```bash
81-
codegen create my-codemod PATH [--description "what it does"]
81+
gs create my-codemod PATH [--description "what it does"]
8282
```
8383

8484
This will:
@@ -87,7 +87,7 @@ This will:
8787
3. Set up the necessary imports and decorators
8888

8989
<Tip>
90-
Use `codegen list` to see all codemods in your project.
90+
Use `gs list` to see all codemods in your project.
9191
</Tip>
9292

9393
## Jupyter Integration
@@ -115,12 +115,12 @@ After initializing your `.codegen` directory:
115115

116116
1. Create your first codemod:
117117
```bash
118-
codegen create my-codemod . -d "describe what you want to do"
118+
gs create my-codemod . -d "describe what you want to do"
119119
```
120120

121121
2. Run it:
122122
```bash
123-
codegen run my-codemod --apply-local
123+
gs run my-codemod --apply-local
124124
```
125125

126126
3. Deploy it for team use:

docs/building-with-codegen/function-decorator.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ The `function` decorator is part of the codegen SDK CLI and is used to mark func
3939
To run a deployed function using the CLI, use the following command:
4040

4141
```bash
42-
codegen run my-function
42+
gs run my-function
4343
```
4444

4545
This command runs the function named `my-function`.

docs/building-with-codegen/reusable-codemods.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Codegen enables you to create reusable code transformations using Python functio
1212
The easiest way to create a new codemod is using the CLI [create](/cli/create) command:
1313

1414
```bash
15-
codegen create rename-function .
15+
gs create rename-function .
1616
```
1717

1818
This creates a new codemod in your `.codegen/codemods` directory:
@@ -37,7 +37,7 @@ def run(codebase: Codebase):
3737
You can use AI to generate an initial implementation by providing a description:
3838

3939
```bash
40-
codegen create rename-function . -d "Rename the getUserData function to fetchUserProfile"
40+
gs create rename-function . -d "Rename the getUserData function to fetchUserProfile"
4141
```
4242

4343
This will:
@@ -50,7 +50,7 @@ This will:
5050
Once created, run your codemod using:
5151

5252
```bash
53-
codegen run rename-function
53+
gs run rename-function
5454
```
5555

5656
The execution flow:
@@ -104,7 +104,7 @@ def run(codebase: Codebase, arguments: RenameArgs):
104104

105105
Run it with:
106106
```bash
107-
codegen run rename-function --arguments '{"old_name": "getUserData", "new_name": "fetchUserProfile"}'
107+
gs run rename-function --arguments '{"old_name": "getUserData", "new_name": "fetchUserProfile"}'
108108
```
109109

110110
## Directory Structure

docs/changelog/changelog.mdx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ iconType: "solid"
8787
</Update>
8888

8989
<Update label="v0.52.24" description="March 25, 2025">
90-
### [Documentation update for `codegen create` command.](https://github.com/codegen-sh/graph-sitter/releases/tag/v0.52.24)
91-
- Update documentation for `codegen create` command
90+
### [Documentation update for `gs create` command.](https://github.com/codegen-sh/graph-sitter/releases/tag/v0.52.24)
91+
- Update documentation for `gs create` command
9292
</Update>
9393

9494

@@ -556,7 +556,7 @@ iconType: "solid"
556556

557557
<Update label="v0.41.0" description="February 26, 2025">
558558
### [adds --daemon option and improves dataset access.](https://github.com/codegen-sh/graph-sitter/releases/tag/v0.41.0)
559-
- Add --daemon option to codegen run command
559+
- Add --daemon option to gs run command
560560
- Improve swebench dataset access
561561
</Update>
562562

@@ -1312,7 +1312,7 @@ iconType: "solid"
13121312

13131313
<Update label="v0.5.5" description="January 27, 2025">
13141314
### [Adds create flag and improves Git repository handling](https://github.com/codegen-sh/graph-sitter/releases/tag/v0.5.5)
1315-
- Added `-d` flag to `codegen create` command
1315+
- Added `-d` flag to `gs create` command
13161316
- Fixed Gradio integration issues
13171317
- Improved automatic base path detection for Git repositories
13181318
- Enhanced codebase reset functionality to only affect SDK changes
@@ -1322,7 +1322,7 @@ iconType: "solid"
13221322

13231323
<Update label="v0.5.4" description="January 27, 2025">
13241324
### [Adds venv management and TypeScript export support](https://github.com/codegen-sh/graph-sitter/releases/tag/v0.5.4)
1325-
- Added virtual environment creation and persistence for `codegen init`
1325+
- Added virtual environment creation and persistence for `gs init`
13261326
- Added support for codebase exports in TypeScript projects
13271327
- Reorganized test structure for better maintainability
13281328
- Updated graph widget configuration and URLs
@@ -1334,14 +1334,14 @@ iconType: "solid"
13341334
- Added graph widget visualization feature
13351335
- Enhanced documentation with improved readability and new guides
13361336
- Added system prompt functionality
1337-
- Fixed core commands: codegen run and create
1337+
- Fixed core commands: gs run and create
13381338
- Various internal code cleanup and reorganization
13391339
</Update>
13401340

13411341

13421342
<Update label="v0.5.2" description="January 24, 2025">
13431343
### [Adds notebook functionality and improves documentation](https://github.com/codegen-sh/graph-sitter/releases/tag/v0.5.2)
1344-
- Added new codegen notebook functionality
1344+
- Added new gs notebook functionality
13451345
- Fixed several documentation rendering issues and broken links
13461346
- Added function call parameter documentation helpers
13471347
- Fixed various type annotations and AST-related bugs

docs/cli/about.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ The graph_sitter.cli helps you:
2121
1. **Initialize Codegen** in your repository:
2222

2323
```bash
24-
codegen init
24+
gs init
2525
```
2626

2727
2. **Create your first codemod**:
2828

2929
```bash
30-
codegen create my-codemod --description "What you want to accomplish"
30+
gs create my-codemod --description "What you want to accomplish"
3131
```
3232

3333
The `--description` flag enables AI assistance to help generate your codemod. Be as specific as possible about what you want to achieve.

docs/cli/create.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ iconType: "solid"
88
The `create` command generates a new codemod function with the necessary boilerplate.
99

1010
```bash
11-
codegen create rename-function .
11+
gs create rename-function .
1212
```
1313

1414
## Usage
1515

1616
```bash
17-
codegen create NAME PATH [OPTIONS]
17+
gs create NAME PATH [OPTIONS]
1818
```
1919

2020
## Arguments
@@ -28,7 +28,7 @@ codegen create NAME PATH [OPTIONS]
2828

2929
## Generated Files
3030

31-
When you run `codegen create rename-function .`, it creates:
31+
When you run `gs create rename-function .`, it creates:
3232

3333
```
3434
.codegen/
@@ -64,19 +64,19 @@ if __name__ == "__main__":
6464

6565
Create a basic codemod:
6666
```bash
67-
codegen create rename-function .
67+
gs create rename-function .
6868
```
6969

7070
Create with an AI-powered implementation:
7171
```bash
72-
codegen create rename-function . -d "Rename the getUserData function to fetchUserProfile"
72+
gs create rename-function . -d "Rename the getUserData function to fetchUserProfile"
7373
```
7474

7575
## Next Steps
7676

7777
After creating a codemod:
7878
1. Edit the implementation in the generated .py file
79-
2. Test it with `codegen run rename-function`
79+
2. Test it with `gs run rename-function`
8080
3. Deploy it for team use with `codegen deploy rename-function`
8181

8282
## Common Issues

docs/cli/expert.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,6 @@ The expert has deep knowledge of Codegen's internals and common transformation p
5656

5757
## Related Commands
5858

59-
- `codegen create`: Create new codemods with AI assistance
60-
- `codegen run`: Execute your codemods
59+
- `gs create`: Create new codemods with AI assistance
60+
- `gs run`: Execute your codemods
6161
- `codegen docs-search`: Search documentation and examples

docs/cli/init.mdx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ The `init` command sets up Codegen in your repository, creating necessary config
1010
## Usage
1111

1212
```bash
13-
codegen init [OPTIONS]
13+
gs init [OPTIONS]
1414
```
1515

1616
## Options
@@ -20,13 +20,13 @@ codegen init [OPTIONS]
2020

2121
## Directory Structure
2222

23-
When you run `init`, Codegen creates a `.codegen` directory in your repository with the following structure:
23+
When you run `init`, gs creates a `.codegen` directory in your repository with the following structure:
2424

2525
```
2626
.codegen/
2727
├── config.toml # Configuration file with repo and org info
2828
├── codemods/ # Your codemods live here
29-
│ └── my_codemod.py # Created via `codegen create my-codemod`
29+
│ └── my_codemod.py # Created via `gs create my-codemod`
3030
├── docs/ # Local documentation for offline access
3131
│ ├── api/
3232
│ ├── examples/
@@ -47,7 +47,7 @@ This setup allows you to:
4747

4848
## Recommended Structure
4949

50-
We recommend keeping your Codegen codemods in the `.codegen/codemods/` directory (this is the default when using `codegen create`). This:
50+
We recommend keeping your Codegen codemods in the `.codegen/codemods/` directory (this is the default when using `gs create`). This:
5151

5252
- Keeps transformation code separate from your application code
5353
- Makes it easy to find and manage all your codemods
@@ -68,21 +68,21 @@ The command must be run from within a git repository. If you're not in one, you'
6868
```bash
6969
git init
7070
git remote add origin <your-repo-url>
71-
codegen init
71+
gs init
7272
```
7373

7474
## Examples
7575

7676
Initialize with default settings (uses git repo info):
7777

7878
```bash
79-
codegen init
79+
gs init
8080
```
8181

8282
Initialize with custom organization and repo:
8383

8484
```bash
85-
codegen init --organization-name "my-org" --repo-name "my-project"
85+
gs init --organization-name "my-org" --repo-name "my-project"
8686
```
8787

8888
## Next Steps
@@ -92,23 +92,23 @@ After initializing:
9292
1. Create your first codemod:
9393

9494
```bash
95-
codegen create my-function . -d "describe what you want to do"
95+
gs create my-function . -d "describe what you want to do"
9696
```
9797

9898
Note: The second parameter (`.`) specifies the path where the codemod should be created. This is required.
9999

100100
2. Run it:
101101

102102
```bash
103-
codegen run my-function --apply-local
103+
gs run my-function --apply-local
104104
```
105105

106106
## Updating
107107

108108
You can run `init` again to update your local documentation and configuration:
109109

110110
```bash
111-
codegen init
111+
gs init
112112
```
113113

114114
This will refresh the `.codegen` directory while preserving your existing configuration.

0 commit comments

Comments
 (0)