@m14i/sith 1.21.1 → 1.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +103 -179
- package/dist/commands/docker.d.ts +0 -1
- package/dist/commands/docker.d.ts.map +1 -1
- package/dist/commands/maintenance.d.ts +5 -0
- package/dist/commands/maintenance.d.ts.map +1 -0
- package/dist/components/TerminalUI.d.ts.map +1 -1
- package/dist/index.js +305 -408
- package/dist/utils/launcher.d.ts +4 -0
- package/dist/utils/launcher.d.ts.map +1 -0
- package/package.json +10 -2
package/README.md
CHANGED
|
@@ -8,163 +8,115 @@
|
|
|
8
8
|
|
|
9
9
|
Standardize and share your OpenCode setup with a fully dockerized environment, designed for seamless collaboration and CI integration.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
---
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
## Why?
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
```bash
|
|
17
|
-
npm install -g @m14i/sith
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
**Or use npx (slower, pulls image every time):**
|
|
21
|
-
```bash
|
|
22
|
-
npx @m14i/sith@latest
|
|
23
|
-
```
|
|
15
|
+
AI coding tools are powerful in isolation. They become fragile at scale:
|
|
24
16
|
|
|
25
|
-
|
|
17
|
+
- **Context drift** — every developer has a different CLAUDE.md, different tool versions, different configs. The AI sees a different project depending on who's running it.
|
|
18
|
+
- **No CI path** — running `opencode` or `claude` in a pipeline requires wiring tokens, installing tools, and hoping the environment matches local.
|
|
19
|
+
- **Multiple tools** — Claude Code and OpenCode serve different use cases (Anthropic auth vs GitHub Copilot). Switching between them shouldn't require manual setup.
|
|
26
20
|
|
|
27
|
-
|
|
28
|
-
# Interactive terminal UI (default)
|
|
29
|
-
sith
|
|
30
|
-
# Type your prompt to start OpenCode with that task
|
|
31
|
-
# Or use slash commands: /shell, /config, /help
|
|
32
|
-
|
|
33
|
-
# Direct commands
|
|
34
|
-
sith --it # Launch Docker shell immediately
|
|
35
|
-
sith --pull # Pull prebuilt image
|
|
36
|
-
sith --build # Build from scratch
|
|
37
|
-
sith --legacy # Use legacy menu interface
|
|
38
|
-
```
|
|
21
|
+
Sith solves this by packaging both tools, all config, and your team's context into a single Docker image. One pull, same environment, everywhere.
|
|
39
22
|
|
|
40
|
-
|
|
23
|
+
| Problem | Sith answer |
|
|
24
|
+
|---------|-------------|
|
|
25
|
+
| Inconsistent context across team | Shared `~/.sith/` skills + CLAUDE.md, mounted at runtime |
|
|
26
|
+
| AI tools hard to run in CI | Prebuilt signed image + token injection via env vars |
|
|
27
|
+
| Claude Code vs OpenCode friction | Both available, same container, same command |
|
|
28
|
+
| "Works on my machine" builds | Nix-pinned dependencies inside Docker |
|
|
41
29
|
|
|
42
|
-
|
|
43
|
-
|--------|---------|-------|-------------|----------|
|
|
44
|
-
| **Prebuilt (Recommended)** | `sith --pull` | ⚡ Fast | GitHub Actions + Cosign | Production, CI/CD |
|
|
45
|
-
| **Local Build** | `sith --build` | 🐌 Slow | Your machine | Air-gapped, custom builds |
|
|
30
|
+
---
|
|
46
31
|
|
|
47
|
-
|
|
32
|
+
## Docker
|
|
48
33
|
|
|
49
|
-
|
|
50
|
-
|---------|-------------|
|
|
51
|
-
| `sith` | Interactive terminal UI (Claude Code style) |
|
|
52
|
-
| `sith --it` | Launch Docker shell immediately |
|
|
53
|
-
| `sith --pull` | Pull prebuilt image from GHCR |
|
|
54
|
-
| `sith --build` | Build Docker image from scratch |
|
|
55
|
-
| `sith --legacy` | Use legacy menu interface |
|
|
56
|
-
| `sith --help` | Show all available commands |
|
|
34
|
+
The recommended path. One image, works locally and in CI.
|
|
57
35
|
|
|
58
|
-
###
|
|
36
|
+
### Install the CLI
|
|
59
37
|
|
|
60
|
-
|
|
38
|
+
```bash
|
|
39
|
+
npm install -g @m14i/sith
|
|
40
|
+
```
|
|
61
41
|
|
|
62
|
-
|
|
63
|
-
- Type any text → Starts OpenCode with that prompt using Claude Sonnet 4.6
|
|
64
|
-
- Example: `Fix authentication bug` → OpenCode launches with this task
|
|
42
|
+
Or without installing:
|
|
65
43
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
- `/help` → Show available commands
|
|
44
|
+
```bash
|
|
45
|
+
npx @m14i/sith@latest
|
|
46
|
+
```
|
|
70
47
|
|
|
71
|
-
|
|
72
|
-
- `Ctrl+C` or `Esc` → Exit terminal UI
|
|
48
|
+
### Get the image
|
|
73
49
|
|
|
74
|
-
|
|
50
|
+
**Prebuilt (recommended) — pull a signed image from GHCR:**
|
|
75
51
|
|
|
76
|
-
**Pull and verify:**
|
|
77
52
|
```bash
|
|
78
|
-
# Pull (supports linux/amd64 and linux/arm64)
|
|
79
53
|
sith --pull
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Supports `linux/amd64` and `linux/arm64`. Images are signed with cosign and include an SBOM.
|
|
80
57
|
|
|
81
|
-
|
|
82
|
-
docker pull ghcr.io/merzoukemanouri/sith:latest
|
|
58
|
+
**Verify the signature (optional):**
|
|
83
59
|
|
|
84
|
-
|
|
60
|
+
```bash
|
|
85
61
|
cosign verify \
|
|
86
62
|
--certificate-identity-regexp="https://github.com/MerzoukeMansouri/sith" \
|
|
87
63
|
--certificate-oidc-issuer="https://token.actions.githubusercontent.com" \
|
|
88
64
|
ghcr.io/merzoukemanouri/sith:latest
|
|
89
65
|
```
|
|
90
66
|
|
|
91
|
-
**
|
|
92
|
-
- ✅ Fast - no build time
|
|
93
|
-
- ✅ Multi-platform - amd64 and arm64
|
|
94
|
-
- ✅ Signed - cosign verification
|
|
95
|
-
- ✅ SBOM - supply chain transparency
|
|
96
|
-
- ✅ Auto-updated - tracks releases
|
|
67
|
+
**Build from scratch — full control, no external trust:**
|
|
97
68
|
|
|
98
|
-
## Authentication
|
|
99
|
-
|
|
100
|
-
Sith supports two AI providers: **Claude Code** (via Anthropic) and **OpenCode** (via GitHub Copilot).
|
|
101
|
-
|
|
102
|
-
### Claude Code (claude CLI)
|
|
103
|
-
|
|
104
|
-
Sith ships with the `claude` CLI. Authenticate it with your Anthropic account using a long-lived OAuth token — no API key required.
|
|
105
|
-
|
|
106
|
-
**Step 1 — Generate the token (once, on your local machine):**
|
|
107
69
|
```bash
|
|
108
|
-
|
|
70
|
+
sith --build
|
|
109
71
|
```
|
|
110
|
-
Follow the browser prompt, then copy the printed token. It is valid for one year and scoped to inference only.
|
|
111
72
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
73
|
+
| | `sith --pull` | `sith --build` |
|
|
74
|
+
|--|--------------|----------------|
|
|
75
|
+
| Speed | Fast | Slow |
|
|
76
|
+
| Trust | GitHub Actions + Cosign | Your machine |
|
|
77
|
+
| Use case | Daily use, CI/CD | Air-gapped, custom builds |
|
|
116
78
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
```
|
|
79
|
+
### Use it
|
|
80
|
+
|
|
81
|
+
**Interactive TUI** — type a prompt or use slash commands:
|
|
121
82
|
|
|
122
|
-
**Verify:**
|
|
123
83
|
```bash
|
|
124
|
-
|
|
125
|
-
# Should show: "loggedIn": true, "authMethod": "claude.ai"
|
|
84
|
+
sith
|
|
126
85
|
```
|
|
127
86
|
|
|
128
|
-
|
|
87
|
+
| In the TUI | What it does |
|
|
88
|
+
|------------|-------------|
|
|
89
|
+
| Type any text + Enter | Starts OpenCode with that prompt |
|
|
90
|
+
| `/shell` | Drop into Docker shell (no AI) |
|
|
91
|
+
| `/claude` | Switch active tool to Claude Code |
|
|
92
|
+
| `/opencode` | Switch active tool to OpenCode |
|
|
93
|
+
| `/config` | Pull / build options |
|
|
94
|
+
| `/help` | Show commands |
|
|
95
|
+
| `Ctrl+C` / `Esc` | Exit |
|
|
129
96
|
|
|
130
|
-
|
|
97
|
+
**Direct commands** — skip the TUI:
|
|
131
98
|
|
|
132
|
-
Sith uses **Claude Sonnet 4.6 via GitHub Copilot** by default for OpenCode. Requires a GitHub token with Copilot access.
|
|
133
|
-
|
|
134
|
-
**Automatic (recommended):**
|
|
135
|
-
If you have GitHub CLI (`gh`) installed and authenticated, Sith automatically fetches your token:
|
|
136
99
|
```bash
|
|
137
|
-
sith
|
|
100
|
+
sith shell # Raw Nix shell inside Docker (alias: sith --it)
|
|
101
|
+
sith opencode -p "fix the bug" # OpenCode starts immediately with your task
|
|
102
|
+
sith claude -p "fix the bug" # Claude Code starts immediately with your task
|
|
138
103
|
```
|
|
139
104
|
|
|
140
|
-
**
|
|
141
|
-
If you don't have `gh` CLI or prefer manual setup:
|
|
105
|
+
**Skills:**
|
|
142
106
|
|
|
143
|
-
1. Ensure you have GitHub Copilot access
|
|
144
|
-
2. Create a token at https://github.com/settings/tokens
|
|
145
|
-
3. Required scopes: `copilot`, `repo`, `read:org`
|
|
146
|
-
4. Export it:
|
|
147
107
|
```bash
|
|
148
|
-
|
|
149
|
-
sith
|
|
108
|
+
sith skills # Install / manage skills from catalog (~/.sith/skills/)
|
|
150
109
|
```
|
|
151
110
|
|
|
152
|
-
|
|
153
|
-
```bash
|
|
154
|
-
export GITHUB_TOKEN=$(gh auth token)
|
|
155
|
-
```
|
|
111
|
+
### Cleanup & Uninstall
|
|
156
112
|
|
|
157
|
-
**Inside container:**
|
|
158
|
-
Once OpenCode starts, authenticate with GitHub Copilot:
|
|
159
113
|
```bash
|
|
160
|
-
|
|
161
|
-
#
|
|
114
|
+
sith --docker-cleanup # Remove sith Docker images (sith:latest + prebuilt GHCR image)
|
|
115
|
+
sith --uninstall # Remove ~/.sith/ (skills, config, nix files)
|
|
162
116
|
```
|
|
163
117
|
|
|
164
118
|
### CI / GitHub Actions
|
|
165
119
|
|
|
166
|
-
Add both tokens as repository secrets, then pass them to the container:
|
|
167
|
-
|
|
168
120
|
```yaml
|
|
169
121
|
- name: Run sith
|
|
170
122
|
env:
|
|
@@ -177,98 +129,70 @@ Add both tokens as repository secrets, then pass them to the container:
|
|
|
177
129
|
ghcr.io/merzoukemanouri/sith:latest "claude auth status"
|
|
178
130
|
```
|
|
179
131
|
|
|
180
|
-
|
|
132
|
+
See [Authentication](./doc/AUTH_CLAUDE.md) for how to generate the tokens.
|
|
181
133
|
|
|
182
|
-
|
|
134
|
+
---
|
|
183
135
|
|
|
184
|
-
|
|
185
|
-
- **OpenCode Integration**: Start coding with a simple text prompt
|
|
186
|
-
- **Model Selection**: Uses Claude Sonnet 4.6 via GitHub Copilot by default
|
|
187
|
-
- **Prebuilt Images**: Pull verified images from GitHub Container Registry
|
|
188
|
-
- **Image Signing**: All images signed with cosign for supply chain security
|
|
189
|
-
- **SBOM Attestation**: Software Bill of Materials included with every image
|
|
190
|
-
- **Dockerized Environment**: Consistent setup across machines
|
|
191
|
-
- **Nix Integration**: Full development environment with all tools
|
|
192
|
-
- **CI-Ready**: Standardize builds across local and CI pipelines
|
|
193
|
-
- **Non-root User**: Images run as non-root user (UID 1000) for better security
|
|
136
|
+
## Direct Nix
|
|
194
137
|
|
|
195
|
-
|
|
138
|
+
No Docker. Runs the same Nix environment natively on your machine.
|
|
196
139
|
|
|
197
|
-
|
|
140
|
+
```bash
|
|
141
|
+
sith --nix-install # Install Nix package manager (once)
|
|
142
|
+
sith --nix # Launch Nix shell directly
|
|
143
|
+
```
|
|
198
144
|
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
145
|
+
Or via the `nix` subcommand:
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
sith nix --install # Install Nix
|
|
149
|
+
sith nix --shell # Run Nix shell
|
|
150
|
+
```
|
|
203
151
|
|
|
204
|
-
|
|
152
|
+
**Cleanup:**
|
|
205
153
|
|
|
206
|
-
|
|
154
|
+
```bash
|
|
155
|
+
sith --nix-cleanup # Remove ~/.sith/nix/ + run nix-collect-garbage -d
|
|
156
|
+
sith --nix-uninstall # Fully remove Nix from system (daemon, /nix/store) — needs sudo
|
|
157
|
+
```
|
|
207
158
|
|
|
208
|
-
|
|
209
|
-
- Built by GitHub Actions on public infrastructure
|
|
210
|
-
- Signed with Sigstore keyless signing
|
|
211
|
-
- Verifiable provenance chain from source to image
|
|
212
|
-
- Trade-off: Trust GitHub's build infrastructure
|
|
159
|
+
See [doc/NIX_INSTALLATION.md](./doc/NIX_INSTALLATION.md) for full setup guide.
|
|
213
160
|
|
|
214
|
-
|
|
215
|
-
- Full control over build environment
|
|
216
|
-
- Can inspect Dockerfile before building
|
|
217
|
-
- No dependency on external registries
|
|
218
|
-
- Trade-off: Slower, manual security updates
|
|
161
|
+
---
|
|
219
162
|
|
|
220
|
-
|
|
163
|
+
## Authentication
|
|
221
164
|
|
|
222
|
-
|
|
165
|
+
Two AI providers, two token setups:
|
|
223
166
|
|
|
224
|
-
|
|
167
|
+
- **Claude Code** (Anthropic OAuth) → [doc/AUTH_CLAUDE.md](./doc/AUTH_CLAUDE.md)
|
|
168
|
+
- **OpenCode** (GitHub Copilot) → [doc/AUTH_OPENCODE.md](./doc/AUTH_OPENCODE.md)
|
|
225
169
|
|
|
226
|
-
|
|
227
|
-
# Install dependencies
|
|
228
|
-
pnpm install
|
|
170
|
+
---
|
|
229
171
|
|
|
230
|
-
|
|
231
|
-
pnpm dev
|
|
172
|
+
## Development
|
|
232
173
|
|
|
233
|
-
|
|
174
|
+
```bash
|
|
175
|
+
pnpm install # Install dependencies
|
|
176
|
+
pnpm dev # Run in development mode (no build)
|
|
234
177
|
pnpm dev:build # Build and run CLI
|
|
235
178
|
pnpm dev:shell # Build and launch shell
|
|
236
|
-
|
|
237
|
-
#
|
|
238
|
-
pnpm typecheck
|
|
239
|
-
|
|
240
|
-
# Clean build artifacts
|
|
241
|
-
pnpm clean
|
|
179
|
+
pnpm typecheck # Type checking
|
|
180
|
+
pnpm clean # Clean build artifacts
|
|
242
181
|
```
|
|
243
182
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
Automated releases using semantic-release and conventional commits.
|
|
183
|
+
---
|
|
247
184
|
|
|
248
|
-
|
|
185
|
+
## Publishing
|
|
249
186
|
|
|
250
|
-
|
|
251
|
-
- `feat:` - New feature (triggers minor version bump)
|
|
252
|
-
- `fix:` - Bug fix (triggers patch version bump)
|
|
253
|
-
- `BREAKING CHANGE:` - Breaking change (triggers major version bump)
|
|
254
|
-
- `chore:`, `docs:`, `style:` - No release
|
|
187
|
+
Automated via semantic-release and conventional commits.
|
|
255
188
|
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
- Creates GitHub release
|
|
263
|
-
- Publishes to npm
|
|
189
|
+
| Prefix | Effect |
|
|
190
|
+
|--------|--------|
|
|
191
|
+
| `feat:` | Minor version bump |
|
|
192
|
+
| `fix:` | Patch version bump |
|
|
193
|
+
| `BREAKING CHANGE:` | Major version bump |
|
|
194
|
+
| `chore:` `docs:` `style:` | No release |
|
|
264
195
|
|
|
265
|
-
|
|
266
|
-
```bash
|
|
267
|
-
git commit -m "feat: add new interactive menu option"
|
|
268
|
-
git push origin main
|
|
269
|
-
# Automatic release triggered!
|
|
270
|
-
```
|
|
196
|
+
Push to `main` → GitHub Action bumps version, generates CHANGELOG, publishes to npm.
|
|
271
197
|
|
|
272
|
-
**Requirements:**
|
|
273
|
-
- `NPM_TOKEN` secret configured in GitHub repository settings
|
|
274
|
-
- Commits must follow conventional commit format
|
|
198
|
+
**Requirements:** `NPM_TOKEN` secret in repository settings.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docker.d.ts","sourceRoot":"","sources":["file:///home/runner/work/sith/sith/src/commands/docker.
|
|
1
|
+
{"version":3,"file":"docker.d.ts","sourceRoot":"","sources":["file:///home/runner/work/sith/sith/src/commands/docker.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAwBxD,wBAAsB,aAAa,CAClC,OAAO,EAAE,oBAAoB,GAC3B,OAAO,CAAC,IAAI,CAAC,CAUf"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function dockerCleanupCommand(): Promise<void>;
|
|
2
|
+
export declare function nixCleanupCommand(): Promise<void>;
|
|
3
|
+
export declare function nixUninstallCommand(): Promise<void>;
|
|
4
|
+
export declare function uninstallCommand(): Promise<void>;
|
|
5
|
+
//# sourceMappingURL=maintenance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"maintenance.d.ts","sourceRoot":"","sources":["file:///home/runner/work/sith/sith/src/commands/maintenance.ts"],"names":[],"mappings":"AAkBA,wBAAsB,oBAAoB,kBAwBzC;AAED,wBAAsB,iBAAiB,kBAqBtC;AAED,wBAAsB,mBAAmB,kBAmExC;AAED,wBAAsB,gBAAgB,kBAwBrC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TerminalUI.d.ts","sourceRoot":"","sources":["file:///home/runner/work/sith/sith/src/components/TerminalUI.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TerminalUI.d.ts","sourceRoot":"","sources":["file:///home/runner/work/sith/sith/src/components/TerminalUI.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAwC,MAAM,OAAO,CAAC;AA4I7D,wBAAgB,UAAU,IAAI,KAAK,CAAC,YAAY,CA0N/C;AAED,wBAAgB,gBAAgB,IAAI,IAAI,CAEvC"}
|