Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@ RUN curl https://cursor.com/install -fsS | bash && \
ls -la /home/automaker/.local/bin/ && \
echo "=== PATH is: $PATH ===" && \
(which cursor-agent && cursor-agent --version) || echo "cursor-agent installed (may need auth setup)"

# Install OpenCode CLI (for multi-provider AI model access)
RUN curl -fsSL https://opencode.ai/install | bash && \
echo "=== Checking OpenCode CLI installation ===" && \
ls -la /home/automaker/.local/bin/ && \
(which opencode && opencode --version) || echo "opencode installed (may need auth setup)"
USER root

# Add PATH to profile so it's available in all interactive shells (for login shells)
Expand Down
5 changes: 5 additions & 0 deletions docker-compose.override.yml.example
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ services:
# This shares your 'cursor-agent login' OAuth session with the container
# - ~/.cursor:/home/automaker/.cursor

# 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
Comment on lines +19 to +21
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

# - ~/.config/opencode:/home/automaker/.config/opencode

environment:
# Set root directory for all projects and file operations
# Users can only create/open projects within this directory
Expand Down
17 changes: 17 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@ services:
# This allows 'cursor-agent login' authentication to persist between restarts
- automaker-cursor-config:/home/automaker/.cursor

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

# Persist OpenCode user configuration across container restarts
- automaker-opencode-config:/home/automaker/.config/opencode

# NO host directory mounts - container cannot access your laptop files
# If you need to work on a project, create it INSIDE the container
# or use a separate docker-compose override file
Expand All @@ -106,3 +113,13 @@ volumes:
name: automaker-cursor-config
# Named volume for Cursor CLI configuration and authentication
# Persists cursor-agent login authentication across container restarts

automaker-opencode-data:
name: automaker-opencode-data
# Named volume for OpenCode CLI data and authentication (~/.local/share/opencode)
# Persists opencode auth login authentication across container restarts

automaker-opencode-config:
name: automaker-opencode-config
# Named volume for OpenCode user configuration (~/.config/opencode)
# Persists user configuration across container restarts
15 changes: 15 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
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


# 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
Expand Down
13 changes: 13 additions & 0 deletions docs/docker-isolation.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
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


### Apply to container

```bash
Expand Down Expand Up @@ -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
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

```

## Troubleshooting
Expand All @@ -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. |
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. |

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