Skip to content

Commit 899a948

Browse files
Rick Valdesclaude
andcommitted
Rebrand opencode as the UTMStack CLI
Turns the opencode fork into `utmstack`: a SIEM-aware agent that works out of the box, with no configuration required before the first useful command. Branding is deliberately confined to a small set of files so upstream changes stay mergeable — the app name in core/global.ts relocates every config, data, cache and state directory on its own, and the rest is the script name, the wordmarks, the binary name, and the release asset naming. Shipped defaults: - the `threatwinds` model provider (silas-1.6-pro / silas-1.6), registered as a first-class auth provider so it appears in /connect and providers login. One paste method only: a second option puts a filter field on that screen and users type their token into it instead of picking a method. - the `utmstack` MCP server, enabled by default and installed by the same installer, so the SIEM tools work on first run. - 26 skills and 9 subagents embedded in the binary and extracted on first run, version-gated so upgrades refresh them without touching user files. Config lives in ~/.config/utmstack/utmstack.json, read ahead of opencode.json in the same directory. Note there are two config loaders in this codebase; the live one is packages/opencode/src/config/config.ts. Update checks point at this repo. Left pointing upstream, the in-binary updater would replace a utmstack install with stock opencode. Release archives use COPYFILE_DISABLE / --no-xattrs / zip -X, without which macOS-built archives carry AppleDouble files that make Linux tar warn on every extracted file. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent b8142c7 commit 899a948

246 files changed

Lines changed: 27378 additions & 180 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,7 @@ UPCOMING_CHANGELOG.md
3232
logs/
3333
*.bun-build
3434
tsconfig.tsbuildinfo
35+
36+
# Generated at build time from packages/opencode/src/assets by
37+
# script/gen-bundled-assets.ts — the assets directory is the source of truth.
38+
packages/opencode/src/config/bundled-assets.gen.ts

README.md

Lines changed: 71 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -1,129 +1,96 @@
1-
<p align="center">
2-
<a href="https://opencode.ai">
3-
<picture>
4-
<source srcset="packages/console/app/src/asset/logo-ornate-dark.svg" media="(prefers-color-scheme: dark)">
5-
<source srcset="packages/console/app/src/asset/logo-ornate-light.svg" media="(prefers-color-scheme: light)">
6-
<img src="packages/console/app/src/asset/logo-ornate-light.svg" alt="OpenCode logo">
7-
</picture>
8-
</a>
9-
</p>
10-
<p align="center">The open source AI coding agent.</p>
11-
<p align="center">
12-
<a href="https://opencode.ai/discord"><img alt="Discord" src="https://img.shields.io/discord/1391832426048651334?style=flat-square&label=discord" /></a>
13-
<a href="https://www.npmjs.com/package/opencode-ai"><img alt="npm" src="https://img.shields.io/npm/v/opencode-ai?style=flat-square" /></a>
14-
<a href="https://github.com/anomalyco/opencode/actions/workflows/publish.yml"><img alt="Build status" src="https://img.shields.io/github/actions/workflow/status/anomalyco/opencode/publish.yml?style=flat-square&branch=dev" /></a>
15-
</p>
16-
17-
<p align="center">
18-
<a href="README.md">English</a> |
19-
<a href="README.zh.md">简体中文</a> |
20-
<a href="README.zht.md">繁體中文</a> |
21-
<a href="README.ko.md">한국어</a> |
22-
<a href="README.de.md">Deutsch</a> |
23-
<a href="README.es.md">Español</a> |
24-
<a href="README.fr.md">Français</a> |
25-
<a href="README.it.md">Italiano</a> |
26-
<a href="README.da.md">Dansk</a> |
27-
<a href="README.ja.md">日本語</a> |
28-
<a href="README.pl.md">Polski</a> |
29-
<a href="README.ru.md">Русский</a> |
30-
<a href="README.bs.md">Bosanski</a> |
31-
<a href="README.ar.md">العربية</a> |
32-
<a href="README.no.md">Norsk</a> |
33-
<a href="README.br.md">Português (Brasil)</a> |
34-
<a href="README.th.md">ไทย</a> |
35-
<a href="README.tr.md">Türkçe</a> |
36-
<a href="README.uk.md">Українська</a> |
37-
<a href="README.bn.md">বাংলা</a> |
38-
<a href="README.gr.md">Ελληνικά</a> |
39-
<a href="README.vi.md">Tiếng Việt</a>
40-
</p>
41-
42-
[![OpenCode Terminal UI](packages/web/src/assets/lander/screenshot.png)](https://opencode.ai)
43-
44-
---
45-
46-
### Installation
1+
# UTMStack CLI
472

48-
```bash
49-
# YOLO
50-
curl -fsSL https://opencode.ai/install | bash
51-
52-
# Package managers
53-
npm i -g opencode-ai@latest # or bun/pnpm/yarn
54-
scoop install opencode # Windows
55-
choco install opencode # Windows
56-
brew install anomalyco/tap/opencode # macOS and Linux (recommended, always up to date)
57-
brew install opencode # macOS and Linux (official brew formula, updated less)
58-
sudo pacman -S opencode # Arch Linux (Stable)
59-
paru -S opencode-bin # Arch Linux (Latest from AUR)
60-
mise use -g opencode # Any OS
61-
nix run nixpkgs#opencode # or github:anomalyco/opencode for latest dev branch
62-
```
3+
The SIEM-aware coding and security agent — a branded distribution of
4+
[opencode](https://github.com/anomalyco/opencode) that ships with UTMStack's
5+
SIEM tooling, the ThreatWinds model provider, and a curated set of skills and
6+
subagents already configured.
637

64-
> [!TIP]
65-
> Remove versions older than 0.1.x before installing.
8+
## Install
669

67-
### Desktop App (BETA)
10+
```bash
11+
curl -fsSL https://raw.githubusercontent.com/utmstack/utmstack-cli/main/install | bash
12+
```
6813

69-
OpenCode is also available as a desktop application. Download directly from the [releases page](https://github.com/anomalyco/opencode/releases) or [opencode.ai/download](https://opencode.ai/download).
14+
The installer places `utmstack` in `~/.utmstack/bin`, adds it to your `PATH`,
15+
and installs the [UTMStack MCP server](https://github.com/utmstack/MCP) so the
16+
SIEM tools work immediately. Set `UTMSTACK_SKIP_MCP=1` to skip that step.
7017

71-
| Platform | Download |
72-
| --------------------- | ---------------------------------- |
73-
| macOS (Apple Silicon) | `opencode-desktop-mac-arm64.dmg` |
74-
| macOS (Intel) | `opencode-desktop-mac-x64.dmg` |
75-
| Windows | `opencode-desktop-windows-x64.exe` |
76-
| Linux | `.deb`, `.rpm`, or `.AppImage` |
18+
## First run
7719

7820
```bash
79-
# macOS (Homebrew)
80-
brew install --cask opencode-desktop
81-
# Windows (Scoop)
82-
scoop bucket add extras; scoop install extras/opencode-desktop
21+
utmstack-mcp init # connect your UTMStack server (URL + credentials)
22+
utmstack # start the CLI, then /connect to paste your ThreatWinds API key
8323
```
8424

85-
#### Installation Directory
25+
`utmstack-mcp init` validates your credentials against the live API before
26+
saving them, and writes them to a `0600` file outside any CLI config — so no
27+
credentials end up in shell history or in a config file you might share.
8628

87-
The install script respects the following priority order for the installation path:
29+
## What ships out of the box
8830

89-
1. `$OPENCODE_INSTALL_DIR` - Custom installation directory
90-
2. `$XDG_BIN_DIR` - XDG Base Directory Specification compliant path
91-
3. `$HOME/bin` - Standard user binary directory (if it exists or can be created)
92-
4. `$HOME/.opencode/bin` - Default fallback
31+
**SIEM tools** — the `utmstack` MCP server is enabled by default: alert search
32+
and triage, log explorer and SQL, incidents, correlation rules, data filters,
33+
agent inventory, and remote command execution on endpoints.
9334

94-
```bash
95-
# Examples
96-
OPENCODE_INSTALL_DIR=/usr/local/bin curl -fsSL https://opencode.ai/install | bash
97-
XDG_BIN_DIR=$HOME/.local/bin curl -fsSL https://opencode.ai/install | bash
98-
```
35+
Remote command execution is **opt-in per server** (`allowAgentCommands`). It
36+
grants a root/SYSTEM shell on an endpoint, and SIEM log content — which is
37+
partly written by attackers — reaches the model through log and alert search.
38+
Enable it only where you want that capability.
39+
40+
**Models** — the `threatwinds` provider is preconfigured
41+
(`silas-1.6-pro` by default, `silas-1.6` for small tasks). Add your API key with
42+
`/connect` in the TUI or `utmstack providers login`.
43+
44+
**Skills and subagents** — 26 skills and 9 subagents are embedded in the binary
45+
and extracted to your config directory on first run, covering planning, code
46+
review, systematic debugging, test-driven development, and web testing. They are
47+
version-gated: an upgrade refreshes them without touching skills you added.
9948

100-
### Agents
49+
## Configuration
10150

102-
OpenCode includes two built-in agents you can switch between with the `Tab` key.
51+
Config lives in `~/.config/utmstack/utmstack.json` (`%APPDATA%\utmstack` on
52+
Windows). The defaults are written on first run and are yours to edit — the CLI
53+
never overwrites an existing config.
10354

104-
- **build** - Default, full-access agent for development work
105-
- **plan** - Read-only agent for analysis and code exploration
106-
- Denies file edits by default
107-
- Asks permission before running bash commands
108-
- Ideal for exploring unfamiliar codebases or planning changes
55+
The directory is separate from opencode's, so this CLI and a stock opencode
56+
install coexist without touching each other's settings. An `opencode.json` in
57+
the same directory is still read, with `utmstack.json` taking precedence.
10958

110-
Also included is a **general** subagent for complex searches and multistep tasks.
111-
This is used internally and can be invoked using `@general` in messages.
59+
## Building from source
11260

113-
Learn more about [agents](https://opencode.ai/docs/agents).
61+
```bash
62+
bun install
63+
cd packages/opencode
64+
OPENCODE_VERSION=1.0.0 bun run script/build.ts --single
65+
```
11466

115-
### Documentation
67+
The binary lands in `dist/opencode-<platform>-<arch>/bin/utmstack`. Embedded
68+
skills and agents are regenerated from `packages/opencode/src/assets` on every
69+
build; `bundled-assets.gen.ts` is generated and not tracked in git.
11670

117-
For more info on how to configure OpenCode, [**head over to our docs**](https://opencode.ai/docs).
71+
## Upstream
11872

119-
### Contributing
73+
This is a fork of opencode. Branding and defaults are confined to a small set of
74+
files so upstream changes remain straightforward to merge:
12075

121-
If you're interested in contributing to OpenCode, please read our [contributing docs](./CONTRIBUTING.md) before submitting a pull request.
76+
| Path | Purpose |
77+
|---|---|
78+
| `packages/core/src/global.ts` | app name — relocates every config/data/cache directory |
79+
| `packages/opencode/src/index.ts` | script name, bootstrap invocation |
80+
| `packages/opencode/src/config/utmstack-bootstrap.ts` | seeds default config, extracts embedded assets |
81+
| `packages/opencode/src/config/config.ts` | reads `utmstack.json` ahead of `opencode.json` |
82+
| `packages/opencode/src/plugin/threatwinds.ts` | makes `threatwinds` a first-class auth provider |
83+
| `packages/opencode/script/gen-bundled-assets.ts` | embeds skills and agents into the binary |
84+
| `packages/opencode/script/build.ts` | binary name, release asset naming, archive hygiene |
85+
| `packages/opencode/src/installation/index.ts` | update checks point at this repo, not upstream |
86+
| `packages/tui/src/logo.ts`, `packages/opencode/src/cli/ui.ts` | wordmarks |
87+
| `install` | installer, plus the MCP install step |
12288

123-
### Building on OpenCode
89+
Skills and subagents come from
90+
[osmontero/opencode-skills](https://github.com/osmontero/opencode-skills).
12491

125-
If you are working on a project that's related to OpenCode and is using "opencode" as part of its name, for example "opencode-dashboard" or "opencode-mobile", please add a note to your README to clarify that it is not built by the OpenCode team and is not affiliated with us in any way.
92+
Upstream opencode documentation is preserved in `README.upstream.md`.
12693

127-
---
94+
## License
12895

129-
**Join our community** [Discord](https://discord.gg/opencode) | [X.com](https://x.com/opencode)
96+
opencode's license applies to the upstream code. See [LICENSE](LICENSE).

README.upstream.md

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
<p align="center">
2+
<a href="https://opencode.ai">
3+
<picture>
4+
<source srcset="packages/console/app/src/asset/logo-ornate-dark.svg" media="(prefers-color-scheme: dark)">
5+
<source srcset="packages/console/app/src/asset/logo-ornate-light.svg" media="(prefers-color-scheme: light)">
6+
<img src="packages/console/app/src/asset/logo-ornate-light.svg" alt="OpenCode logo">
7+
</picture>
8+
</a>
9+
</p>
10+
<p align="center">The open source AI coding agent.</p>
11+
<p align="center">
12+
<a href="https://opencode.ai/discord"><img alt="Discord" src="https://img.shields.io/discord/1391832426048651334?style=flat-square&label=discord" /></a>
13+
<a href="https://www.npmjs.com/package/opencode-ai"><img alt="npm" src="https://img.shields.io/npm/v/opencode-ai?style=flat-square" /></a>
14+
<a href="https://github.com/anomalyco/opencode/actions/workflows/publish.yml"><img alt="Build status" src="https://img.shields.io/github/actions/workflow/status/anomalyco/opencode/publish.yml?style=flat-square&branch=dev" /></a>
15+
</p>
16+
17+
<p align="center">
18+
<a href="README.md">English</a> |
19+
<a href="README.zh.md">简体中文</a> |
20+
<a href="README.zht.md">繁體中文</a> |
21+
<a href="README.ko.md">한국어</a> |
22+
<a href="README.de.md">Deutsch</a> |
23+
<a href="README.es.md">Español</a> |
24+
<a href="README.fr.md">Français</a> |
25+
<a href="README.it.md">Italiano</a> |
26+
<a href="README.da.md">Dansk</a> |
27+
<a href="README.ja.md">日本語</a> |
28+
<a href="README.pl.md">Polski</a> |
29+
<a href="README.ru.md">Русский</a> |
30+
<a href="README.bs.md">Bosanski</a> |
31+
<a href="README.ar.md">العربية</a> |
32+
<a href="README.no.md">Norsk</a> |
33+
<a href="README.br.md">Português (Brasil)</a> |
34+
<a href="README.th.md">ไทย</a> |
35+
<a href="README.tr.md">Türkçe</a> |
36+
<a href="README.uk.md">Українська</a> |
37+
<a href="README.bn.md">বাংলা</a> |
38+
<a href="README.gr.md">Ελληνικά</a> |
39+
<a href="README.vi.md">Tiếng Việt</a>
40+
</p>
41+
42+
[![OpenCode Terminal UI](packages/web/src/assets/lander/screenshot.png)](https://opencode.ai)
43+
44+
---
45+
46+
### Installation
47+
48+
```bash
49+
# YOLO
50+
curl -fsSL https://opencode.ai/install | bash
51+
52+
# Package managers
53+
npm i -g opencode-ai@latest # or bun/pnpm/yarn
54+
scoop install opencode # Windows
55+
choco install opencode # Windows
56+
brew install anomalyco/tap/opencode # macOS and Linux (recommended, always up to date)
57+
brew install opencode # macOS and Linux (official brew formula, updated less)
58+
sudo pacman -S opencode # Arch Linux (Stable)
59+
paru -S opencode-bin # Arch Linux (Latest from AUR)
60+
mise use -g opencode # Any OS
61+
nix run nixpkgs#opencode # or github:anomalyco/opencode for latest dev branch
62+
```
63+
64+
> [!TIP]
65+
> Remove versions older than 0.1.x before installing.
66+
67+
### Desktop App (BETA)
68+
69+
OpenCode is also available as a desktop application. Download directly from the [releases page](https://github.com/anomalyco/opencode/releases) or [opencode.ai/download](https://opencode.ai/download).
70+
71+
| Platform | Download |
72+
| --------------------- | ---------------------------------- |
73+
| macOS (Apple Silicon) | `opencode-desktop-mac-arm64.dmg` |
74+
| macOS (Intel) | `opencode-desktop-mac-x64.dmg` |
75+
| Windows | `opencode-desktop-windows-x64.exe` |
76+
| Linux | `.deb`, `.rpm`, or `.AppImage` |
77+
78+
```bash
79+
# macOS (Homebrew)
80+
brew install --cask opencode-desktop
81+
# Windows (Scoop)
82+
scoop bucket add extras; scoop install extras/opencode-desktop
83+
```
84+
85+
#### Installation Directory
86+
87+
The install script respects the following priority order for the installation path:
88+
89+
1. `$OPENCODE_INSTALL_DIR` - Custom installation directory
90+
2. `$XDG_BIN_DIR` - XDG Base Directory Specification compliant path
91+
3. `$HOME/bin` - Standard user binary directory (if it exists or can be created)
92+
4. `$HOME/.opencode/bin` - Default fallback
93+
94+
```bash
95+
# Examples
96+
OPENCODE_INSTALL_DIR=/usr/local/bin curl -fsSL https://opencode.ai/install | bash
97+
XDG_BIN_DIR=$HOME/.local/bin curl -fsSL https://opencode.ai/install | bash
98+
```
99+
100+
### Agents
101+
102+
OpenCode includes two built-in agents you can switch between with the `Tab` key.
103+
104+
- **build** - Default, full-access agent for development work
105+
- **plan** - Read-only agent for analysis and code exploration
106+
- Denies file edits by default
107+
- Asks permission before running bash commands
108+
- Ideal for exploring unfamiliar codebases or planning changes
109+
110+
Also included is a **general** subagent for complex searches and multistep tasks.
111+
This is used internally and can be invoked using `@general` in messages.
112+
113+
Learn more about [agents](https://opencode.ai/docs/agents).
114+
115+
### Documentation
116+
117+
For more info on how to configure OpenCode, [**head over to our docs**](https://opencode.ai/docs).
118+
119+
### Contributing
120+
121+
If you're interested in contributing to OpenCode, please read our [contributing docs](./CONTRIBUTING.md) before submitting a pull request.
122+
123+
### Building on OpenCode
124+
125+
If you are working on a project that's related to OpenCode and is using "opencode" as part of its name, for example "opencode-dashboard" or "opencode-mobile", please add a note to your README to clarify that it is not built by the OpenCode team and is not affiliated with us in any way.
126+
127+
---
128+
129+
**Join our community** [Discord](https://discord.gg/opencode) | [X.com](https://x.com/opencode)

bun.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)