Skip to content

Conversation

@iamralch
Copy link
Contributor

1. High-Level Summary

What changed: A new devcontainer feature called "opencode" has been added
to the collection, enabling automated installation of the OpenCode CLI (an
open source coding agent) in development containers.

Why it changed: This addition expands the devcontainer features collection
to include OpenCode, allowing developers to easily provision development
environments with the OpenCode coding agent pre-installed via a simple
feature declaration.

2. Detailed Technical Breakdown

2.1 Behavior & Execution Flow

When a devcontainer includes this feature, the installation script:

  1. Updates apt package lists if stale
  2. Installs required dependencies (ca-certificates, curl)
  3. Downloads and executes the OpenCode installer from https://opencode.ai
  4. The -y flag ensures non-interactive installation

2.2 Key Modifications

New files added:

  • src/opencode/devcontainer-feature.json - Feature manifest defining
    metadata, version (0.0.1), and configurable options
  • src/opencode/install.sh - Shell script handling dependency installation
    and OpenCode CLI setup
  • src/opencode/README.md - Documentation with usage examples and options
  • test/opencode/scenarios.json - Empty test scenarios configuration
  • test/opencode/test.sh - Verification test checking CLI availability

CI pipeline updates:

  • Added opencode to the feature matrix in both test and release jobs
    within .github/workflows/ci.yaml

2.3 Design Considerations

  • Consistent patterns: The feature follows the same structure as existing
    features (atlas, starship) with identical file organization
  • Minimal dependencies: Only installs ca-certificates and curl as
    prerequisites, keeping the footprint small
  • Version flexibility: Supports a version option defaulting to "latest",
    though the installer script currently ignores non-latest versions
  • Installation ordering: Configured to install after common-utils via
    installsAfter to ensure base utilities are available

2.4 Assumptions & Edge Cases

  • Debian/Ubuntu only: Uses apt-get, limiting support to Debian-based
    distributions
  • Network dependency: Requires internet access to fetch the installer
  • Version parameter unused: The VERSION variable is unset when "latest"
    but the curl command doesn't pass any version parameter to the installer
  • Comment inconsistency: Install script contains comment "Install Atlas
    CLI" which should read "Install OpenCode CLI"
  • README typo: Example shows opecode:1 instead of opencode:1

3. Impact Assessment

Functionality:
Adds a new installable feature to the devcontainer collection, expanding
available tooling options for developers.

Performance:
No impact on existing features. Installation adds minimal overhead (two small
packages plus the OpenCode binary).

Reliability & correctness:
The test verifies basic CLI availability by checking help output. The empty
scenarios.json suggests no additional test scenarios are configured.

Security:
Executes a remote script via curl | sh pattern. Users implicitly trust
the opencode.ai domain and its HTTPS certificate chain.

Developer experience & maintainability:
Follows established patterns in the repository, making maintenance
straightforward. CI integration ensures the feature is tested against
Debian and Ubuntu base images.

Users or downstream systems:
Developers can now add OpenCode to devcontainers with a single feature
declaration, streamlining environment setup for teams using this coding agent.

@iamralch iamralch self-assigned this Dec 11, 2025
@iamralch iamralch added the enhancement New feature or request label Dec 11, 2025
@iamralch iamralch force-pushed the feature/opencode branch 5 times, most recently from fc75df7 to 20b008e Compare December 11, 2025 05:29
introduce opencode feature with metadata, docs, and install script
to bundle the open source coding agent.
add scenario and CLI smoke test to validate opencode usage.
extend CI matrices so opencode builds alongside atlas and starship.

Signed-off-by: Svetlin Ralchev <iamralch@users.noreply.github.com>
@iamralch iamralch merged commit 9a83693 into main Dec 11, 2025
11 of 12 checks passed
@iamralch iamralch deleted the feature/opencode branch December 11, 2025 05:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants