opencode-ralph-loop-cli 0.1.0

Scaffolder CLI for OpenCode Ralph Loop plugin — one command setup
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
# Integrations — opencode-ralph-loop-cli

> "From shell scripts to Kubernetes CronJobs — integrations for every workflow."


## Summary Table

| Integration | Type | Min Version | Example |
|---|---|---|---|
| Claude Code | AI Agent | any | `opencode-ralph-loop-cli init` in CLAUDE.md setup step |
| Codex (OpenAI) | AI Agent | any | Add `init` to Codex workspace bootstrap script |
| Gemini CLI | AI Agent | any | Add `init` to `.gemini/` project setup hook |
| Opencode | AI Agent | any | Place `check --strict` in Opencode pre-session hook |
| Cursor | AI Agent | any | Add `init` to Cursor `.cursorrules` setup instructions |
| Windsurf | AI Agent | any | Add `init` to Windsurf workspace onboarding rules |
| VS Code Copilot | AI Agent | any | Add `init` to `.vscode/tasks.json` preLaunchTask |
| GitHub Copilot | AI Agent | any | Add `check --strict` to CI workflow before Copilot steps |
| Zed | AI Agent | any | Add `init` to Zed workspace setup task |
| Aider | AI Agent | any | Add `init` call to `.aider.conf.yml` startup commands |
| Jules | AI Agent | any | Add `init` to Jules project bootstrap hooks |
| JetBrains AI | AI Agent | any | Add `init` to JetBrains run configuration before-launch step |
| Kilo Code | AI Agent | any | Add `init` to Kilo Code workspace setup instructions |
| Roo Code | AI Agent | any | Add `init` to Roo Code project initialization hook |
| Cline | AI Agent | any | Add `init` to Cline `.clinerules` setup block |
| Continue | AI Agent | any | Add `init` to Continue context provider setup |
| Factory | AI Agent | any | Add `init` to Factory project onboarding pipeline |
| Augment | AI Agent | any | Add `init` to Augment workspace bootstrap command |
| Minimax | AI Agent | any | Add `init` to Minimax project initialization hook |
| Z.ai | AI Agent | any | Add `init` to Z.ai agent workspace setup step |
| Google Antigravity | AI Agent | any | Add `init` to Antigravity project configuration hook |
| Bash | Shell | 4.0 | Source completion script, use with `--output json` |
| Zsh | Shell | 5.0 | Source completion script via `$fpath` |
| Fish | Shell | 3.0 | Source completion script via `~/.config/fish/completions/` |
| PowerShell | Shell | 7.0 | Import completion script via profile |
| Nushell | Shell | 0.80 | Source completion script via `config.nu` |
| GitHub Actions | CI/CD | N/A | `check --strict` in workflow step |
| GitLab CI | CI/CD | N/A | `check --strict` in `.gitlab-ci.yml` script block |
| CircleCI | CI/CD | N/A | `check --strict` in `run` step |
| Docker | Container | 20.10 | `init --skip-install` in multi-stage Dockerfile |
| Alpine | Container | 3.18 | `init --skip-install` in minimal Alpine image |
| Kubernetes | Container | 1.25 | CronJob running `check --strict` on schedule |
| cargo install | Package Manager | Rust 1.85 | `cargo install opencode-ralph-loop-cli` |
| Homebrew | Package Manager | N/A | Tap placeholder — coming soon |
| Scoop | Package Manager | N/A | Manifest placeholder — coming soon |


## AI Agent Integrations


### Claude Code
- Add `opencode-ralph-loop-cli init` to the project setup section of `CLAUDE.md`
- Use `check --strict` as a pre-session gate to verify template integrity
- Place the binary in `PATH` so Claude Code can call it from any working directory
- Exit code 0 confirms the environment is ready for AI-assisted development

```bash
# CLAUDE.md setup step
opencode-ralph-loop-cli doctor && opencode-ralph-loop-cli init
```


### Codex (OpenAI)
- Add `init` to the Codex workspace bootstrap script that runs before sessions
- Use `check --output json` to feed drift status into Codex context
- Verify the binary is available in the Codex sandbox PATH before invoking
- Pipe JSON output through `jaq` to extract relevant fields for prompts

```bash
# Codex bootstrap
opencode-ralph-loop-cli init --skip-install
opencode-ralph-loop-cli check --output json
```


### Gemini CLI
- Add `init` to the `.gemini/` project setup hook that runs on workspace open
- Use `check --strict` in pre-session validation to block sessions on drift
- The `--output quiet` flag keeps Gemini CLI context clean of tool output
- Expose the `doctor` exit code to Gemini to surface environment issues

```bash
# Gemini setup hook
opencode-ralph-loop-cli init --skip-install
opencode-ralph-loop-cli check --strict --output quiet
```


### Opencode
- Place `check --strict` in the Opencode pre-session hook configuration
- Use `init` in the workspace onboarding step to scaffold templates
- Opencode reads exit codes natively — use 0 for pass, non-zero for block
- The `--output json` format integrates with Opencode structured context

```bash
# Opencode pre-session hook
opencode-ralph-loop-cli check --strict
```


### Cursor
- Add `opencode-ralph-loop-cli init` to the setup instructions in `.cursorrules`
- Instruct Cursor to run `check --strict` before starting AI-assisted sessions
- The binary name is short enough to include in natural language instructions
- Use `--output json` so Cursor can parse drift status programmatically

```
# .cursorrules setup block
Run: opencode-ralph-loop-cli init
Verify: opencode-ralph-loop-cli check --strict --output quiet
```


### Windsurf
- Add `init` to the Windsurf workspace onboarding rules file
- Use `doctor` to verify the environment as the first onboarding step
- Windsurf agent reads exit codes — non-zero blocks session continuation
- Combine `check --strict` with `--output quiet` for clean agent output

```bash
# Windsurf onboarding
opencode-ralph-loop-cli doctor && opencode-ralph-loop-cli init
```


### VS Code Copilot
- Add `init` to `.vscode/tasks.json` as a `preLaunchTask` for the workspace
- Use `check --strict` in a dedicated validation task for CI-style feedback
- The task output appears in VS Code's Terminal panel for easy inspection
- Chain with `doctor` to verify the environment before scaffolding

```json
{
  "label": "Setup AI Templates",
  "type": "shell",
  "command": "opencode-ralph-loop-cli init",
  "group": "build",
  "presentation": { "reveal": "always" }
}
```


### GitHub Copilot
- Add `check --strict` to the CI workflow before any Copilot-assisted steps
- Use `--output json` to surface drift details in workflow run logs
- The binary runs in any Linux, macOS, or Windows GitHub Actions runner
- Install via `cargo install opencode-ralph-loop-cli` in workflow setup

```yaml
- name: Verify AI Templates
  run: opencode-ralph-loop-cli check --strict
```


### Zed
- Add `init` to the Zed workspace setup task in `.zed/tasks.json`
- Use `check --strict` as a pre-session task to enforce template integrity
- Zed tasks display output in the task panel for visibility
- Combine with `doctor` to validate the environment on workspace open

```json
{
  "label": "Setup AI Templates",
  "command": "opencode-ralph-loop-cli",
  "args": ["init"]
}
```


### Aider
- Add `init` call to the `.aider.conf.yml` startup commands section
- Use `check --output json` to feed template status into Aider context
- The binary is a single static executable with no runtime dependencies besides bun
- Pipe JSON output to `jaq` to extract file paths for Aider context injection

```yaml
# .aider.conf.yml
auto-commits: false
message: |
  Run: opencode-ralph-loop-cli init --skip-install
```


### Jules
- Add `init` to the Jules project bootstrap hooks that run before sessions
- Use `check --strict` as a gate that blocks session start on drift
- Jules reads exit codes — use the 0 vs non-zero distinction for flow control
- The `--output quiet` flag prevents tool output from polluting Jules context

```bash
# Jules bootstrap hook
opencode-ralph-loop-cli init --skip-install
opencode-ralph-loop-cli check --strict --output quiet
```


### JetBrains AI
- Add `init` to the JetBrains run configuration as a before-launch external tool step
- Use `doctor` in the before-launch step to verify environment readiness
- JetBrains run configurations support exit code checks — non-zero blocks launch
- Configure the working directory to the project root for correct path resolution

```xml
<!-- .idea/runConfigurations/setup.xml -->
<ExternalSystemBeforeLaunchTask ... />
<!-- Command: opencode-ralph-loop-cli init -->
```


### Kilo Code
- Add `init` to the Kilo Code workspace setup instructions
- Use `check --strict` as a pre-session verification step
- The binary reads the current directory as project root automatically
- Exit code 0 signals readiness to Kilo Code's environment validation

```bash
# Kilo Code setup
opencode-ralph-loop-cli init && opencode-ralph-loop-cli check --strict
```


### Roo Code
- Add `init` to the Roo Code project initialization hook
- Use `check --output json` to expose template status to Roo Code context
- Roo Code can parse JSON output natively for structured decision-making
- Combine `doctor` and `init` in a single bootstrap command for efficiency

```bash
# Roo Code initialization hook
opencode-ralph-loop-cli doctor && opencode-ralph-loop-cli init
```


### Cline
- Add `init` to the `.clinerules` setup block that runs on workspace open
- Use `check --strict` as a pre-task gate to prevent drift-affected sessions
- Cline reads exit codes to determine whether to proceed with AI tasks
- The `--skip-install` flag is useful in environments where bun is unavailable

```
# .clinerules setup block
Run: opencode-ralph-loop-cli init --skip-install
Gate: opencode-ralph-loop-cli check --strict --output quiet
```


### Continue
- Add `init` to the Continue context provider setup script
- Use `check --output json` to inject template status into Continue context
- Continue can use JSON output fields to conditionally include context snippets
- Pipe the `list` command output to expose managed template hashes to Continue

```bash
# Continue setup
opencode-ralph-loop-cli init
opencode-ralph-loop-cli list --output json
```


### Factory
- Add `init` to the Factory project onboarding pipeline as the first step
- Use `check --strict` as a pipeline gate before AI-assisted code generation
- Factory pipelines support exit code routing — use 0 for continue, non-zero for halt
- The `--output json` format integrates with Factory structured pipeline data

```bash
# Factory onboarding pipeline step
opencode-ralph-loop-cli init
opencode-ralph-loop-cli check --strict --output json
```


### Augment
- Add `init` to the Augment workspace bootstrap command list
- Use `doctor` first to verify environment, then `init` to scaffold templates
- Augment can use `check --output json` to surface template status in context
- The `--skip-install` flag enables use in restricted sandbox environments

```bash
# Augment bootstrap
opencode-ralph-loop-cli doctor
opencode-ralph-loop-cli init --skip-install
```


### Minimax
- Add `init` to the Minimax project initialization hook configuration
- Use `check --strict` to enforce template integrity before AI sessions
- Minimax agents read exit codes for flow control — 0 continues, non-zero halts
- Combine with `--output quiet` for clean agent context without tool noise

```bash
# Minimax initialization hook
opencode-ralph-loop-cli init && opencode-ralph-loop-cli check --strict --output quiet
```


### Z.ai
- Add `init` to the Z.ai agent workspace setup step
- Use `check --output json` to feed template status into Z.ai agent context
- The binary is self-contained and requires no additional configuration files
- Exit codes map cleanly to Z.ai flow control: 0 for pass, non-zero for fail

```bash
# Z.ai workspace setup
opencode-ralph-loop-cli init
opencode-ralph-loop-cli check --output json
```


### Google Antigravity
- Add `init` to the Antigravity project configuration hook
- Use `check --strict` as a pre-session gate to block sessions on drift
- Antigravity agents can parse `--output json` for structured context injection
- The `doctor` command surfaces environment issues before scaffolding begins

```bash
# Antigravity configuration hook
opencode-ralph-loop-cli doctor && opencode-ralph-loop-cli init
opencode-ralph-loop-cli check --strict
```


## Shell Integrations


### Bash
- Generate and install completions with the commands below
- Reload your shell or source `.bashrc` to activate immediately
- All subcommands, flags, and `--output` values are covered by completions

```bash
opencode-ralph-loop-cli completions bash \
  > ~/.local/share/bash-completion/completions/opencode-ralph-loop-cli
source ~/.bashrc
```


### Zsh
- Generate the completion script and place it on your `$fpath`
- Run `compinit` after installing if completions do not load automatically

```zsh
opencode-ralph-loop-cli completions zsh \
  > ~/.zsh/completions/_opencode-ralph-loop-cli
autoload -U compinit && compinit
```


### Fish
- Place the completion script in the Fish completions directory
- Fish auto-loads all scripts in that directory on shell start

```fish
opencode-ralph-loop-cli completions fish \
  > ~/.config/fish/completions/opencode-ralph-loop-cli.fish
```


### PowerShell
- Generate the completion script and add it to your PowerShell profile
- Restart PowerShell or dot-source your profile to activate

```powershell
opencode-ralph-loop-cli completions powershell | Out-String | Invoke-Expression
# To persist: add the above line to $PROFILE
```


### Nushell
- Generate the completion script and source it in `config.nu`
- Nushell completions are defined as `def` blocks with `@` annotations

```nu
opencode-ralph-loop-cli completions nushell | save ~/.config/nushell/completions/opencode-ralph-loop-cli.nu
# Add to config.nu: source ~/.config/nushell/completions/opencode-ralph-loop-cli.nu
```


## CI/CD Integrations


### GitHub Actions

```yaml
name: Verify AI Templates

on:
  push:
    branches: [main]
  pull_request:

jobs:
  template-check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Install Rust
        uses: dtolnay/rust-toolchain@stable
        with:
          toolchain: 1.85

      - name: Install opencode-ralph-loop-cli
        run: cargo install opencode-ralph-loop-cli

      - name: Verify doctor
        run: opencode-ralph-loop-cli doctor

      - name: Check template drift
        run: opencode-ralph-loop-cli check --strict --output json
```


### GitLab CI

```yaml
template-check:
  stage: validate
  image: rust:1.85
  before_script:
    - cargo install opencode-ralph-loop-cli
  script:
    - opencode-ralph-loop-cli doctor
    - opencode-ralph-loop-cli check --strict --output json
  rules:
    - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
    - if: '$CI_COMMIT_BRANCH == "main"'
```


### CircleCI

```yaml
version: 2.1

jobs:
  template-check:
    docker:
      - image: rust:1.85
    steps:
      - checkout
      - run:
          name: Install opencode-ralph-loop-cli
          command: cargo install opencode-ralph-loop-cli
      - run:
          name: Verify environment
          command: opencode-ralph-loop-cli doctor
      - run:
          name: Check template drift
          command: opencode-ralph-loop-cli check --strict --output json

workflows:
  validate:
    jobs:
      - template-check
```


## Container Integrations


### Docker Multi-Stage Build

```dockerfile
FROM rust:1.85-slim AS tool-builder
RUN cargo install opencode-ralph-loop-cli

FROM node:20-slim AS template-setup
COPY --from=tool-builder /usr/local/cargo/bin/opencode-ralph-loop-cli /usr/local/bin/
WORKDIR /app
COPY . .
RUN opencode-ralph-loop-cli init
RUN cd .opencode && npm install

FROM node:20-slim AS final
WORKDIR /app
COPY --from=template-setup /app .
```


### Alpine Minimal Image

```dockerfile
FROM rust:1.85-alpine AS builder
RUN apk add --no-cache musl-dev
RUN cargo install opencode-ralph-loop-cli

FROM alpine:3.18
COPY --from=builder /usr/local/cargo/bin/opencode-ralph-loop-cli /usr/local/bin/
WORKDIR /workspace
# Skip bun install — run it at container startup or in a separate stage
RUN opencode-ralph-loop-cli init --skip-install
```


### Kubernetes CronJob

```yaml
apiVersion: batch/v1
kind: CronJob
metadata:
  name: template-drift-check
  namespace: default
spec:
  schedule: "0 * * * *"
  jobTemplate:
    spec:
      template:
        spec:
          restartPolicy: OnFailure
          containers:
            - name: drift-checker
              image: rust:1.85-slim
              command:
                - /bin/sh
                - -c
                - |
                  cargo install opencode-ralph-loop-cli && \
                  opencode-ralph-loop-cli check --strict --output json
              volumeMounts:
                - name: workspace
                  mountPath: /workspace
          volumes:
            - name: workspace
              persistentVolumeClaim:
                claimName: workspace-pvc
```


## Package Manager Integrations


### cargo install

```bash
# Install latest version
cargo install opencode-ralph-loop-cli

# Install specific version
cargo install opencode-ralph-loop-cli --version 0.1.0

# Verify installation
opencode-ralph-loop-cli --version
```

- Requires Rust 1.85 or later
- Binary is installed to `~/.cargo/bin/` by default
- Ensure `~/.cargo/bin/` is in your `PATH`


### Homebrew (coming soon)

```bash
# Tap placeholder — not yet available
# brew tap TODO/opencode-ralph-loop-cli
# brew install opencode-ralph-loop-cli
```

- Homebrew formula will be published after the first stable release
- Watch the repository for updates on availability


### Scoop (coming soon)

```powershell
# Scoop manifest placeholder — not yet available
# scoop bucket add TODO https://github.com/TODO/scoop-bucket
# scoop install opencode-ralph-loop-cli
```

- Scoop manifest will be published alongside the Windows release binaries
- Watch the repository for updates on availability


Also available in [Português](INTEGRATIONS.pt-BR.md)