Skip to main content

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.

PyPI version Python 3.7+ License: MIT


โœจ 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 -y flag 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

For Fly.io Deployment

For Editor Configuration Sync

  • VS Code and/or Cursor installed locally (optional)
  • Extensions accessible via code --list-extensions or cursor --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.toml for 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 -y to 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

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


โค๏ธ from ngram

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

opencodespace-0.5.0.tar.gz (42.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

opencodespace-0.5.0-py3-none-any.whl (26.4 kB view details)

Uploaded Python 3

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

Hashes for opencodespace-0.5.0.tar.gz
Algorithm Hash digest
SHA256 58682520357b7b88553e8062cc082369de3d80d52cb45ebe3ec2f3f748ce289a
MD5 e48bf68040c83fd6538e5283f788cc59
BLAKE2b-256 9b4f99c6fd3371648d1608a1dbe8529204b044fc4015f8d05526b2467c10ddb1

See more details on using hashes here.

Provenance

The following attestation bundles were made for opencodespace-0.5.0.tar.gz:

Publisher: publish-to-pypi.yml on ngramai/opencodespace

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for opencodespace-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0bb9ce26ee9b7f35325c5ccb787857aa90689ad9fab1ff86cd358adb77fdea17
MD5 4ee40cbcaf5dbd6580014fab78aeced7
BLAKE2b-256 c9881315b1ace1a0c7c3f201a113b3033eaaeb0f383246f31aa5994f7cc936bc

See more details on using hashes here.

Provenance

The following attestation bundles were made for opencodespace-0.5.0-py3-none-any.whl:

Publisher: publish-to-pypi.yml on ngramai/opencodespace

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page