[PR #8963] feat: add env vars for complete portable mode and isolation support #12928

Open
opened 2026-02-16 18:17:48 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/8963

State: open
Merged: No


Summary

  • Add OPENCODE_DATA_DIR environment variable to override the data directory location
  • Add OPENCODE_CACHE_DIR environment variable to override the cache directory location
  • Add OPENCODE_LOG_DIR environment variable to override the log directory location
  • Add OPENCODE_STATE_DIR environment variable to override the state directory location
  • Enables complete portable mode when combined with OPENCODE_CONFIG_DIR
  • Allows running multiple sandboxed/independent OpenCode instances on the same device
  • Update documentation in cli.mdx, config.mdx, plugins.mdx, and troubleshooting.mdx

Use Cases

  • Portable mode: Store all OpenCode data, cache, logs, and state alongside config in a single directory for easy sync across devices (e.g., USB drive, cloud storage)
  • Isolated instances: Run multiple independent OpenCode instances on the same machine with completely separate data directories, caches, logs, and state
  • Testing/development: Sandbox OpenCode for testing without affecting your main installation
  • Custom deployments: Point all OpenCode storage to non-standard locations for containerized or restricted environments

Closes #4526
Closes #8968

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/8963 **State:** open **Merged:** No --- # Summary - Add OPENCODE_DATA_DIR environment variable to override the data directory location - Add OPENCODE_CACHE_DIR environment variable to override the cache directory location - Add OPENCODE_LOG_DIR environment variable to override the log directory location - Add OPENCODE_STATE_DIR environment variable to override the state directory location - Enables complete portable mode when combined with OPENCODE_CONFIG_DIR - Allows running multiple sandboxed/independent OpenCode instances on the same device - Update documentation in cli.mdx, config.mdx, plugins.mdx, and troubleshooting.mdx # Use Cases - Portable mode: Store all OpenCode data, cache, logs, and state alongside config in a single directory for easy sync across devices (e.g., USB drive, cloud storage) - Isolated instances: Run multiple independent OpenCode instances on the same machine with completely separate data directories, caches, logs, and state - Testing/development: Sandbox OpenCode for testing without affecting your main installation - Custom deployments: Point all OpenCode storage to non-standard locations for containerized or restricted environments Closes #4526 Closes #8968
yindo added the pull-request label 2026-02-16 18:17:48 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#12928