Your AI-powered R pair programmer, based on IncognitoPilot.
Before you begin, ensure you have the following installed:
- Git for cloning the repository
- Python (version 3.9-3.12)
- Windows: Download from https://www.python.org/downloads/
- Mac:
brew install python@3.12 - Linux:
sudo apt-get install python3.12
- R
- Windows: Download from https://cran.r-project.org/bin/windows/base/
- Mac:
brew install ror download from https://cran.r-project.org/bin/macosx/ - Linux:
sudo apt-get install r-base
- Bun
- Linux & macOS:
curl -fsSL https://bun.sh/install | bash - Windows:
powershell -c "irm bun.sh/install.ps1 | iex"
- Linux & macOS:
-
Clone and setup:
git clone https://github.com/markuryy/R-Pilot.git cd R-Pilot bun install bun run setup -
Start R-Pilot:
bun run dev
-
Open the authentication link shown in the terminal (starts with http://localhost:3000).
- The link includes a token that's valid for your session
- You can share this link with others to give them access
- The token persists in your browser for future sessions
If the setup script fails, follow these steps:
-
Create and activate a virtual environment:
pushd apps/api/services python -m venv venv # On Unix/macOS: source venv/bin/activate # On Windows: .\venv\Scripts\activate
-
Install dependencies:
pip install poetry poetry install popd # Back to root bun install
-
Set up environment files:
Create
apps/api/services/.env:OPENAI_API_KEY=your_api_key_here # Optional - For Cloudflare rate limiting proxy via AI Gateway # OPENAI_API_BASE=your_cloudflare_worker_url_here INTERPRETER_TYPE=r R_PATH=/path/to/R # Get this using 'which R' on Unix or 'where R' on Windows WORKING_DIRECTORY=/path/to/workspace ALLOWED_HOSTS=localhost:3000 FRONTEND_URL=localhost:3000 ENABLE_CORS=TRUE # Optional: Set a specific auth token AUTH_TOKEN=your_chosen_token # Optional: Use HTTPS for auth links USE_HTTPS=false
Create
apps/web/.env.local:NEXT_PUBLIC_SERVICES_URL=http://localhost:8000
-
Start the development servers:
bun run dev
This command starts both the backend and frontend services. If you prefer to run them separately:
Terminal 1 (Backend):
cd apps/api/services source venv/bin/activate # or .\venv\Scripts\activate on Windows poetry shell uvicorn main:app --reload
Terminal 2 (Frontend):
cd apps/web bun run dev
- AI-powered R programming assistance
- Interactive R code execution
- Real-time output and plotting
- Sandboxed environment for sharing files
- Shareable authentication links
-
Authentication Issues
- Check terminal output for the correct authentication link
- Make sure to use http:// in development (not https://)
- You can set a custom token with
AUTH_TOKEN=your_tokeninapps/api/services/.env - The token is saved in your browser for future sessions
- Sharing the auth link with others will work as long as they use the same token
-
Docker Authentication
- The authentication system works the same way in Docker
- Use the link provided in the backend container logs
- Container networking is automatically configured
- Images and files are served correctly between containers
-
R Issues
- Make sure R is installed: Run
R --versionin terminal - If R isn't found, reinstall from https://www.r-project.org/
- If you must specify your own path, find it using
which R
- Make sure R is installed: Run
-
Python Issues
- Make sure you have Python 3.9-3.12 installed (3.13+ not supported yet)
- Windows: Download from https://www.python.org/downloads/
- Mac:
brew install python@3.12 - Linux: Check your package manager for Python 3.9-3.12
-
Connection Failed
- Check if backend is running (look for messages in terminal)
- Make sure ports 3000 and 8000 are free
- In Docker, check container logs with
docker compose logs
This project was never meant for public deployment, so certain features like filesystem interactions will not be available in production on Vercel, for example. You may be able to containerize the whole stack and serve the frontend with nginx; open a pull request if you want to give it a try.
