From d9c1bee2aad6a170c9aa91ad4289cd7253989a44 Mon Sep 17 00:00:00 2001 From: Robert Brennan Date: Sun, 24 Mar 2024 23:35:12 -0400 Subject: [PATCH] Add instructions to README.md (#129) * Update README.md * add WORKSPACE_DIR env var * Update README.md * Update session.py --------- Co-authored-by: Robert Brennan --- README.md | 18 ++++++++++++++++++ opendevin/server/session.py | 4 +++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index bf08ffb58a..16c82e2177 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,24 @@ ## Mission 🎯 Welcome to OpenDevin, an open-source project aiming to replicate [Devin](https://www.cognition-labs.com/introducing-devin), an autonomous AI software engineer who is capable of executing complex engineering tasks and collaborating actively with users on software development projects. This project aspires to replicate, enhance, and innovate upon Devin through the power of the open-source community. +## Work in Progress + +OpenDevin is still a work in progress. But you can run the current app to see things working end-to-end: + +```bash +export OPENAI_API_KEY="..." +export WORKSPACE_DIR="/path/to/your/project" +python -m pip install -r requirements.txt +uvicorn opendevin.server.listen:app --port 3000 +``` +Then in a second terminal: +```bash +cd frontend +npm install +npm run start -- --port 3001 +``` + +You'll see OpenDevin running at localhost:3001 ## 🤔 What is [Devin](https://www.cognition-labs.com/introducing-devin)? diff --git a/opendevin/server/session.py b/opendevin/server/session.py index d3c2867b8f..5d67ccfc40 100644 --- a/opendevin/server/session.py +++ b/opendevin/server/session.py @@ -8,6 +8,8 @@ from opendevin.agent import Agent from opendevin.controller import AgentController from opendevin.lib.event import Event +DEFAULT_WORKSPACE_DIR = os.getenv("WORKSPACE_DIR", os.getcwd()) + def parse_event(data): if "action" not in data: return None @@ -72,7 +74,7 @@ class Session: print("Client websocket disconnected", e) async def create_controller(self, start_event=None): - directory = os.getcwd() + directory = DEFAULT_WORKSPACE_DIR if start_event and "directory" in start_event.args: directory = start_event.args["directory"] agent_cls = "LangchainsAgent"