Add workspace mode flags and rebuild functionality#2
Open
pakar wants to merge 13 commits intofilipesoccol:mainfilipesoccol/opencode-box:mainfrom
Open
Add workspace mode flags and rebuild functionality#2pakar wants to merge 13 commits intofilipesoccol:mainfilipesoccol/opencode-box:mainfrom
pakar wants to merge 13 commits intofilipesoccol:mainfilipesoccol/opencode-box:mainfrom
Conversation
pakar
commented
Nov 24, 2025
- Add --mount-ro, --mount-rw, --gitcheckout flags for different workspace modes
- Skip SSH requirements for mount modes (only needed for gitcheckout)
- Remove --rm flag for mount modes to prevent accidental file deletion
- Add --rebuild flag to force Docker image recreation and updates
- Update help text with comprehensive mode documentation and examples
- Implement conditional Docker mounting and SSH configuration per mode
- Add workspace mode detection and handling in entrypoint script
- Add --mount-ro, --mount-rw, --gitcheckout flags for different workspace modes - Skip SSH requirements for mount modes (only needed for gitcheckout) - Remove --rm flag for mount modes to prevent accidental file deletion - Add --rebuild flag to force Docker image recreation and updates - Update help text with comprehensive mode documentation and examples - Implement conditional Docker mounting and SSH configuration per mode - Add workspace mode detection and handling in entrypoint script
Author
|
PR is currently in testing and making a few improvements. |
- Add --it flag to get interactive shell in existing gitcheckout containers - Implement smart container naming: project-name + path hash for consistency - Add conditional -it flag: only for gitcheckout mode (interactive sessions) - Remove -it flag for mount modes (non-interactive, resource efficient) - Add timestamp variable scope fix for all container operations - Update help text with --it flag documentation and examples - Implement container detection and shell access logic for debugging - Support multiple mount instances with unique timestamps - Maintain consistent container names for gitcheckout mode per project path
- Add workspace modes section (--mount-ro, --mount-rw, --gitcheckout) - Document --it flag for interactive shell access in gitcheckout containers - Add --rebuild flag documentation and examples - Include command reference table with all modes and options - Update authentication requirements per mode (SSH only for gitcheckout) - Add advanced usage examples for multiple instances and debugging - Update troubleshooting section with new flag-specific issues - Mark completed features in roadmap section - Provide comprehensive usage examples for all scenarios
- Always allocate -it flag for OpenCode terminal functionality - OpenCode requires TTY even in non-interactive mount modes - Previously only allocated TTY for gitcheckout mode, causing terminal issues - This ensures proper terminal forwarding and OpenCode functionality across all modes
- Set terminal title with project name and mode emoji - Format: '<emoji> OpenCode Box: <project> (<mode>)' - Works on Linux with TERM environment variable - Provides clear visual indication of current session - Helps users identify multiple terminal windows easily - Falls back gracefully if terminal title setting fails
- Fix comment to clarify cleanup only runs for --gitcheckout mode - Cleanup code was already correct (only processes gitcheckout temporary volumes) - No functional changes, just comment clarification for code clarity
- Add containerStarted flag to track if container actually started - Prevent cleanup code from running when container never started due to early exit - Fix ReferenceError: workspaceVolume is not defined during early exit - Ensure cleanup only runs for gitcheckout mode when container was successfully started
- Set containerStarted = true for mount modes (--mount-ro, --mount-rw) - Previously only set for --gitcheckout mode - Prevents cleanup code from running when container never started - Ensures proper container lifecycle tracking across all workspace modes
- Update comment to 'Clean up temporary volumes' for accuracy - No functional changes, just comment clarification - Ensures code clarity and consistency
- Fix accidental removal of cleanup code section - Restore proper cleanup logic for gitcheckout mode - Ensure container lifecycle management works correctly
…ython3 to docker-build. WIP, we should have a ~/.config/opencode-box/Dockerfile that is used and allow the user to adapt it to their usecase instead of always including everything
|
@filipesoccol is there any plan to merge this one? @pakar |
Author
|
@filipesoccol Sorry but this became stale. What was left is to clean it up a little bit and add support for a config of what packages to include inside docker-image. What it is still works if you want to cherry-pick some things, but have myself switched to a simpler solution using bubblewrap. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.