Skip to content

SWE-agent takes a GitHub issue and tries to automatically fix it, using your LM of choice. It can also be employed for offensive cybersecurity or competitive coding challenges. [NeurIPS 2024]

Improve codespace setup & documentation (#293)

Kilian Lieret47257081ec54
diff --git a/.devcontainer/README.md b/.devcontainer/README.md
new file mode 100644
index 00000000..f2ec853d
--- /dev/null
+++ b/.devcontainer/README.md
@@ -0,0 +1,4 @@
+# .devcontainer
+
+The files in this directory configure a VSCode environment like
+GitHub codespaces.
diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json
index d68ddf02..0e06e438 100644
--- a/.devcontainer/devcontainer.json
+++ b/.devcontainer/devcontainer.json
@@ -1,14 +1,15 @@
{
"name": "SWE-Agent Codespace",
"image": "mcr.microsoft.com/vscode/devcontainers/miniconda:0-3",
- "settings": {
- "terminal.integrated.shell.linux": "/bin/bash"
+ "customizations":{
+ "vscode":{
+ "extensions": [
+ "ms-python.python",
+ "ms-azuretools.vscode-docker",
+ "ms-toolsai.jupyter"
+ ]
+ }
},
- "extensions": [
- "ms-python.python",
- "ms-azuretools.vscode-docker",
- "ms-toolsai.jupyter"
- ],
"onCreateCommand": "./.devcontainer/oncreate.sh",
"postCreateCommand": "./.devcontainer/postcreate.sh",
"features": {
diff --git a/.devcontainer/oncreate.sh b/.devcontainer/oncreate.sh
index 3992c4e0..c6186d73 100755
--- a/.devcontainer/oncreate.sh
+++ b/.devcontainer/oncreate.sh
@@ -3,6 +3,9 @@
set -euo pipefail
set -x
+# Run from repo root
+
sudo usermod -aG docker vscode
sudo chmod 666 /var/run/docker.sock
pip install -e '.'
+cp .devcontainer/sample_keys.cfg keys.cfg
diff --git a/.devcontainer/sample_keys.cfg b/.devcontainer/sample_keys.cfg
new file mode 100644
index 00000000..b8007c7c
--- /dev/null
+++ b/.devcontainer/sample_keys.cfg
@@ -0,0 +1,9 @@
+GITHUB_TOKEN: 'GitHub Token to clone private repos' # <-- delete if not needed
+OPENAI_API_KEY: 'OpenAI API Key Here if using OpenAI Model'
+ANTHROPIC_API_KEY: 'Anthropic API Key Here if using Anthropic Model'
+TOGETHER_API_KEY: 'Together API Key Here if using Together Model'
+AZURE_OPENAI_API_KEY: 'Azure OpenAI API Key Here if using Azure OpenAI Model'
+AZURE_OPENAI_ENDPOINT: 'Azure OpenAI Endpoint Here if using Azure OpenAI Model'
+AZURE_OPENAI_DEPLOYMENT: 'Azure OpenAI Deployment Here if using Azure OpenAI Model'
+AZURE_OPENAI_API_VERSION: 'Azure OpenAI API Version Here if using Azure OpenAI Model'
+OPENAI_API_BASE_URL: 'LM base URL here if using Local or alternative api Endpoint'
diff --git a/README.md b/README.md
index b6edb679..8a533109 100644
--- a/README.md
+++ b/README.md
@@ -44,9 +44,13 @@ Read our paper for more details [coming soon!].
}
```
-## πŸš€ Setup <a name="setup"></a>
+## πŸš€ Get started <a name="setup"></a>
-SWE-agent runs on Linux and Intel/Apple Silicon Macs. Running it in other environments, such as Windows or WSL, might not work.
+### ☁️ Run from your browser
+
+1. Click [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/princeton-nlp/SWE-agent)
+2. Add your API keys to `keys.cfg` (find the file in the left sidebar and fill out the tempalte)
+3. Enter your SWE-agent command in the terminal window at the bottom
### 🏎️ Express Setup + Run
@@ -139,7 +143,7 @@ If you seem to be having issues with running docker
Any remaining issues? Please [open a GitHub issue](https://github.com/princeton-nlp/SWE-agent/issues/new/choose)!
-## πŸ”₯ Quickstart: Solve real-life GitHub issues! <a name="real-life"></a>
+## πŸ”₯ Solve real-life GitHub issues! <a name="real-life"></a>
Using this script, you can run SWE-agent on any GitHub issue!
```bash