Skip to content

Conversation

@thesobercoder
Copy link
Contributor

@thesobercoder thesobercoder commented Jan 13, 2026

Adds OpenCode CLI support for Docker deployments, matching the existing Claude Code and Cursor CLI patterns.

Changes:

  • Dockerfile: Install OpenCode CLI
  • docker-compose.yml: Add automaker-opencode-config volume
  • docker-entrypoint.sh: Create OpenCode config directories
  • docker-compose.override.yml.example: Add bind mount example
  • docs/docker-isolation.md: Document OpenCode setup

Summary by CodeRabbit

  • New Features

    • OpenCode CLI integrated into the dev environment and made available in interactive shells.
    • OpenCode config and auth now persist across container restarts via named volumes.
    • Startup ensures OpenCode config directories exist with correct ownership and permissions.
    • Example host mount lines added (commented) to illustrate optional local mounts.
  • Documentation

    • Added OpenCode CLI authentication setup, mounting guidance, and a troubleshooting entry.

✏️ Tip: You can customize this high-level summary in your review settings.

- Install OpenCode CLI in Dockerfile alongside Claude and Cursor
- Add automaker-opencode-config volume for persisting auth
- Add OpenCode directory setup in docker-entrypoint.sh
- Update docker-isolation.md with OpenCode documentation
- Add OpenCode bind mount example to docker-compose.override.yml.example
@coderabbitai
Copy link

coderabbitai bot commented Jan 13, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

📝 Walkthrough

Walkthrough

Installs the OpenCode CLI into the server image, exposes the user-local bin in interactive PATHs, adds named volumes and commented example mounts to persist OpenCode data/config, creates OpenCode config directories on container start with proper ownership/permissions, and documents mounting/troubleshooting steps.

Changes

Cohort / File(s) Summary
Docker build / CLI install & PATH
Dockerfile
Installs OpenCode CLI (curl
Compose: named volumes & examples
docker-compose.yml, docker-compose.override.yml.example
Adds named volumes automaker-opencode-data and automaker-opencode-config and mounts them to /home/automaker/.local/share/opencode and /home/automaker/.config/opencode; adds commented override example mounts in the example file.
Container init: config dir setup
docker-entrypoint.sh
Creates /home/automaker/.local/share/opencode and /home/automaker/.config/opencode if missing, sets owner to automaker and permissions to 700.
Docs / troubleshooting
docs/docker-isolation.md
Adds OpenCode CLI section: recommends mounting OpenCode dirs, updates compose override guidance, and adds troubleshooting for "OpenCode not detected".

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

Enhancement, Testers-Requested

Suggested reviewers

  • webdevcody

Poem

🐰
A curl, a bash, a tiny hop,
OpenCode lands—no build will stop.
Volumes snug and paths aligned,
Configs safe for every kind.
Hooray! 🥕✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: add OpenCode CLI support in Docker' clearly summarizes the main change: adding OpenCode CLI support to Docker deployments, which is directly reflected in all file changes.
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.


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.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @thesobercoder, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces comprehensive support for the OpenCode CLI within Docker deployments. By integrating OpenCode, users can now leverage multi-provider AI model access directly from their Dockerized environment. The changes ensure proper installation, persistent configuration, and clear documentation, aligning OpenCode's setup with existing Claude and Cursor CLI patterns for a consistent user experience.

Highlights

  • OpenCode CLI Installation: The Dockerfile has been updated to include the installation of the OpenCode CLI, enabling multi-provider AI model access within the Docker environment.
  • Docker Compose Integration: A new named volume, automaker-opencode-config, has been added to docker-compose.yml to ensure persistent storage for OpenCode CLI configuration and authentication across container restarts.
  • Configuration Directory Setup: The docker-entrypoint.sh script now creates and sets appropriate permissions for the OpenCode configuration directories (~/.local/share/opencode and ~/.config/opencode) to ensure proper operation.
  • Bind Mount Example: The docker-compose.override.yml.example file now includes a commented-out example demonstrating how users can bind mount their host's OpenCode configuration directory to share authentication sessions with the container.
  • Documentation Update: The docs/docker-isolation.md file has been updated with detailed instructions and troubleshooting tips for setting up and using OpenCode CLI within the Docker environment, mirroring existing documentation patterns for other CLIs.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds support for the OpenCode CLI to the Docker setup, which is a great feature enhancement. The changes are consistent with the existing setup for other CLIs like Claude and Cursor. My main feedback concerns an inconsistency with the OpenCode configuration directories. The docker-entrypoint.sh script correctly creates both ~/.local/share/opencode and ~/.config/opencode, but the Docker Compose files and documentation only account for persisting the former. This could lead to loss of configuration. I've provided suggestions to create a named volume for ~/.config/opencode and update the documentation accordingly. I've also included a minor refactoring suggestion for the entrypoint script to improve maintainability.


# Persist OpenCode CLI configuration and authentication across container restarts
# This allows 'opencode auth login' authentication to persist between restarts
- automaker-opencode-config:/home/automaker/.local/share/opencode
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The docker-entrypoint.sh script also prepares a ~/.config/opencode directory, implying it's used for configuration. To ensure all OpenCode configuration is persisted, you should also mount a volume for that directory.

      - automaker-opencode-config:/home/automaker/.local/share/opencode
      - automaker-opencode-user-config:/home/automaker/.config/opencode

Comment on lines 109 to 112
automaker-opencode-config:
name: automaker-opencode-config
# Named volume for OpenCode CLI configuration and authentication
# Persists opencode auth login authentication across container restarts
Copy link
Contributor

Choose a reason for hiding this comment

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

high

To support persisting the ~/.config/opencode directory, the new named volume automaker-opencode-user-config needs to be defined here.

  automaker-opencode-config:
    name: automaker-opencode-config
    # Named volume for OpenCode CLI configuration and authentication
    # Persists opencode auth login authentication across container restarts

  automaker-opencode-user-config:
    name: automaker-opencode-user-config
    # Named volume for OpenCode CLI user-specific configuration
    # Persists configuration stored in ~/.config/opencode

Comment on lines +19 to +21
# OpenCode CLI - mount your ~/.local/share/opencode directory
# This shares your 'opencode auth login' session with the container
# - ~/.local/share/opencode:/home/automaker/.local/share/opencode
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The entrypoint script indicates that OpenCode uses both ~/.local/share/opencode and ~/.config/opencode. This example should be updated to show how to mount both directories for a complete host-to-container authentication sharing setup.

      # OpenCode CLI - mount your config directories
      # This shares your 'opencode auth login' session and config with the container
      # - ~/.local/share/opencode:/home/automaker/.local/share/opencode
      # - ~/.config/opencode:/home/automaker/.config/opencode

Comment on lines +28 to +41
# Ensure OpenCode CLI config directory exists with correct permissions
# OpenCode stores config and auth in ~/.local/share/opencode/
if [ ! -d "/home/automaker/.local/share/opencode" ]; then
mkdir -p /home/automaker/.local/share/opencode
fi
chown -R automaker:automaker /home/automaker/.local/share/opencode
chmod -R 700 /home/automaker/.local/share/opencode

# OpenCode also uses ~/.config/opencode for configuration
if [ ! -d "/home/automaker/.config/opencode" ]; then
mkdir -p /home/automaker/.config/opencode
fi
chown -R automaker:automaker /home/automaker/.config/opencode
chmod -R 700 /home/automaker/.config/opencode
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This block can be simplified. The if [ ! -d ... ] checks are redundant because mkdir -p handles existing directories gracefully. You can remove the if statements to make the script cleaner.

Suggested change
# Ensure OpenCode CLI config directory exists with correct permissions
# OpenCode stores config and auth in ~/.local/share/opencode/
if [ ! -d "/home/automaker/.local/share/opencode" ]; then
mkdir -p /home/automaker/.local/share/opencode
fi
chown -R automaker:automaker /home/automaker/.local/share/opencode
chmod -R 700 /home/automaker/.local/share/opencode
# OpenCode also uses ~/.config/opencode for configuration
if [ ! -d "/home/automaker/.config/opencode" ]; then
mkdir -p /home/automaker/.config/opencode
fi
chown -R automaker:automaker /home/automaker/.config/opencode
chmod -R 700 /home/automaker/.config/opencode
# Ensure OpenCode CLI config directories exist with correct permissions
# OpenCode stores config and auth in ~/.local/share/opencode/
mkdir -p /home/automaker/.local/share/opencode
chown -R automaker:automaker /home/automaker/.local/share/opencode
chmod -R 700 /home/automaker/.local/share/opencode
# OpenCode also uses ~/.config/opencode for configuration
mkdir -p /home/automaker/.config/opencode
chown -R automaker:automaker /home/automaker/.config/opencode
chmod -R 700 /home/automaker/.config/opencode

Comment on lines +83 to +91
### OpenCode CLI

OpenCode stores its configuration and auth at `~/.local/share/opencode/`. To share your host authentication with the container:

```yaml
# In docker-compose.override.yml
volumes:
- ~/.local/share/opencode:/home/automaker/.local/share/opencode
```
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The documentation should be updated to mention that OpenCode uses two directories (~/.local/share/opencode and ~/.config/opencode) and the example should reflect mounting both for complete configuration sharing.

Suggested change
### OpenCode CLI
OpenCode stores its configuration and auth at `~/.local/share/opencode/`. To share your host authentication with the container:
```yaml
# In docker-compose.override.yml
volumes:
- ~/.local/share/opencode:/home/automaker/.local/share/opencode
```
### OpenCode CLI
OpenCode stores its configuration and auth data across two directories: `~/.local/share/opencode/` and `~/.config/opencode/`. To share your host authentication with the container, mount both:
```yaml
# In docker-compose.override.yml
volumes:
- ~/.local/share/opencode:/home/automaker/.local/share/opencode
- ~/.config/opencode:/home/automaker/.config/opencode

volumes:
- ~/.claude:/home/automaker/.claude
- ~/.config/cursor:/home/automaker/.config/cursor
- ~/.local/share/opencode:/home/automaker/.local/share/opencode
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

For consistency and to ensure all configurations are shared, this example for bind-mounting credential directories should also include ~/.config/opencode.

Suggested change
- ~/.local/share/opencode:/home/automaker/.local/share/opencode
- ~/.local/share/opencode:/home/automaker/.local/share/opencode
- ~/.config/opencode:/home/automaker/.config/opencode

| Can't access web UI | Verify container is running with `docker ps \| grep automaker` |
| Need a fresh start | Run `docker-compose down && docker volume rm automaker-data && docker-compose up -d --build` |
| Cursor auth fails | Re-extract token with `./scripts/get-cursor-token.sh` - tokens expire periodically. Make sure you've run `cursor-agent login` on your host first. |
| OpenCode not detected | Mount `~/.local/share/opencode` to `/home/automaker/.local/share/opencode`. Make sure you've run `opencode auth login` on your host first. |
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The troubleshooting advice should be updated to mention mounting both directories required by OpenCode for a complete setup.

Suggested change
| OpenCode not detected | Mount `~/.local/share/opencode` to `/home/automaker/.local/share/opencode`. Make sure you've run `opencode auth login` on your host first. |
| OpenCode not detected | Mount `~/.local/share/opencode` and `~/.config/opencode`. Make sure you've run `opencode auth login` on your host first. |

Copy link

@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.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @docker-entrypoint.sh:
- Around line 28-41: The entrypoint currently creates and sets permissions for
/home/automaker/.config/opencode (and /home/automaker/.local/share/opencode)
which makes config changes ephemeral; either add a Docker volume mount for
/home/automaker/.config/opencode (like the existing volume used for
/home/automaker/.local/share/opencode) so configuration persists across
container restarts, or remove the creation and permission lines for
/home/automaker/.config/opencode from docker-entrypoint.sh to avoid creating an
unmounted persistent-looking directory; update deployment/docker-compose or
Dockerfile volume definitions accordingly and keep the mkdir/chown/chmod for
/home/automaker/.local/share/opencode if that remains a mounted volume.
🧹 Nitpick comments (2)
docs/docker-isolation.md (1)

83-91: Section placement may confuse users.

The OpenCode CLI section is under "CLI Authentication (macOS)" but OpenCode uses file-based storage (not Keychain), making it applicable to all platforms. Consider either:

  1. Moving this section to "CLI Authentication (Linux/Windows)" where bind mounts are discussed, or
  2. Adding a clarifying note that OpenCode uses file-based storage on all platforms.
📝 Suggested clarification
 ### OpenCode CLI
 
+OpenCode uses file-based storage on all platforms (no Keychain integration).
 OpenCode stores its configuration and auth at `~/.local/share/opencode/`. To share your host authentication with the container:
Dockerfile (1)

106-109: Consider renaming the profile script for clarity.

The file /etc/profile.d/cursor-cli.sh now provisions PATH for both Cursor and OpenCode CLIs. A more descriptive name like cli-tools.sh or automaker-cli.sh would better reflect its purpose.

📝 Suggested rename
 RUN mkdir -p /etc/profile.d && \
-    echo 'export PATH="/home/automaker/.local/bin:$PATH"' > /etc/profile.d/cursor-cli.sh && \
-    chmod +x /etc/profile.d/cursor-cli.sh
+    echo 'export PATH="/home/automaker/.local/bin:$PATH"' > /etc/profile.d/cli-tools.sh && \
+    chmod +x /etc/profile.d/cli-tools.sh
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0dc70ad and 62019d5.

📒 Files selected for processing (5)
  • Dockerfile
  • docker-compose.override.yml.example
  • docker-compose.yml
  • docker-entrypoint.sh
  • docs/docker-isolation.md
🔇 Additional comments (6)
docker-compose.override.yml.example (1)

19-21: LGTM!

The OpenCode mount example follows the established pattern for Claude and Cursor CLI credential sharing.

docs/docker-isolation.md (2)

120-120: LGTM!

The OpenCode mount is correctly added to the Linux/Windows bind mount example.


131-131: LGTM!

Helpful troubleshooting entry for OpenCode detection issues.

docker-compose.yml (2)

81-83: LGTM!

The OpenCode volume mount follows the established pattern for CLI configuration persistence.


109-112: LGTM!

The named volume declaration is consistent with existing Claude and Cursor volume patterns.

Dockerfile (1)

99-104: The OpenCode CLI install URL https://opencode.ai/install is confirmed as the official installation method from opencode.ai's documentation. The installation approach is correct.

@webdevcody webdevcody changed the base branch from main to v0.11.0rc January 13, 2026 14:33
@webdevcody webdevcody merged commit 2870ddb into AutoMaker-Org:v0.11.0rc Jan 13, 2026
1 check passed
@thesobercoder thesobercoder deleted the feature/opencode-docker-support branch January 14, 2026 11:57
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.

2 participants