Skip to content

docs: 📚 Use OPENCODE_CONFIG_DIR in install docs#506

Closed
cavanaug wants to merge 2 commits intoobra:devfrom
cavanaug:main
Closed

docs: 📚 Use OPENCODE_CONFIG_DIR in install docs#506
cavanaug wants to merge 2 commits intoobra:devfrom
cavanaug:main

Conversation

@cavanaug
Copy link
Copy Markdown

docs(docs/README.opencode.md): 📚 Introduce OPENCODE_CONFIG_DIR and update install/verification commands for macOS/Linux, Command Prompt, PowerShell and Git Bash to use the variable; add a note about the default config directory.

Update the opencode installation documentation to support environments where the OPENCODE_CONFIG_DIR is set. This allows different global settings to be used. This for example is useful when evaluating global settings for large new features like superpowers or oh-my-opencode.

Motivation and Context

Today the docs are hardcoded to the default location of the opencode config files it does not respect the OPENCODE_CONFIG_DIR

How Has This Been Tested?

I have tested the linux install

Breaking Changes

No

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

docs(docs/README.opencode.md): 📚 Introduce OPENCODE_CONFIG_DIR and update install/verification commands for macOS/Linux, Command Prompt, PowerShell and Git Bash to use the variable; add a note about the default config directory.
Copilot AI review requested due to automatic review settings February 18, 2026 22:04
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the OpenCode installation documentation to support environments where the OPENCODE_CONFIG_DIR environment variable is set, allowing users to customize the location of their OpenCode configuration files. This is particularly useful when evaluating global settings for large features like superpowers or oh-my-opencode.

Changes:

  • Added a note explaining that all paths use the default config directory unless OPENCODE_CONFIG_DIR is set
  • Updated all installation scripts (macOS/Linux, Windows Command Prompt, PowerShell, Git Bash) to use OPENCODE_CONFIG_DIR with appropriate fallbacks
  • Updated verification commands to use the environment variable
  • Updated various code examples to reference the environment variable where appropriate

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/README.opencode.md
Comment thread docs/README.opencode.md
Comment thread docs/README.opencode.md
Comment thread docs/README.opencode.md
@cavanaug
Copy link
Copy Markdown
Author

I was trying to not add noise everywhere in the doc especially since 95% of people are not customizing their config location. But I did want all the install scripts to act appropriately without the hardcoding.

Im willing to update this to whatever the maintainers desire. This is a tradeoff between some visual noise vs accuracy that they should make, not copilot.

@obra
Copy link
Copy Markdown
Owner

obra commented Feb 21, 2026

Thanks for this. Given that this is visual noise that's going to be read by the agent, not by the human, I'm not too worried about that. Would you mind retargeting this at the dev branch rather than main? I'll get it merged into that right away.

@obra obra added documentation Improvements or additions to documentation opencode labels Feb 21, 2026
@cavanaug
Copy link
Copy Markdown
Author

Will do next week.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 2, 2026

📝 Walkthrough

Walkthrough

The documentation for OpenCode installation and setup has been updated to parameterize file-system paths using a configurable OPENCODE_CONFIG_DIR environment variable (default: ~/.config/opencode), replacing hard-coded path references across all supported shell environments.

Changes

Cohort / File(s) Summary
Documentation Configuration Parameterization
docs/README.opencode.md
Replaced hard-coded ~/.config/opencode paths with parameterized OPENCODE_CONFIG_DIR variable across macOS/Linux, Windows CMD, PowerShell, Git Bash, and WSL installation/verification/update instructions. Added variable initialization with fallback defaults in each shell context.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A rabbit hops through config with glee,
No more hard-coded paths, now wild and free!
Variables dance where directories once stood,
Flexibility flows through every shell, so good!
OpenCode's home finds its rightful place,
With customizable paths at a variable's grace.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: introducing OPENCODE_CONFIG_DIR usage in the installation documentation.
Description check ✅ Passed The description is directly related to the changeset, explaining the motivation, testing performed, and context for parameterizing paths in the opencode installation documentation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
docs/README.opencode.md (2)

205-205: Good variable-based command, but nearby path text is now inconsistent.

Line 205 correctly respects OPENCODE_CONFIG_DIR, but the surrounding prose still references only ~/.config/opencode/..., which can confuse users with custom config directories.

Proposed wording alignment
-Create your own skills in `~/.config/opencode/skills/`:
+Create your own skills in `${OPENCODE_CONFIG_DIR:-~/.config/opencode}/skills/`:

-Create `~/.config/opencode/skills/my-skill/SKILL.md`:
+Create `${OPENCODE_CONFIG_DIR:-~/.config/opencode}/skills/my-skill/SKILL.md`:
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/README.opencode.md` at line 205, The documentation mixes a
variable-based example (mkdir -p
"${OPENCODE_CONFIG_DIR:-$HOME/.config/opencode}/skills/my-skill") with
surrounding prose that still mentions only "~/.config/opencode/..."; update the
nearby explanatory text to reference OPENCODE_CONFIG_DIR and the fallback
$HOME/.config/opencode so they match the command, e.g., explain that the command
uses the OPENCODE_CONFIG_DIR environment variable with a default of
$HOME/.config/opencode and that the skill directory is created under that
resolved path; ensure mentions of "~/.config/opencode" are replaced or
supplemented with OPENCODE_CONFIG_DIR and the default path to avoid confusion.

300-300: Use OPENCODE_CONFIG_DIR in Windows troubleshooting command too.

This line reintroduces a hardcoded Windows config path, which conflicts with the new configurable-path approach.

Proposed docs tweak
-2. Check symlink/junction: `ls -l ~/.config/opencode/plugins/` (macOS/Linux) or `dir /AL "%USERPROFILE%\.config\opencode\plugins"` (Windows)
+2. Check symlink/junction: `ls -l "${OPENCODE_CONFIG_DIR:-$HOME/.config/opencode}/plugins/"` (macOS/Linux) or `if not defined OPENCODE_CONFIG_DIR set OPENCODE_CONFIG_DIR=%USERPROFILE%\.config\opencode && dir /AL "%OPENCODE_CONFIG_DIR%\plugins"` (Windows)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/README.opencode.md` at line 300, Replace the hardcoded Windows config
path in the troubleshooting command with the OPENCODE_CONFIG_DIR environment
variable: change the dir command that currently references
"%USERPROFILE%\.config\opencode\plugins" to use "%OPENCODE_CONFIG_DIR%\plugins"
so Windows respects the configurable path; update the README.opencode.md line
containing the example command (the one starting with dir /AL) accordingly and
ensure surrounding text mentions OPENCODE_CONFIG_DIR, not the old hardcoded
path.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@docs/README.opencode.md`:
- Line 205: The documentation mixes a variable-based example (mkdir -p
"${OPENCODE_CONFIG_DIR:-$HOME/.config/opencode}/skills/my-skill") with
surrounding prose that still mentions only "~/.config/opencode/..."; update the
nearby explanatory text to reference OPENCODE_CONFIG_DIR and the fallback
$HOME/.config/opencode so they match the command, e.g., explain that the command
uses the OPENCODE_CONFIG_DIR environment variable with a default of
$HOME/.config/opencode and that the skill directory is created under that
resolved path; ensure mentions of "~/.config/opencode" are replaced or
supplemented with OPENCODE_CONFIG_DIR and the default path to avoid confusion.
- Line 300: Replace the hardcoded Windows config path in the troubleshooting
command with the OPENCODE_CONFIG_DIR environment variable: change the dir
command that currently references "%USERPROFILE%\.config\opencode\plugins" to
use "%OPENCODE_CONFIG_DIR%\plugins" so Windows respects the configurable path;
update the README.opencode.md line containing the example command (the one
starting with dir /AL) accordingly and ensure surrounding text mentions
OPENCODE_CONFIG_DIR, not the old hardcoded path.

ℹ️ Review info

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e4a2375 and 004dbaf.

📒 Files selected for processing (1)
  • docs/README.opencode.md

@cavanaug cavanaug changed the base branch from main to dev March 12, 2026 15:11
@cavanaug
Copy link
Copy Markdown
Author

Superseded by #704.\n\nI retargeted #506 to the dev base, but it still used head branch cavanaug:main. GitHub does not allow changing an existing PR head branch to a different branch name, so I replayed the same docs change onto cavanaug:dev and opened #704 for a clean diff against dev.\n\nPlease review and merge #704 instead.

@cavanaug cavanaug closed this Mar 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation opencode

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants