Skip to content

fix(install): Add instructions to source config file in install#27733

Open
srivenkateswaran6002 wants to merge 2 commits into
anomalyco:devfrom
srivenkateswaran6002:fix-post-install-instruction-ask-user
Open

fix(install): Add instructions to source config file in install#27733
srivenkateswaran6002 wants to merge 2 commits into
anomalyco:devfrom
srivenkateswaran6002:fix-post-install-instruction-ask-user

Conversation

@srivenkateswaran6002
Copy link
Copy Markdown

Issue for this PR

Closes #27732

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

After running the install script, opencode is added to the shell config file but the current session doesn't pick up the new PATH entry. New users often try running opencode immediately and get command not found because they don't realize they need to reload their shell config or open a new terminal.

The script already detects the correct config file (stored in $config_file when found, or a list in $config_files as fallback). This PR reuses that existing logic to print a short message at the end of installation telling the user exactly how to activate it for the current session:

  • If $config_file is set, it shows source <that_file>
  • Otherwise it falls back to the first entry from $config_files
  • It also mentions that opening a new terminal tab/window works too.

How did you verify your code works?

Tested locally on macOS with a fresh install:

  1. Removed ~/.opencode and the PATHexport from ~/.zshrc to simulate a first-time install.
  2. Ran the install script and confirmed the new message prints with the correct source ~/.zshrc command.
  3. Ran opencode --version in the same terminal before sourcing and confirmed it fails with command not found.
  4. Ran the suggested source command, then opencode --version which works as expected

Screenshots / recordings

fixed - demo

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

**Note : ** The fix is adding the following lines to the end of the install script.

echo -e "${MUTED}Run the following to use opencode in this session:${NC}"
if [[ -n "$config_file" ]]; then
    echo -e "  ${ORANGE}source $config_file${NC}"
else
    echo -e "  ${ORANGE}source ${config_files%% *}${NC}"
fi
echo -e "${MUTED}or open a new terminal tab/window.${NC}"
echo -e ""

Print a short message at the end of the install script showing how to source the opencode config for the current session. Uses $config_file if set, otherwise shows the first file from $config_files, and also suggests opening a new terminal tab/window.
@github-actions
Copy link
Copy Markdown
Contributor

Hey! Your PR title Add instructions to source config file in install doesn't follow conventional commit format.

Please update it to start with one of:

  • feat: or feat(scope): new feature
  • fix: or fix(scope): bug fix
  • docs: or docs(scope): documentation changes
  • chore: or chore(scope): maintenance tasks
  • refactor: or refactor(scope): code refactoring
  • test: or test(scope): adding or updating tests

Where scope is the package name (e.g., app, desktop, opencode).

See CONTRIBUTING.md for details.

@srivenkateswaran6002 srivenkateswaran6002 changed the title Add instructions to source config file in install fix(install): Add instructions to source config file in install May 15, 2026
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.

Bug: Installation script does not prompt to source shell config after installation

1 participant