From 24f2debbfab25147d7c21b86065160db2c1a6385 Mon Sep 17 00:00:00 2001 From: Matt Brockman Date: Wed, 29 Apr 2026 16:34:56 -0700 Subject: [PATCH 1/4] devin cli instructions --- docs.json | 1 + docs/agents/devin.mdx | 59 ++++++++++++++++++++++++++++++++++++++++++ images/icons/devin.svg | 4 +++ 3 files changed, 64 insertions(+) create mode 100644 docs/agents/devin.mdx create mode 100644 images/icons/devin.svg diff --git a/docs.json b/docs.json index 7d21cd30..57a80903 100644 --- a/docs.json +++ b/docs.json @@ -57,6 +57,7 @@ "docs/agents/amp", "docs/agents/claude-code", "docs/agents/codex", + "docs/agents/devin", "docs/agents/openai-agents-sdk", { "group": "OpenClaw", diff --git a/docs/agents/devin.mdx b/docs/agents/devin.mdx new file mode 100644 index 00000000..580779fc --- /dev/null +++ b/docs/agents/devin.mdx @@ -0,0 +1,59 @@ +--- +title: "Devin" +description: "Run Devin for Terminal in a secure E2B sandbox with full filesystem, terminal, and git access." +icon: "/images/icons/devin.svg" +--- + +[Devin for Terminal](https://devin.ai/terminal) is Cognition's coding agent for working directly from a terminal. You can install it in an E2B sandbox and use the sandbox as an isolated workspace for agent tasks. + +## CLI + +Create a sandbox with the [E2B CLI](/docs/cli). The `base` template is enough for installing Devin for Terminal. + +```bash +e2b sandbox create base +``` + +Once inside the sandbox, install Devin for Terminal. + +```bash +curl -fsSL https://cli.devin.ai/install.sh | bash +``` + +The installer prompts you to sign in. Open the printed authentication URL, complete the login flow, then paste the code back into the sandbox terminal. + +After login, reload your shell configuration so the `devin` command is available. + +```bash +source /home/user/.bashrc +``` + +Start Devin from a project directory. + +```bash +mkdir -p /home/user/project +cd /home/user/project +devin +``` + +## Example: work on a cloned repository + +After installing Devin for Terminal and signing in, run these commands from inside the sandbox to clone a repository and start Devin from the project directory. + +```bash +git clone https://github.com/your-org/your-repo.git /home/user/repo +cd /home/user/repo +devin -- "Add error handling to all API endpoints" +``` + +You can also start an interactive Devin session from the repository and enter follow-up prompts. + +```bash +devin +``` + +```text +Find and fix all TODO comments +``` + +Devin can edit files, run commands, and work on code inside the sandbox without accessing your local machine. diff --git a/images/icons/devin.svg b/images/icons/devin.svg new file mode 100644 index 00000000..4c8f3454 --- /dev/null +++ b/images/icons/devin.svg @@ -0,0 +1,4 @@ + + + + From 442c32f600e2f28218b305e75a69c8cfde06016e Mon Sep 17 00:00:00 2001 From: Matt Brockman Date: Wed, 29 Apr 2026 23:17:21 -0700 Subject: [PATCH 2/4] start on instructions for devin --- docs/agents/devin.mdx | 189 +++++++++++++++++++++++++++++++++++------- 1 file changed, 161 insertions(+), 28 deletions(-) diff --git a/docs/agents/devin.mdx b/docs/agents/devin.mdx index 580779fc..2c0570f8 100644 --- a/docs/agents/devin.mdx +++ b/docs/agents/devin.mdx @@ -1,59 +1,192 @@ --- title: "Devin" -description: "Run Devin for Terminal in a secure E2B sandbox with full filesystem, terminal, and git access." +description: "Run Devin for Terminal in a secure E2B sandbox." icon: "/images/icons/devin.svg" --- [Devin for Terminal](https://devin.ai/terminal) is Cognition's coding agent for working directly from a terminal. You can install it in an E2B sandbox and use the sandbox as an isolated workspace for agent tasks. -## CLI +## Installation -Create a sandbox with the [E2B CLI](/docs/cli). The `base` template is enough for installing Devin for Terminal. +Use a PTY for install and login because Devin's setup is interactive. You can create a Devin account during sign up if you don't have one. -```bash + +```bash CLI e2b sandbox create base -``` - -Once inside the sandbox, install Devin for Terminal. -```bash +# Inside the sandbox curl -fsSL https://cli.devin.ai/install.sh | bash -``` - -The installer prompts you to sign in. Open the printed authentication URL, complete the login flow, then paste the code back into the sandbox terminal. - -After login, reload your shell configuration so the `devin` command is available. -```bash source /home/user/.bashrc ``` +```typescript JavaScript & TypeScript +import { Sandbox } from 'e2b' + +const sandbox = await Sandbox.create('base', { + timeoutMs: 600_000, +}) + +await sandbox.commands.run( + 'curl -fsSL https://cli.devin.ai/install.sh | bash || true', + { timeoutMs: 120_000 } +) + +// Use a PTY for login because Devin setup is interactive. +let setupOutput = '' +let loginComplete = () => {} +const loggedIn = new Promise((resolve) => { + loginComplete = resolve +}) +const terminal = await sandbox.pty.create({ + cols: 120, + rows: 32, + cwd: '/home/user', + timeoutMs: 0, + onData: (data) => { + process.stdout.write(data) + setupOutput += data + if (setupOutput.includes('Then run devin') || setupOutput.includes('Logged in as')) { + loginComplete() + } + }, +}) + +await sandbox.pty.sendInput( + terminal.pid, + new TextEncoder().encode('/home/user/.local/bin/devin setup --force-manual-token-flow\n') +) + +const code = '/* VISIT THE PRINTED URL AND PASTE THE SIGN-IN CODE HERE */' +await sandbox.pty.sendInput( + terminal.pid, + new TextEncoder().encode(`${code}\r`) +) + +await loggedIn +await sandbox.pty.sendInput( + terminal.pid, + new TextEncoder().encode('source /home/user/.bashrc\n') +) +``` +```python Python +import threading +from e2b import Sandbox, PtySize + +sandbox = Sandbox.create("base", timeout=600) + +sandbox.commands.run( + "curl -fsSL https://cli.devin.ai/install.sh | bash || true", + timeout=120, +) + +# Use a PTY for login because Devin setup is interactive. +login_complete = threading.Event() +setup_output = "" +terminal = sandbox.pty.create( + PtySize(rows=32, cols=120), + cwd="/home/user", + timeout=0, +) + +def stream_pty(): + global setup_output + for _, _, pty in terminal: + if pty: + text = pty.decode(errors="replace") + print(text, end="") + setup_output += text + if "Then run devin" in setup_output or "Logged in as" in setup_output: + login_complete.set() + +threading.Thread(target=stream_pty, daemon=True).start() + +sandbox.pty.send_stdin( + terminal.pid, + b"/home/user/.local/bin/devin setup --force-manual-token-flow\n", +) + +code = "/* VISIT THE PRINTED URL AND PASTE THE SIGN-IN CODE HERE */" +sandbox.pty.send_stdin(terminal.pid, f"{code}\r".encode()) + +login_complete.wait() +sandbox.pty.send_stdin(terminal.pid, b"source /home/user/.bashrc\n") +``` + -Start Devin from a project directory. +## Usage -```bash +After installation and login, use `devin -p` for non-interactive mode and `--permission-mode dangerous` to auto-approve tool calls. + + +```bash CLI mkdir -p /home/user/project cd /home/user/project -devin +devin --permission-mode dangerous -p "Create a hello world HTTP server in Go" ``` +```typescript JavaScript & TypeScript +await sandbox.commands.run('mkdir -p /home/user/project') + +const result = await sandbox.commands.run( + `/home/user/.local/bin/devin --permission-mode dangerous -p "Create a hello world HTTP server in Go"`, + { cwd: '/home/user/project' } +) + +console.log(result.stdout) +``` +```python Python +sandbox.commands.run("mkdir -p /home/user/project") + +result = sandbox.commands.run( + '/home/user/.local/bin/devin --permission-mode dangerous -p "Create a hello world HTTP server in Go"', + cwd="/home/user/project", +) + +print(result.stdout) +``` + ## Example: work on a cloned repository -After installing Devin for Terminal and signing in, run these commands from inside the sandbox to clone a repository and start Devin from the project directory. +After installing Devin for Terminal and signing in, clone a repository and run Devin from the project directory. -```bash + +```bash CLI git clone https://github.com/your-org/your-repo.git /home/user/repo cd /home/user/repo -devin -- "Add error handling to all API endpoints" +devin --permission-mode dangerous -p "Add error handling to all API endpoints" ``` - -You can also start an interactive Devin session from the repository and enter follow-up prompts. - -```bash -devin +```typescript JavaScript & TypeScript +await sandbox.git.clone('https://github.com/your-org/your-repo.git', { + path: '/home/user/repo', + username: 'x-access-token', + password: process.env.GITHUB_TOKEN, + depth: 1, +}) + +const result = await sandbox.commands.run( + `/home/user/.local/bin/devin --permission-mode dangerous -p "Add error handling to all API endpoints"`, + { cwd: '/home/user/repo' } +) + +console.log(result.stdout) ``` - -```text -Find and fix all TODO comments +```python Python +import os + +sandbox.git.clone("https://github.com/your-org/your-repo.git", + path="/home/user/repo", + username="x-access-token", + password=os.environ["GITHUB_TOKEN"], + depth=1, +) + +result = sandbox.commands.run( + '/home/user/.local/bin/devin --permission-mode dangerous -p "Add error handling to all API endpoints"', + cwd="/home/user/repo", +) + +print(result.stdout) ``` + Devin can edit files, run commands, and work on code inside the sandbox without accessing your local machine. From 44695318aa6bf135165ca9f5b2bf41c1d9c72198 Mon Sep 17 00:00:00 2001 From: Matt Brockman Date: Wed, 29 Apr 2026 23:27:59 -0700 Subject: [PATCH 3/4] seperators around places need to pause and do something --- docs/agents/devin.mdx | 92 +++++++++++++++++++++++++++++++++++-------- 1 file changed, 75 insertions(+), 17 deletions(-) diff --git a/docs/agents/devin.mdx b/docs/agents/devin.mdx index 2c0570f8..3396bc33 100644 --- a/docs/agents/devin.mdx +++ b/docs/agents/devin.mdx @@ -10,28 +10,37 @@ icon: "/images/icons/devin.svg" Use a PTY for install and login because Devin's setup is interactive. You can create a Devin account during sign up if you don't have one. - -```bash CLI + + + +```bash e2b sandbox create base +### # Inside the sandbox +### curl -fsSL https://cli.devin.ai/install.sh | bash source /home/user/.bashrc ``` -```typescript JavaScript & TypeScript + + + + +```typescript import { Sandbox } from 'e2b' const sandbox = await Sandbox.create('base', { timeoutMs: 600_000, }) +// Install Devin await sandbox.commands.run( 'curl -fsSL https://cli.devin.ai/install.sh | bash || true', { timeoutMs: 120_000 } ) -// Use a PTY for login because Devin setup is interactive. +// Start login in a PTY let setupOutput = '' let loginComplete = () => {} const loggedIn = new Promise((resolve) => { @@ -56,6 +65,8 @@ await sandbox.pty.sendInput( new TextEncoder().encode('/home/user/.local/bin/devin setup --force-manual-token-flow\n') ) +// Visit the printed URL +// Paste the sign-in code const code = '/* VISIT THE PRINTED URL AND PASTE THE SIGN-IN CODE HERE */' await sandbox.pty.sendInput( terminal.pid, @@ -63,23 +74,30 @@ await sandbox.pty.sendInput( ) await loggedIn + +// Reload shell config await sandbox.pty.sendInput( terminal.pid, new TextEncoder().encode('source /home/user/.bashrc\n') ) ``` -```python Python + + + + +```python import threading from e2b import Sandbox, PtySize sandbox = Sandbox.create("base", timeout=600) +# Install Devin sandbox.commands.run( "curl -fsSL https://cli.devin.ai/install.sh | bash || true", timeout=120, ) -# Use a PTY for login because Devin setup is interactive. +# Start login in a PTY login_complete = threading.Event() setup_output = "" terminal = sandbox.pty.create( @@ -105,27 +123,42 @@ sandbox.pty.send_stdin( b"/home/user/.local/bin/devin setup --force-manual-token-flow\n", ) +# Visit the printed URL +# Paste the sign-in code code = "/* VISIT THE PRINTED URL AND PASTE THE SIGN-IN CODE HERE */" sandbox.pty.send_stdin(terminal.pid, f"{code}\r".encode()) login_complete.wait() + +# Reload shell config sandbox.pty.send_stdin(terminal.pid, b"source /home/user/.bashrc\n") ``` - + + + ## Usage After installation and login, use `devin -p` for non-interactive mode and `--permission-mode dangerous` to auto-approve tool calls. - -```bash CLI + + + +```bash mkdir -p /home/user/project cd /home/user/project + devin --permission-mode dangerous -p "Create a hello world HTTP server in Go" ``` -```typescript JavaScript & TypeScript + + + + +```typescript +// Create a project directory await sandbox.commands.run('mkdir -p /home/user/project') +// Run Devin headlessly const result = await sandbox.commands.run( `/home/user/.local/bin/devin --permission-mode dangerous -p "Create a hello world HTTP server in Go"`, { cwd: '/home/user/project' } @@ -133,9 +166,15 @@ const result = await sandbox.commands.run( console.log(result.stdout) ``` -```python Python + + + + +```python +# Create a project directory sandbox.commands.run("mkdir -p /home/user/project") +# Run Devin headlessly result = sandbox.commands.run( '/home/user/.local/bin/devin --permission-mode dangerous -p "Create a hello world HTTP server in Go"', cwd="/home/user/project", @@ -143,19 +182,29 @@ result = sandbox.commands.run( print(result.stdout) ``` - + + + ## Example: work on a cloned repository After installing Devin for Terminal and signing in, clone a repository and run Devin from the project directory. - -```bash CLI + + + +```bash git clone https://github.com/your-org/your-repo.git /home/user/repo cd /home/user/repo + devin --permission-mode dangerous -p "Add error handling to all API endpoints" ``` -```typescript JavaScript & TypeScript + + + + +```typescript +// Clone the repository await sandbox.git.clone('https://github.com/your-org/your-repo.git', { path: '/home/user/repo', username: 'x-access-token', @@ -163,6 +212,7 @@ await sandbox.git.clone('https://github.com/your-org/your-repo.git', { depth: 1, }) +// Run Devin in the repository const result = await sandbox.commands.run( `/home/user/.local/bin/devin --permission-mode dangerous -p "Add error handling to all API endpoints"`, { cwd: '/home/user/repo' } @@ -170,9 +220,14 @@ const result = await sandbox.commands.run( console.log(result.stdout) ``` -```python Python + + + + +```python import os +# Clone the repository sandbox.git.clone("https://github.com/your-org/your-repo.git", path="/home/user/repo", username="x-access-token", @@ -180,6 +235,7 @@ sandbox.git.clone("https://github.com/your-org/your-repo.git", depth=1, ) +# Run Devin in the repository result = sandbox.commands.run( '/home/user/.local/bin/devin --permission-mode dangerous -p "Add error handling to all API endpoints"', cwd="/home/user/repo", @@ -187,6 +243,8 @@ result = sandbox.commands.run( print(result.stdout) ``` - + + + Devin can edit files, run commands, and work on code inside the sandbox without accessing your local machine. From c8d704e8c75aaae86cfef07cd81c120bd237c077 Mon Sep 17 00:00:00 2001 From: Matt Brockman Date: Thu, 30 Apr 2026 14:55:55 -0700 Subject: [PATCH 4/4] rm python/js --- docs/agents/devin.mdx | 204 ------------------------------------------ 1 file changed, 204 deletions(-) diff --git a/docs/agents/devin.mdx b/docs/agents/devin.mdx index 3396bc33..aeab69b8 100644 --- a/docs/agents/devin.mdx +++ b/docs/agents/devin.mdx @@ -10,9 +10,6 @@ icon: "/images/icons/devin.svg" Use a PTY for install and login because Devin's setup is interactive. You can create a Devin account during sign up if you don't have one. - - - ```bash e2b sandbox create base @@ -24,126 +21,10 @@ curl -fsSL https://cli.devin.ai/install.sh | bash source /home/user/.bashrc ``` - - - -```typescript -import { Sandbox } from 'e2b' - -const sandbox = await Sandbox.create('base', { - timeoutMs: 600_000, -}) - -// Install Devin -await sandbox.commands.run( - 'curl -fsSL https://cli.devin.ai/install.sh | bash || true', - { timeoutMs: 120_000 } -) - -// Start login in a PTY -let setupOutput = '' -let loginComplete = () => {} -const loggedIn = new Promise((resolve) => { - loginComplete = resolve -}) -const terminal = await sandbox.pty.create({ - cols: 120, - rows: 32, - cwd: '/home/user', - timeoutMs: 0, - onData: (data) => { - process.stdout.write(data) - setupOutput += data - if (setupOutput.includes('Then run devin') || setupOutput.includes('Logged in as')) { - loginComplete() - } - }, -}) - -await sandbox.pty.sendInput( - terminal.pid, - new TextEncoder().encode('/home/user/.local/bin/devin setup --force-manual-token-flow\n') -) - -// Visit the printed URL -// Paste the sign-in code -const code = '/* VISIT THE PRINTED URL AND PASTE THE SIGN-IN CODE HERE */' -await sandbox.pty.sendInput( - terminal.pid, - new TextEncoder().encode(`${code}\r`) -) - -await loggedIn - -// Reload shell config -await sandbox.pty.sendInput( - terminal.pid, - new TextEncoder().encode('source /home/user/.bashrc\n') -) -``` - - - - -```python -import threading -from e2b import Sandbox, PtySize - -sandbox = Sandbox.create("base", timeout=600) - -# Install Devin -sandbox.commands.run( - "curl -fsSL https://cli.devin.ai/install.sh | bash || true", - timeout=120, -) - -# Start login in a PTY -login_complete = threading.Event() -setup_output = "" -terminal = sandbox.pty.create( - PtySize(rows=32, cols=120), - cwd="/home/user", - timeout=0, -) - -def stream_pty(): - global setup_output - for _, _, pty in terminal: - if pty: - text = pty.decode(errors="replace") - print(text, end="") - setup_output += text - if "Then run devin" in setup_output or "Logged in as" in setup_output: - login_complete.set() - -threading.Thread(target=stream_pty, daemon=True).start() - -sandbox.pty.send_stdin( - terminal.pid, - b"/home/user/.local/bin/devin setup --force-manual-token-flow\n", -) - -# Visit the printed URL -# Paste the sign-in code -code = "/* VISIT THE PRINTED URL AND PASTE THE SIGN-IN CODE HERE */" -sandbox.pty.send_stdin(terminal.pid, f"{code}\r".encode()) - -login_complete.wait() - -# Reload shell config -sandbox.pty.send_stdin(terminal.pid, b"source /home/user/.bashrc\n") -``` - - - - ## Usage After installation and login, use `devin -p` for non-interactive mode and `--permission-mode dangerous` to auto-approve tool calls. - - - ```bash mkdir -p /home/user/project cd /home/user/project @@ -151,48 +32,10 @@ cd /home/user/project devin --permission-mode dangerous -p "Create a hello world HTTP server in Go" ``` - - - -```typescript -// Create a project directory -await sandbox.commands.run('mkdir -p /home/user/project') - -// Run Devin headlessly -const result = await sandbox.commands.run( - `/home/user/.local/bin/devin --permission-mode dangerous -p "Create a hello world HTTP server in Go"`, - { cwd: '/home/user/project' } -) - -console.log(result.stdout) -``` - - - - -```python -# Create a project directory -sandbox.commands.run("mkdir -p /home/user/project") - -# Run Devin headlessly -result = sandbox.commands.run( - '/home/user/.local/bin/devin --permission-mode dangerous -p "Create a hello world HTTP server in Go"', - cwd="/home/user/project", -) - -print(result.stdout) -``` - - - - ## Example: work on a cloned repository After installing Devin for Terminal and signing in, clone a repository and run Devin from the project directory. - - - ```bash git clone https://github.com/your-org/your-repo.git /home/user/repo cd /home/user/repo @@ -200,51 +43,4 @@ cd /home/user/repo devin --permission-mode dangerous -p "Add error handling to all API endpoints" ``` - - - -```typescript -// Clone the repository -await sandbox.git.clone('https://github.com/your-org/your-repo.git', { - path: '/home/user/repo', - username: 'x-access-token', - password: process.env.GITHUB_TOKEN, - depth: 1, -}) - -// Run Devin in the repository -const result = await sandbox.commands.run( - `/home/user/.local/bin/devin --permission-mode dangerous -p "Add error handling to all API endpoints"`, - { cwd: '/home/user/repo' } -) - -console.log(result.stdout) -``` - - - - -```python -import os - -# Clone the repository -sandbox.git.clone("https://github.com/your-org/your-repo.git", - path="/home/user/repo", - username="x-access-token", - password=os.environ["GITHUB_TOKEN"], - depth=1, -) - -# Run Devin in the repository -result = sandbox.commands.run( - '/home/user/.local/bin/devin --permission-mode dangerous -p "Add error handling to all API endpoints"', - cwd="/home/user/repo", -) - -print(result.stdout) -``` - - - - Devin can edit files, run commands, and work on code inside the sandbox without accessing your local machine.