A collection of Dev Container features to enhance your development environment.
OpenCode is an AI-powered coding assistant that helps you write, debug, and understand code more efficiently.
This feature installs OpenCode by SST directly into your Dev Container, giving you access to advanced code intelligence tools right in your development environment.
Installation & Configuration
Add the OpenCode feature to your devcontainer.json:
{
"features": {
"ghcr.io/danzilberdan/devcontainers/opencode:0": {}
}
}This feature supports automatic configuration of API keys for OpenCode from a JSON file on your host machine.
Most users will already have an auth.json file from their existing OpenCode installation on the host. Mount that file to the container:
{
"features": {
"ghcr.io/danzilberdan/devcontainers/opencode:0": {}
},
"mounts": [
"source=${localEnv:HOME}/.local/share/opencode/auth.json,target=/tmp/opencode-auth.json,type=bind,consistency=cached"
]
}If you don't have an existing auth.json file or want to use a different location:
-
Create a JSON file with your API keys on your host machine (e.g.,
~/.opencode/auth.jsonor${localWorkspaceFolder}/.opencode/auth.json) -
Configure the mount in your
devcontainer.json:
{
"features": {
"ghcr.io/danzilberdan/devcontainers/opencode:0": {}
},
"mounts": [
"source=${localWorkspaceFolder}/.opencode/auth.json,target=/tmp/opencode-auth.json,type=bind,consistency=cached"
]
}Your auth.json file should follow the standard OpenCode format with provider-specific configurations:
{
"anthropic": {
"type": "api",
"key": "your-anthropic-api-key"
},
"openai": {
"type": "api",
"key": "your-openai-api-key"
},
"openrouter": {
"type": "api",
"key": "your-openrouter-api-key"
}
}During installation, this file will be copied to: ~/.local/share/opencode/auth.json
- The specified auth.json file from the host (typically from an existing OpenCode installation) is mounted to
/tmp/opencode-auth.jsonin the container - During installation, the file is copied to
/home/${remoteUser}/.local/share/opencode/auth.json - The target directory is created if it doesn't exist
- If no auth file is mounted, API keys configuration is skipped
Ensure your auth.json file is not committed to version control. If you're referencing an existing file from your host OpenCode installation, make sure it contains the API keys you want to use in the dev container. Consider adding it to your .gitignore file if it's in your workspace.
Infisical is a secret management platform that helps you manage and access secrets securely.
This feature installs the Infisical CLI directly into your Dev Container, allowing you to interact with Infisical secrets from within your development environment.
Installation & Configuration
Add the Infisical feature to your devcontainer.json:
{
"features": {
"ghcr.io/danzilberdan/devcontainers/infisical:0": {}
}
}To automatically load Infisical secrets into your shell environment, configure a dotenv file with your project ID and environment.
- Create a dotenv file (e.g.,
.infisical.env) in your workspace with the following variables:
INFISICAL_PROJECT_ID=your-project-id
INFISICAL_ENV=dev- Configure the feature in your
devcontainer.jsonto point to this file:
{
"features": {
"ghcr.io/danzilberdan/devcontainers/infisical:0": {
"dotenvFile": "/workspaces/project/.infisical.env"
}
}
}- Upon container startup, an
infisical_envfunction is added to your shell and runs automatically - The function reads your configured dotenv file and fetches the corresponding secrets into your environment
Ensure your dotenv file containing sensitive project IDs is not committed to version control. Consider adding it to your .gitignore file.