-
Notifications
You must be signed in to change notification settings - Fork 488
feat: add OpenCode CLI support in Docker #460
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
62019d5
67f1802
33ae860
1578d02
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -25,6 +25,21 @@ fi | |||||||||||||||||||||||||||||||||||||||||||||||||
| chown -R automaker:automaker /home/automaker/.cursor | ||||||||||||||||||||||||||||||||||||||||||||||||||
| chmod -R 700 /home/automaker/.cursor | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| # 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 | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+28
to
+41
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This block can be simplified. The
Suggested change
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| # If CURSOR_AUTH_TOKEN is set, write it to the cursor auth file | ||||||||||||||||||||||||||||||||||||||||||||||||||
| # On Linux, cursor-agent uses ~/.config/cursor/auth.json for file-based credential storage | ||||||||||||||||||||||||||||||||||||||||||||||||||
| # The env var CURSOR_AUTH_TOKEN is also checked directly by cursor-agent | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -94,6 +94,16 @@ echo "CURSOR_AUTH_TOKEN=$(./scripts/get-cursor-token.sh)" >> .env | |||||||||||||||||||||||||||||||||||||
| - **macOS**: Tokens are stored in Keychain (service: `cursor-access-token`) | ||||||||||||||||||||||||||||||||||||||
| - **Linux**: Tokens are stored in `~/.config/cursor/auth.json` (not `~/.cursor`) | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| ### 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 | ||||||||||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+97
to
+105
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The documentation should be updated to mention that OpenCode uses two directories (
Suggested change
|
||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| ### Apply to container | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| ```bash | ||||||||||||||||||||||||||||||||||||||
|
|
@@ -121,6 +131,7 @@ echo "CURSOR_AUTH_TOKEN=$(jq -r '.accessToken' ~/.config/cursor/auth.json)" >> . | |||||||||||||||||||||||||||||||||||||
| volumes: | ||||||||||||||||||||||||||||||||||||||
| - ~/.claude:/home/automaker/.claude | ||||||||||||||||||||||||||||||||||||||
| - ~/.config/cursor:/home/automaker/.config/cursor | ||||||||||||||||||||||||||||||||||||||
| - ~/.local/share/opencode:/home/automaker/.local/share/opencode | ||||||||||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For consistency and to ensure all configurations are shared, this example for bind-mounting credential directories should also include
Suggested change
|
||||||||||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| ## Troubleshooting | ||||||||||||||||||||||||||||||||||||||
|
|
@@ -131,4 +142,6 @@ volumes: | |||||||||||||||||||||||||||||||||||||
| | 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. | | ||||||||||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The troubleshooting advice should be updated to mention mounting both directories required by OpenCode for a complete setup.
Suggested change
|
||||||||||||||||||||||||||||||||||||||
| | File permission errors | Rebuild with `UID=$(id -u) GID=$(id -g) docker-compose build` to match container user to your host user. See [Fixing File Permission Issues](#fixing-file-permission-issues). | | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The entrypoint script indicates that OpenCode uses both
~/.local/share/opencodeand~/.config/opencode. This example should be updated to show how to mount both directories for a complete host-to-container authentication sharing setup.