Launch disposable VS Code development environments with AI tooling support
Project description
๐ฐ๏ธ OpenCodeSpace
Launch disposable VS Code development environments for YOLO mode development with AI tools like Claude Code and Gemini. Either locally with Docker or remotely on Fly.io (AWS, GCE, Digital Ocean coming soon). Like Code Spaces, but fully self hosted and open source.
โจ Features
- ๐ณ Local Development: Run environments locally using Docker (Remote Docker coming soon)
- โ๏ธ Cloud Deployment: Deploy to Fly.io's global platform (AWS, GCE, Digital Ocean coming soon).
- ๐ค AI-Ready: Pre-configured with Claude Code and Gemini CLI, plus easy API key setup for Anthropic, Gemini, and OpenAI
- ๐ป Editor Sync: Automatically detect and copy VS Code/Cursor settings & extensions
- ๐ Secure: SSH key support for private Git repositories with auto-generated VS Code passwords
- โก Fast Setup: One command deployment with smart defaults and guided setup wizard
- ๐ Interactive & Automated: Full CLI with
-yflag for CI/CD - ๐ Flexible: Upload folders or work with empty environments
- ๐ง Cross-Platform: Works on macOS, Windows, and Linux (Untested on Linux and Windows)
๐ Quick Start
๐ฆ Installation
pip install opencodespace
๐ฏ Deploy Your First Environment
# Interactive setup with editor detection (recommended)
opencodespace
# Non-interactive with defaults (skips editor config)
opencodespace -y
# Deploy specific directory
opencodespace deploy /path/to/project
# Deploy with specific platform
opencodespace deploy --platform fly
๐ Managing Environments
# Stop environment
opencodespace stop
# Remove environment completely
opencodespace remove
# List available providers
opencodespace --list-providers
๐ป CLI Reference
Commands
| Command | Description |
|---|---|
opencodespace |
Deploy current directory with interactive setup |
opencodespace deploy [path] |
Deploy specific directory |
opencodespace stop [path] |
Stop the environment |
opencodespace remove [path] |
Remove the environment |
Global Options
| Option | Description |
|---|---|
-y, --yes |
Skip interactive prompts, use defaults (no editor config) |
--list-providers |
Show available deployment providers |
-v, --version |
Show version information |
Examples
# Full interactive setup with editor detection
opencodespace
# Quick deployment with defaults (no editor sync)
opencodespace -y
# Deploy to specific platform
opencodespace deploy --platform local
# Deploy with editor configuration for specific directory
opencodespace deploy /path/to/my-project
โ๏ธ Configuration
Note: Run the interactive setup wizard to generate .opencodespace/config.toml
Configuration Options
| Option | Default | Description |
|---|---|---|
name |
Auto-generated | Environment name |
platform |
"local" |
Deployment platform (local or fly) |
upload_folder |
true |
Upload current directory to container |
git_branching |
true |
Enable Git branch management |
dockerfile |
"Dockerfile" |
Custom Dockerfile name |
vscode_password |
Auto-generated | VS Code/Coder access password |
api_keys |
[] |
Legacy environment variables list (use ai_api_keys instead) |
ai_api_keys.ANTHROPIC_API_KEY |
"" |
Anthropic (Claude) API key |
ai_api_keys.GEMINI_API_KEY |
"" |
Google Gemini API key |
ai_api_keys.OPENAI_API_KEY |
"" |
OpenAI (ChatGPT) API key |
Editor Configuration Options
| Option | Default | Description |
|---|---|---|
vscode_config.copy_settings |
false |
Copy editor settings to remote |
vscode_config.copy_extensions |
false |
Install extensions in remote |
vscode_config.detected_editors |
[] |
List of detected editors |
vscode_config.*_settings_path |
null |
Path to local settings file |
vscode_config.*_extensions_list |
[] |
List of extensions to install |
๐ Requirements
For Local Development
- Python 3.7+
- Docker - Install Docker Desktop
For Fly.io Deployment
- Python 3.7+
- flyctl - Install flyctl
For Editor Configuration Sync
- VS Code and/or Cursor installed locally (optional)
- Extensions accessible via
code --list-extensionsorcursor --list-extensions
๐ฏ Usage Scenarios
๐ Local Development with Editor Sync
Perfect for testing with your complete development setup:
# Interactive setup with editor detection
opencodespace
# Manual configuration for local platform
opencodespace deploy --platform local
Your remote environment will have:
- โ All your installed extensions
- โ Your settings.json configuration
- โ Your themes and preferences
- โ Language-specific settings
โ๏ธ Cloud Development with Full Setup
Deploy to Fly.io with your complete editor configuration:
# Interactive setup for cloud deployment
opencodespace
# Configure platform during setup
> Select platform: fly.io
# Access your fully configured environment
# at https://your-app.fly.dev
๐ค AI Development Environment
Pre-configured with AI tools, automatic password generation, and your editor setup:
# Full setup with AI tools and editor config
opencodespace
# During interactive setup, you'll configure:
# - Secure auto-generated VS Code password
# - VS Code/Cursor settings & extensions
# - AI API keys (Anthropic, Gemini, OpenAI)
# - Git repository access
# - SSH keys for private repos
Your environment will include:
- โ Secure Access: Auto-generated password for VS Code/Coder
- โ AI Integration: API keys available as environment variables
- โ Complete Setup: Your editor preferences and extensions
๐ Private Repositories with Editor Sync
Secure access to private repos with your development environment:
# Interactive setup handles everything
opencodespace
# Setup wizard will:
# 1. Detect your editors
# 2. Offer to copy settings/extensions
# 3. Configure SSH keys for Git access
# 4. Set up repository cloning
๐ Team Development Environments
Share consistent development environments:
# Each team member gets the same setup
opencodespace
# Everyone can optionally overlay their own:
# - Editor preferences
# - Extension sets
# - Personal settings
โ ๏ธ Important Notes
Secure Access
- Auto-Generated Passwords: VS Code/Coder passwords are automatically generated during setup
- Password Storage: Passwords are saved in your
.opencodespace/config.tomlfor reference - Password Display: The password is displayed prominently during setup and after deployment
AI API Keys Configuration
- Structured Setup: AI API keys are now configured in the dedicated
[ai_api_keys]section - Environment Variables: Keys are automatically available as environment variables in your container
- Supported Services: Anthropic (Claude), Google Gemini, and OpenAI (ChatGPT)
- Optional Configuration: All AI API keys are optional and can be configured later
Editor Configuration
- Interactive Mode: Editor detection and configuration only happens during interactive setup
- Non-Interactive Mode: Use
opencodespace -yto skip editor configuration for CI/CD - Multiple Editors: If both VS Code and Cursor are detected, you can choose to copy from both
- Extension Compatibility: Cursor extensions are compatible with VS Code and will be installed
Empty Workspace Warning
When both SSH key and folder upload are disabled:
โ ๏ธ Warning: No SSH key provided and folder upload disabled.
The container will start with an empty workspace and no git access.
Consider enabling folder upload or providing an SSH key for git operations.
Container Names
- Local:
opencodespace-{name} - Fly.io: Uses the app name directly
๐ง Development
Package Structure
opencodespace/
โโโ src/opencodespace/ # Modern src layout
โ โโโ main.py # CLI with editor detection
โ โโโ providers/ # Platform providers
โ โโโ .opencodespace/ # Docker templates with editor setup
โโโ setup.py # Package configuration
โโโ README.md # This file
AI API Keys Configuration
During interactive setup, you can configure AI API keys for popular services:
- Anthropic (Claude): For Claude AI development assistance
- Google Gemini: For Google's Gemini AI models
- OpenAI (ChatGPT): For OpenAI's GPT models
These keys are securely stored in your config and available as environment variables in your development environment, making it easy to use AI tools directly in your code.
๐จ Development & Building
This project includes a comprehensive build system with multiple interfaces for development tasks.
Quick Development Setup
git clone https://github.com/devadutta/opencodespace.git
cd opencodespace
# Install dependencies and package in development mode
make install
# or: python dev-build.py install
# or: ./build.sh install
# Run quick tests during development
make test-quick
# or: python dev-build.py test --quick
# or: ./build.sh test-quick
Build System Overview
Three equivalent interfaces for development tasks:
python dev-build.py [command]- Feature-rich Python script (cross-platform)make [target]- Traditional Makefile interface (Unix/Linux)./build.sh [command]- Simple shell script wrapper
Available Commands
| Command | Description |
|---|---|
install |
Install dependencies and package in development mode |
test |
Run the complete test suite |
test-quick |
Run quick tests (recommended for development) |
clean |
Clean build artifacts and cache files |
build |
Build package for distribution |
lint |
Run code quality checks |
all |
Run complete build pipeline |
Examples
# Development workflow
make install # Set up development environment
make test-quick # Test your changes
make all # Full build pipeline before PR
# Building for distribution
make clean
make build
# Get help
python dev-dev-build.py help
make help
./build.sh help
For detailed documentation, see BUILD.md.
๐ค Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
โค๏ธ from ngram
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file opencodespace-0.5.0.tar.gz.
File metadata
- Download URL: opencodespace-0.5.0.tar.gz
- Upload date:
- Size: 42.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
58682520357b7b88553e8062cc082369de3d80d52cb45ebe3ec2f3f748ce289a
|
|
| MD5 |
e48bf68040c83fd6538e5283f788cc59
|
|
| BLAKE2b-256 |
9b4f99c6fd3371648d1608a1dbe8529204b044fc4015f8d05526b2467c10ddb1
|
Provenance
The following attestation bundles were made for opencodespace-0.5.0.tar.gz:
Publisher:
publish-to-pypi.yml on ngramai/opencodespace
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
opencodespace-0.5.0.tar.gz -
Subject digest:
58682520357b7b88553e8062cc082369de3d80d52cb45ebe3ec2f3f748ce289a - Sigstore transparency entry: 315943846
- Sigstore integration time:
-
Permalink:
ngramai/opencodespace@05dd0910b074baf419f4fafaf0515fe32bbf24c4 -
Branch / Tag:
refs/tags/v0.5.0 - Owner: https://github.com/ngramai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@05dd0910b074baf419f4fafaf0515fe32bbf24c4 -
Trigger Event:
release
-
Statement type:
File details
Details for the file opencodespace-0.5.0-py3-none-any.whl.
File metadata
- Download URL: opencodespace-0.5.0-py3-none-any.whl
- Upload date:
- Size: 26.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0bb9ce26ee9b7f35325c5ccb787857aa90689ad9fab1ff86cd358adb77fdea17
|
|
| MD5 |
4ee40cbcaf5dbd6580014fab78aeced7
|
|
| BLAKE2b-256 |
c9881315b1ace1a0c7c3f201a113b3033eaaeb0f383246f31aa5994f7cc936bc
|
Provenance
The following attestation bundles were made for opencodespace-0.5.0-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on ngramai/opencodespace
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
opencodespace-0.5.0-py3-none-any.whl -
Subject digest:
0bb9ce26ee9b7f35325c5ccb787857aa90689ad9fab1ff86cd358adb77fdea17 - Sigstore transparency entry: 315943855
- Sigstore integration time:
-
Permalink:
ngramai/opencodespace@05dd0910b074baf419f4fafaf0515fe32bbf24c4 -
Branch / Tag:
refs/tags/v0.5.0 - Owner: https://github.com/ngramai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@05dd0910b074baf419f4fafaf0515fe32bbf24c4 -
Trigger Event:
release
-
Statement type: