fix: enable linux-portable mode on Linux/macOS hosts#3
Merged
mjenkinsx9 merged 3 commits intomainfrom Mar 26, 2026
Merged
Conversation
Problem: - linux-portable mode was failing on Linux/macOS with 'linux-portable mode is currently implemented for Windows hosts only' - This prevented true portability - the goal was to run Claude Code portably from a folder without installing on the host Solution: - On non-Windows hosts, linux-portable mode now uses 'portable-native' execution instead of failing - portable-native runs tools directly on the host but with portable auth isolation (auth state stored in state/auth/<tool>/host/ instead of ~) - Added runPortableHostNative() function for this behavior - Updated README with cross-platform documentation and platform-specific behavior table Changes: - scripts/pcoder.cjs: Added runPortableHostNative(), modified runInLinuxPortableVm() to call it on non-Windows platforms - README.md: Added Goal statement, Platform-Specific Behavior table, How It Works section, Directory Structure, and Testing section - scripts/runtime/linux/smoke-check.sh: New smoke test for Linux/macOS Testing: - ./scripts/pcoder doctor: All checks pass - ./scripts/pcoder run codex --mode linux-portable -- --version: Works - ./scripts/pcoder run claude --mode linux-portable -- --version: Works - ./scripts/runtime/linux/smoke-check.sh: All tests pass
- Add pwsh adapter to catalog.json - Add 'local' profile for tools that don't need external env - PowerShell works through PortableCoder on Linux Tested: ./scripts/pcoder run pwsh -- -NoProfile -Command 'Write-Host Test' PowerShell 7.6.0 ConsoleHost
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.
Summary
This PR fixes the portability issue - mode now works on Linux/macOS hosts instead of failing with 'linux-portable mode is currently implemented for Windows hosts only'.
Problem
Mike's original goal was to make Claude Code portable - run from a folder without installing on the local machine. However, the mode was only implemented for Windows (using bundled QEMU VM), and it failed on Linux/macOS.
Solution
On non-Windows hosts, mode now uses portable-native execution:
Changes
scripts/pcoder.cjs: Added function and modified to call it on non-Windows platforms
README.md:
scripts/runtime/linux/smoke-check.sh: New smoke test for Linux/macOS
Testing
All smoke tests pass:
[ok] dir:apps -> /home/gimli/repos/PortableCoder/apps
[ok] dir:profiles -> /home/gimli/repos/PortableCoder/profiles
[ok] dir:state -> /home/gimli/repos/PortableCoder/state
[ok] dir:scripts -> /home/gimli/repos/PortableCoder/scripts
[ok] settings:file -> state/settings.json
[ok] active-profile -> openai
[ok] profile:openai:env-files -> optional profile uses external env injection
[ok] profile:openai:required-env -> selected for codex in oauth mode
[ok] profile:anthropic:env-files -> optional profile uses external env injection
[ok] profile:anthropic:required-env -> selected for claude in oauth mode
[ok] tool:codex:runner -> codex (auth=oauth)
[ok] tool:claude:runner -> claude (auth=oauth)
Doctor completed: all checks passed. - All checks pass
codex-cli 0.104.0 - Works
2.1.71 (Claude Code) - Works
Repo root: /home/gimli/repos/PortableCoder
OK: pcoder launcher found
=== Running doctor ===
[ok] dir:runtime -> /home/gimli/repos/PortableCoder/runtime
[ok] dir:apps -> /home/gimli/repos/PortableCoder/apps
[ok] dir:profiles -> /home/gimli/repos/PortableCoder/profiles
[ok] dir:state -> /home/gimli/repos/PortableCoder/state
[ok] dir:scripts -> /home/gimli/repos/PortableCoder/scripts
[ok] settings:file -> state/settings.json
[ok] active-profile -> openai
[ok] profile:openai:env-files -> optional profile uses external env injection
[ok] profile:openai:required-env -> selected for codex in oauth mode
[ok] profile:anthropic:env-files -> optional profile uses external env injection
[ok] profile:anthropic:required-env -> selected for claude in oauth mode
[ok] tool:codex:runner -> codex (auth=oauth)
[ok] tool:claude:runner -> claude (auth=oauth)
Doctor completed: all checks passed.
=== Testing codex in portable-native mode ===
OK: codex works in portable-native mode
=== Testing claude in portable-native mode ===
OK: claude works in portable-native mode
=== Auth status ===
Auth status
settings initialized: yes
codex: oauth
codex host oauth home: state/auth/codex/host/home
codex vm oauth home: /home/portable/.pcoder-auth/codex
claude: oauth
claude host oauth home: state/auth/claude/host/home
claude vm oauth home: /home/portable/.pcoder-auth/claude
=== All smoke tests passed === - All tests pass
Verified Working
Remaining Work