Skip to content

Add full container management with templates, terminal, and Claude Code integration#174

Merged
tylergraydev merged 2 commits intomainfrom
feature/container-management
Mar 23, 2026
Merged

Add full container management with templates, terminal, and Claude Code integration#174
tylergraydev merged 2 commits intomainfrom
feature/container-management

Conversation

@tylergraydev
Copy link
Copy Markdown
Owner

Summary

  • Template-first container creation wizard with 9 preconfigured devcontainer templates (Node.js, TypeScript, Rust/Tauri, Python, Go, .NET, Ubuntu, PostgreSQL, Redis) using official Microsoft base images and technology logos
  • Full container lifecycle controls — start/stop/restart buttons on cards with live status badges, loading states, and toast notifications for unexpected stops
  • Interactive xterm.js terminal (Console tab) with full bash/shell support, tab completion, command history, and auto-resize
  • File browser (Files tab) for navigating container filesystems with directory navigation and file metadata
  • Git repo cloning on first start via a "Repository URL" field in the container form
  • Claude Code integration settings (Settings > Containers) — auto-mount ~/.claude/ for Max Plan OAuth or inject API key, with optional auto-install of Claude Code in containers
  • Copy-to-clipboard docker exec commands for connecting via external terminals (Warp, etc.)
  • UI audit fixes across all container components — design system normalization (.input/.btn/.card classes), accessibility (ARIA labels, keyboard nav, focus management), responsive layout, error feedback, and modal hardening (Escape/backdrop dismiss)

Key technical changes

Backend (Rust):

  • Auto image pull before first container creation
  • Containers stay alive with sleep infinity + TTY (fixes devcontainer immediate exit)
  • Interactive shell sessions via Bollard exec API with Tauri event streaming
  • repo_url column + migration for git clone on first start
  • post_create_command execution after repo clone
  • Claude Code settings stored in app_settings table
  • Delete now properly removes Docker containers (fixes name conflict bug)

Frontend (Svelte 5):

  • NewContainerWizard — two-step flow: pick template or custom, then configure
  • ContainerTerminal — xterm.js with streaming I/O via Tauri events
  • ContainerFiles — exec-based filesystem browser
  • ContainerDetail — tabbed modal (Overview, Logs, Stats, Console, Files) with lifecycle controls
  • Enhanced ContainerCard with status badges, action buttons, loading states
  • Enhanced toast system with detail text and clickable actions
  • SettingsContainersTab for Claude Code auth configuration

Test plan

  • Create container from Node.js template with a GitHub repo URL
  • Verify image pulls, container starts, repo clones into /workspace
  • Test start/stop/restart from card buttons — verify status badges update
  • Open Console tab — verify interactive bash with tab completion works
  • Open Files tab — verify filesystem navigation works
  • Test "View Logs" toast action when container stops unexpectedly
  • Verify delete removes both DB entry and Docker container
  • Configure Claude Code settings (Max Plan mode) and verify ~/.claude mount
  • Copy docker exec command and verify it works in external terminal
  • Test creating custom container (no template) with manual configuration

…minal, and Claude Code integration

Major feature: complete dev container management system that lets users create containers
from preconfigured templates (Node.js, TypeScript, Rust/Tauri, Python, Go, .NET, PostgreSQL, Redis),
manage their lifecycle (start/stop/restart), browse files, execute commands via an interactive
xterm.js terminal, and run Claude Code inside containers with automatic auth sharing.

Key changes:
- Template-first "New Container" wizard with 9 devcontainer templates using official Microsoft base images
- Container cards with live status badges, start/stop/restart buttons, and loading states
- Container detail modal with Overview, Logs, Stats, Console (xterm.js), and Files tabs
- Interactive terminal using Bollard exec API with streaming I/O via Tauri events
- File browser using exec-based `ls` to navigate container filesystems
- Git repo cloning on first start via repo_url field
- Auto image pull before first container creation
- Claude Code settings (Settings > Containers): Max Plan OAuth mount or API key injection
- Auto-install Claude Code in containers on first start (optional)
- Copy-to-clipboard docker exec commands for connecting via external terminals
- Toast notifications for container lifecycle events with "View Logs" action on unexpected stops
- Delete now properly removes Docker containers (fixes name conflict bug)
- Containers stay alive with `sleep infinity` (fixes immediate exit issue)
- UI audit fixes: design system normalization, accessibility (ARIA, keyboard nav), responsive layout
- Official technology logos (Simple Icons, CC0) for all templates
Security fixes:
- Prevent command injection via repo_url by validating URL format and
  using git commands directly instead of sh -c shell interpolation
- Mount ~/.claude as read-only into containers to prevent auth tampering
- Bind forwarded ports to 127.0.0.1 instead of 0.0.0.0
- Validate volume host_path against path traversal and sensitive dirs

Test fixes:
- Add missing Hammer/HardDrive stubs to lucide-svelte mock
- Update notifications tests for new add() options signature
- Update ContainerLogs test for loading-first behavior
- Update ContainerDetail test for Console/Files tabs (was Exec)
- Update DockerHostList tests for dynamic aria-labels
@tylergraydev tylergraydev merged commit ee19c02 into main Mar 23, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant