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
&& curl -fsSL https://raw.githubusercontent.com/coder/code-server/refs/tags/v4.99.1/install.sh | sh \
107
-
&& uv tool install uvicorn[standard]
108
-
109
-
ENTRYPOINT ["/usr/local/bin/start.sh"]
16
+
Codegen sandboxes are built on a custom Docker image that provides a comprehensive development environment. For detailed information about the base image, including the complete Dockerfile and available tools, see the [Base Image](/sandboxes/base-image) documentation.
17
+
18
+
## Accessing Setup Commands
19
+
20
+
To configure setup commands for a repository:
21
+
22
+
1. Navigate to [codegen.com/repos](https://codegen.com/repos).
23
+
2. Click on the desired repository from the list.
24
+
3. You will be taken to the repository's settings page. The setup commands can be found at a URL similar to `https://www.codegen.com/repos/{arepo_name}/setup-commands`
25
+
26
+
<Framecaption="Set setup commands at codegen.com/repos">
Enter your desired setup commands in the provided text area, with one command per line. These commands will be executed in sequence within the sandbox environment.
33
+
34
+
For example, you might want to:
35
+
36
+
- Switch to a specific Node.js version.
37
+
- Install project dependencies.
38
+
- Run any necessary build steps or pre-compilation tasks.
39
+
40
+
After the commands are executed successfully, Codegen takes a snapshot of the sandbox's file system. This snapshot then serves as the base environment for future agent interactions with this repository, meaning your setup commands don't need to be re-run every time, saving time and ensuring consistency.
41
+
42
+
## Common Examples
43
+
44
+
Here are a few common use cases for setup commands:
45
+
46
+
```bash
47
+
# Switch to Node.js version 20
48
+
nvm use 20
49
+
50
+
# Install npm dependencies
51
+
npm install
110
52
```
111
53
112
-
</details>
54
+
```bash
55
+
# Setup with specific Python version for compatibility
56
+
pyenv install 3.12.0
57
+
pyenv local 3.12.0
58
+
python -m venv venv
59
+
source venv/bin/activate
60
+
pip install -r requirements.txt
61
+
```
62
+
63
+
```bash
64
+
# Or a combination of commands
65
+
nvm use 18
66
+
npm ci
67
+
npm run build
68
+
```
113
69
114
-
## Working with Different Python Versions
70
+
###Working with Different Python Versions
115
71
116
72
The sandbox comes with Python 3.13 by default, but some packages may not yet be compatible with this version. Here are strategies for handling different Python versions:
117
73
118
-
### Using pyenv for Multiple Python Versions
74
+
####Using pyenv for Multiple Python Versions
119
75
120
76
If you need to work with a different Python version, you can install and use `pyenv`:
121
77
@@ -142,23 +98,22 @@ source venv/bin/activate
142
98
pip install -r requirements.txt
143
99
```
144
100
145
-
### Using uv with Specific Python Versions
101
+
####Using uv with Specific Python Versions
146
102
147
103
The `uv` package manager (already installed) can also manage Python versions:
148
104
149
105
```bash
150
-
# Install a specific Python version with uv
151
-
uv python install 3.12
106
+
# Install Python 3.12 and create a virtual environment
107
+
uv venv --python=3.12
152
108
153
-
# Create a project with a specific Python version
154
-
uv init --python 3.12 my_project
155
-
cd my_project
109
+
# Activate the virtual environment
110
+
source .venv/bin/activate
156
111
157
-
# Install dependencies with the specified Python version
When working with packages that require older Python versions:
164
119
@@ -181,58 +136,6 @@ deactivate
181
136
Remember to activate your virtual environment in your setup commands if you need specific Python versions for your project dependencies.
182
137
</Warning>
183
138
184
-
## Accessing Setup Commands
185
-
186
-
To configure setup commands for a repository:
187
-
188
-
1. Navigate to [codegen.com/repos](https://codegen.com/repos).
189
-
2. Click on the desired repository from the list.
190
-
3. You will be taken to the repository's settings page. The setup commands can be found at a URL similar to `https://codegen.com/{your_org}/{repo_name}/settings/setup-commands` (the exact URL structure might vary slightly, look for a "Setup Commands" or "Sandbox Configuration" section).
191
-
192
-
<Framecaption="Set setup commands at codegen.com/repos">
Enter your desired setup commands in the provided text area, with one command per line. These commands will be executed in sequence within the sandbox environment.
199
-
200
-
For example, you might want to:
201
-
202
-
- Switch to a specific Node.js version.
203
-
- Install project dependencies.
204
-
- Run any necessary build steps or pre-compilation tasks.
205
-
206
-
After the commands are executed successfully, Codegen takes a snapshot of the sandbox's file system. This snapshot then serves as the base environment for future agent interactions with this repository, meaning your setup commands don't need to be re-run every time, saving time and ensuring consistency.
207
-
208
-
## Common Examples
209
-
210
-
Here are a few common use cases for setup commands:
211
-
212
-
```bash
213
-
# Switch to Node.js version 20
214
-
nvm use 20
215
-
216
-
# Install npm dependencies
217
-
npm install
218
-
```
219
-
220
-
```bash
221
-
# Setup with specific Python version for compatibility
222
-
pyenv install 3.12.0
223
-
pyenv local 3.12.0
224
-
python -m venv venv
225
-
source venv/bin/activate
226
-
pip install -r requirements.txt
227
-
```
228
-
229
-
```bash
230
-
# Or a combination of commands
231
-
nvm use 18
232
-
npm ci
233
-
npm run build
234
-
```
235
-
236
139
<Note>
237
140
Ensure your setup commands are non-interactive and can run to completion
0 commit comments