- Enable AI to auto-complete actions safely.
- Allow multiple VS Code instances to run in isolation.
- Provide a reusable base Docker image with:
- Ubuntu
- Rich dev toolkit: Rust, Python, .NET, GCC+LLVM
- Networking tools: tcpdump, snort, wireshark, iptables, etc.
- VS Code, git, shell utilities
- X and remote X tools
- Develop a Python-based dev tool that:
- Accepts a local repo as an argument
- Clones a new Docker image with the repo (COW) and a local workspace (RW)
- Runs the image with both repo and workspace, with remote X display
- Inside Docker: creates a new feature branch in a worktree, names it
YYMMDD-<feature>, runs VS Code, and ensures the worktree is available for merging - Leaves a comprehensive commit message for the feature branch
- Allows resuming and finishing sessions
- Prompts for squash-merging to master, with a single commit referencing the branch for full history
- Supports extension of workflows (start, resume, squash-merge, etc.) via plugins/extensions
- Ensure user settings, extensions, and workspace state can persist across sessions.
- Include comprehensive documentation and LLM usage instructions.
- Provide automated build/test/clippy workflows and a plan for automated testing of the dev tool.
- ✅ Base Docker Image: Complete - Dockerfile with Ubuntu, dev tools, networking utilities, code-server, and X11 support
- ✅ Basic CLI Structure:
devtool/cli.pywith minimal argument parsing - ✅ Testing Infrastructure: pytest setup with basic CLI tests
- ✅ Docker Compose: Basic setup for testing X11 with xclock
- ✅ Session Discovery Feature:
devtool listanddevtool statuscommands implemented - ✅ Virtual Environment: Setup with
SETUP_ENV.sh, wrapper scriptdevtool.sh - 🚧 Dev Tool Core: Basic CLI only - needs full workflow implementation
- ❌ VS Code Integration: Not started
- ❌ X11 Forwarding: Not implemented for VS Code
- ❌ Session Management: Not implemented
- ❌ Git Worktree Workflow: Not implemented
Phase 1: CLI-Only Workflow (Current Focus)
- Implement core workflow using command-line tools only
- Validate Git worktree management and Docker orchestration
- Build robust session lifecycle (start → develop → finish)
- Defer VS Code and X11 integration until CLI workflow is proven
Phase 2: VS Code Integration
- Add code-server for headless VS Code
- Implement X11 forwarding for GUI
- Ensure orthogonal to CLI workflow
Phase 3: Advanced Features
- Plugin system for workflow extensions
- Session persistence and state management
- User settings/extensions persistence
- Feature Branches: Each complementary feature gets its own
YYMMDD-featurebranch - Incremental Development: Build and test each component separately
- CLI-First Validation: Prove core workflow works before adding GUI layers
These quality-of-life improvements will be implemented as separate feature branches:
-
Session Discovery & Listing ✅ COMPLETED
devtool list- Show active sessionsdevtool status- System overview- Auto-detect orphaned containers/worktrees
-
State Management & Cleanup
devtool cleanup- Remove stale resourcesdevtool doctor- Health checks- Auto-cleanup policies
-
Workspace Organization
devtool init- Setup workspace structure- Configurable workspace locations
devtool workspaces- Manage directories
-
Configuration Management
- User config in
~/.devtool/config.json devtool config- View/edit settings
- User config in
-
Validation & Diagnostics
devtool check <repo>- Pre-flight validation- Permission and dependency checks
-
Better Error Handling & Logging
- Structured logging to
~/.devtool/logs/ - Debug mode support
- Structured logging to
-
Helper Utilities
devtool shell <session>- Container accessdevtool logs <session>- Container logsdevtool export <session>- Debug exports
# Clone the repository and enter the worktree
cd 250906-devtool-cli-worktree
# Setup virtual environment (optional - CLI works without it)
./SETUP_ENV.sh
# Or use the wrapper script (handles venv automatically)
./devtool.sh --help# Show version
python3 devtool/cli.py --version
# or with wrapper
./devtool.sh --version
# List active sessions and resources
python3 devtool/cli.py list
# Show system status
python3 devtool/cli.py status
# Show help
python3 devtool/cli.py --help# Run tests
python3 -m pytest tests/ -v
# Run with virtualenv
source .venv/bin/activate && python3 -m pytest tests/ -v- Base Docker Image: Ubuntu-based, pre-installed with major language toolchains, networking tools, VS Code, and X/remote X support. Designed for easy extension.
- Dev Tool (Python): CLI utility to manage containerized VS Code sessions, feature branch workflows, and session persistence. Plugin system for workflow extensions.
- Session Isolation: Each feature branch runs in its own Docker container, leveraging Docker’s isolation. Optional: resource limits and security flags for extra sandboxing.
- Persistence: User settings, extensions, and workspace state are mounted to persist across sessions.
- Documentation: Usage, troubleshooting, LLM instructions, and FAQ.
-
Base Image
- Build a Dockerfile with all required tools and language runtimes.
- General Principle: Break up
apt-getand other installation steps into logical layers to maximize Docker build caching and minimize rebuild times when updating dependencies. - Add support for X/remote X and VS Code.
- Document image extension process.
-
Dev Tool (Python)
- CLI to start, resume, and finish sessions.
- Accepts repo as argument, sets up COW repo and RW workspace.
- Manages Docker container lifecycle and feature branch workflow.
- Plugin system for workflow extensions (e.g., squash-merge, resume, etc.).
- Ensure persistence of user settings and extensions.
-
Workflow
- On session start: create feature branch, launch VS Code in container, remote X display.
- On finish: comprehensive commit message, squash-merge prompt, reference to full branch history.
- Support for resuming/finishing sessions.
-
Automation & Testing
- Integrate build/test/clippy workflows.
- Plan and implement automated tests for the dev tool.
-
Documentation
- Write clear setup, usage, and troubleshooting docs.
- Include LLM usage instructions and FAQ.
The end result will be a robust, reproducible, and extensible workspace for safe, isolated, and efficient development with AI and VS Code.