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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This repository provides a collection of [dev container Features](https://contai
| Feature | Description | Documentation |
|---------|-------------|---------------|
| `opencode` | AI coding agent CLI | [src/opencode/README.md](src/opencode/README.md) |
| `agency-agents` | AI agent set for Cursor/Copilot | [src/agency-agents/README.md](src/agency-agents/README.md) |
| `agency-agents` | AI agent set for a complete AI agency at your fingertips | [src/agency-agents/README.md](src/agency-agents/README.md) |

---

Expand Down
14 changes: 8 additions & 6 deletions src/opencode/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "opencode CLI",
"id": "opencode",
"version": "0.2.4",
"version": "0.2.5",
"description": "Installs the opencode AI coding agent CLI and ensures volume-mounted data directories are owned by the correct user.",
"documentationURL": "https://opencode.ai",
"options": {
Expand All @@ -10,17 +10,19 @@
"default": "",
"description": "Username to install opencode for. Defaults to _REMOTE_USER (the container's remote user)."
},
"installVscodePlugin": {
"type": "boolean",
"default": true,
"description": "Install the opencode VS Code extension."
},
"version": {
"type": "string",
"default": "",
"description": "Version to install (e.g. 1.3.17). Empty = latest."
}
},
"customizations": {
"vscode": {
"extensions": [
"sst-dev.opencode"
]
}
},
"postStartCommand": "bash /usr/local/bin/opencode-fix-permissions",
"installsAfter": ["ghcr.io/devcontainers/features/common-utils"]
}
28 changes: 0 additions & 28 deletions src/opencode/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,30 +73,6 @@ ensure_prerequisites() {
[ -f /etc/ssl/certs/ca-certificates.crt ] || fail "Falha na instalação de dependências: certificados CA ainda estão ausentes"
}

install_vscode_extension() {
local user="$1"
local vscode_cmd=""

if command -v code >/dev/null 2>&1; then
vscode_cmd="code"
elif [ -x "/usr/bin/code" ]; then
vscode_cmd="/usr/bin/code"
fi

if [ -z "$vscode_cmd" ]; then
log "VS Code não encontrado. Pulando instalação da extensão."
return 0
fi

log "Instalando extensão VS Code opencode..."

if su "$user" -c "$vscode_cmd --install-extension sst-dev.opencode --force" 2>/dev/null; then
log "Extensão VS Code instalada com sucesso."
else
log "Falha ao instalar extensão VS Code."
fi
}

USERNAME="${USERNAME:-"${_REMOTE_USER:-vscode}"}"
USER_HOME="${_REMOTE_USER_HOME:-"/home/${USERNAME}"}"
VERSION="${VERSION:-}"
Expand Down Expand Up @@ -138,10 +114,6 @@ su "$USERNAME" -c "curl -fsSL https://opencode.ai/install | bash -s -- --no-modi

ln -s "${USER_HOME}/.opencode/bin/opencode" /usr/local/bin/opencode

if [ "${INSTALLVSCODEPLUGIN:-true}" = "true" ]; then
install_vscode_extension "$USERNAME"
fi

log "Criando diretórios para volumes persistentes..."

mkdir -p "${USER_HOME}/.config/opencode"
Expand Down
Loading