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
1 change: 0 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"ghcr.io/devcontainers/features/node:2.1.0": {
"version": "lts"
},
"ghcr.io/wcgomes/devcontainer-features/opencode:0": {},
"ghcr.io/wcgomes/devcontainer-features/agents-workspace:0": {
"divisions": "engineering,testing,security"
}
Expand Down
6 changes: 6 additions & 0 deletions .devcontainer/install-tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ require_npm() {
exit 1
}

install_opencode() {
echo "Installing OpenCode V2..."
curl -fsSL https://opencode.ai/v2/install | bash
}

install_codegraph() {
require_npm

Expand Down Expand Up @@ -44,4 +49,5 @@ install_codegraph() {
codegraph init
}

install_opencode
install_codegraph
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ swift build # binary: .build/debug/adevcontainer
swift build -c release # binary: .build/release/adevcontainer
```

To install from source onto PATH and restage the Apple CLI plugin (same layout as `install-plugin`):
To install from source onto PATH and link the Apple CLI plugin:

```bash
swift build -c release
cp .build/release/adevcontainer /usr/local/bin/ # or another directory on PATH
adevcontainer install-plugin # use sudo when the plugin destination requires it
adevcontainer plugin --install # use sudo when the plugin destination requires elevation
```

## Tests
Expand Down
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Apple Dev Container CLI (adevcontainer)

[![CI](https://github.com/wcgomes/apple-devcontainers/actions/workflows/ci.yml/badge.svg)](https://github.com/wcgomes/apple-devcontainers/actions/workflows/ci.yml)
[![tests](https://img.shields.io/badge/tests-1105%2B-brightgreen)](https://github.com/wcgomes/apple-devcontainers)
[![tests](https://img.shields.io/badge/tests-1147%2B-brightgreen)](https://github.com/wcgomes/apple-devcontainers)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)

Native Swift CLI that reads `devcontainer.json` and runs development environments on Apple [`container`](https://github.com/apple/container).
Expand All @@ -23,8 +23,11 @@ For implementation details and behavior beyond this quick reference, see the [te

```bash
brew install wcgomes/tap/adevcontainer
sudo adevcontainer plugin --install
```

Run `sudo adevcontainer plugin --install` once after install, and again only after upgrading Apple `container`. `brew upgrade adevcontainer` does not require `plugin --install` again when the plugin symlink already targets `$(brew --prefix)/opt/adevcontainer/bin/adevcontainer`.

### Release binary

Download `adevcontainer-macos-arm64.tar.gz` and `adevcontainer-macos-arm64.tar.gz.sha256` from [GitHub Releases](https://github.com/wcgomes/apple-devcontainers/releases), then run:
Expand All @@ -33,7 +36,7 @@ Download `adevcontainer-macos-arm64.tar.gz` and `adevcontainer-macos-arm64.tar.g
shasum -a 256 -c adevcontainer-macos-arm64.tar.gz.sha256
tar xzf adevcontainer-macos-arm64.tar.gz
sudo mv adevcontainer /usr/local/bin/ # or move it to another directory on PATH
sudo adevcontainer install-plugin # restage container dev plugin (sudo when /usr/local/libexec is not writable)
sudo adevcontainer plugin --install # sudo when the plugin destination requires elevation
```

Verify the installation and Apple `container` setup:
Expand Down Expand Up @@ -77,7 +80,7 @@ TTY it offers to open and retry the config; in automation, edit the printed path

## Apple container plugin

After the plugin is staged, every command also works as `container dev <subcommand>`. PATH `adevcontainer` remains valid.
After `adevcontainer plugin --install`, every command also works as `container dev <subcommand>`. PATH `adevcontainer` remains valid. `plugin --uninstall` removes only the plugin `bin/dev` link and `config.toml`.

Apple must be running to dispatch plugins:

Expand All @@ -94,7 +97,7 @@ container dev list
container dev doctor
```

Apple upgrades wipe the plugin. Restage with PATH `adevcontainer install-plugin` (`sudo` when the destination requires elevation).
Apple upgrades wipe the plugin directory. PATH `adevcontainer` survives. Restage with PATH `adevcontainer plugin --install` (`sudo` when the destination requires elevation), again only after upgrading Apple `container`. `brew upgrade adevcontainer` does not require restage when the symlink already targets the Homebrew opt path.

## Commands

Expand All @@ -105,7 +108,8 @@ The `start`, `exec`, `stop`, `delete`, `purge`, `rebuild`, and `inspect` command
| Command | Purpose |
| --- | --- |
| `adevcontainer doctor` | Check Apple `container` readiness |
| `adevcontainer install-plugin` | Restage the Apple CLI plugin after an Apple container upgrade |
| `adevcontainer plugin --install` | Link the Apple CLI plugin (`bin/dev` absolute symlink and `config.toml`) |
| `adevcontainer plugin --uninstall` | Remove plugin `bin/dev` and `config.toml` only |
| `adevcontainer up [-w <path>] [--vscode]` | Create or start a dev container from a local folder |
| `adevcontainer clone <git-url> [--vscode] [--resume <config-dir>]` | Clone a repository into a named volume and start its dev container |
| `adevcontainer exec [-it] [--name <name>] [--] [cmd…]` | Open a shell or run a command in a running managed container |
Expand Down
Loading
Loading