-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
1493 lines (1379 loc) · 72.7 KB
/
Copy pathindex.html
File metadata and controls
1493 lines (1379 loc) · 72.7 KB
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
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>dirge — The Batteries-Included Rust Coding Agent</title>
<meta name="description" content="dirge is a batteries-included AI coding agent for your terminal — MCP, LSP, plugins, code intelligence, and memory, all built in. ~8MB RAM idle, ~36MB binary. Native Rust, no runtime." />
<meta name="keywords" content="AI coding agent, terminal AI, Rust, TUI, LLM, CLI agent, coding assistant" />
<meta name="color-scheme" content="light dark" />
<meta name="theme-color" content="#0d1117" media="(prefers-color-scheme: dark)" />
<meta name="theme-color" content="#ffffff" media="(prefers-color-scheme: light)" />
<meta property="og:title" content="dirge — The Batteries-Included Rust Coding Agent" />
<meta property="og:description" content="A batteries-included AI coding agent for your terminal — MCP, LSP, plugins, code intelligence, and memory, all built in. ~8MB RAM idle, ~36MB binary. Native Rust." />
<meta property="og:url" content="https://dirge-code.github.io/" />
<meta property="og:type" content="website" />
<meta property="og:image" content="https://dirge-code.github.io/img/dirge1.jpg" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:image" content="https://dirge-code.github.io/img/dirge1.jpg" />
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><text y='28' font-size='28'>⚡</text></svg>" />
<style>
/* ─── RESET & BASE ──────────────────────────────────────────── */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
*::selection{background:#58a6ff;color:#fff}
:root{
/* Adaptive page palette (dark default; light overrides below) */
--bg:#0d1117;
--bg2:#161b22;
--bg3:#1a1f27;
--fg:#e6edf3;
--fg-hi:#ffffff;
--fg-dim:#b0b8c0;
--fg-mute:#6e7681;
--accent:#58a6ff;
--accent2:#79c0ff;
--green:#3fb950;
--green-dim:#238636;
--amber:#d29922;
--warn:#f0883e;
--red:#f85149;
--border:#30363d;
--border2:#21262d;
--nav-bg:rgba(13,17,23,0.94);
/* Pinned "terminal" palette — ALWAYS dark, in both color schemes,
so code blocks and the terminal mock never get light-on-light or
dark-on-dark text when the OS is in light mode. */
--t-bg:#0d1117;
--t-panel:#161b22;
--t-head:#1a1f27;
--t-fg:#e6edf3;
--t-dim:#8b949e;
--t-mute:#6e7681;
--t-blue:#58a6ff;
--t-blue2:#79c0ff;
--t-green:#3fb950;
--t-green2:#7ee787;
--t-amber:#d29922;
--t-text:#c9d1d9;
--maxw:960px;
--pad:24px;
--mono:"IBM Plex Mono","Fira Code","JetBrains Mono","Cascadia Code",ui-monospace,"SF Mono",Menlo,monospace;
}
/* ─── LIGHT MODE ────────────────────────────────────────────────
Only the ADAPTIVE vars flip. The pinned --t-* terminal palette is
intentionally left dark so code/terminal surfaces stay readable. */
@media (prefers-color-scheme: light){
:root{
--bg:#ffffff;
--bg2:#f6f8fa;
--bg3:#eaeef2;
--fg:#1f2328;
--fg-hi:#010409;
--fg-dim:#59636e;
--fg-mute:#818b98;
--accent:#0969da;
--accent2:#0550ae;
--green:#1a7f37;
--green-dim:#116329;
--amber:#9a6700;
--warn:#bc4c00;
--red:#cf222e;
--border:#d1d9e0;
--border2:#e2e6ea;
--nav-bg:rgba(255,255,255,0.92);
}
}
html{scroll-behavior:smooth;font-size:15px;background:var(--bg)}
body{
background:var(--bg);
color:var(--fg);
font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
line-height:1.65;
-webkit-font-smoothing:antialiased;
}
a{color:var(--accent);text-decoration:none}
a:hover{text-decoration:underline}
code{font-family:var(--mono);font-size:0.9em;background:var(--bg2);padding:2px 5px;border-radius:3px;color:var(--fg-hi);border:1px solid var(--border2)}
b{font-weight:600}
p{font-size:15px}
/* ─── NAV ──────────────────────────────────────────────────── */
.nav{
position:sticky;top:0;z-index:50;
background:var(--nav-bg);
backdrop-filter:blur(10px);
border-bottom:1px solid var(--border);
}
.nav-inner{
max-width:var(--maxw);margin:0 auto;
padding:12px var(--pad);
display:flex;align-items:center;gap:24px;
}
.brand{
display:flex;align-items:baseline;gap:10px;
text-decoration:none;color:var(--fg-hi);
font-weight:700;font-size:16px;letter-spacing:0.04em;
font-family:var(--mono);
}
.brand:hover{text-decoration:none}
.brand-mark{color:var(--green);font-size:18px}
.brand-ver{font-size:9px;color:var(--fg-mute);letter-spacing:0.12em}
.nav-links{display:flex;gap:18px;margin-left:20px}
.nav-links a{
color:var(--fg-dim);text-decoration:none;
font-size:11px;letter-spacing:0.08em;text-transform:uppercase;
transition:color 0.18s;font-family:var(--mono);
}
.nav-links a:hover{color:var(--fg-hi);text-decoration:none}
.nav-right{margin-left:auto;display:flex;gap:10px;align-items:center}
/* GitHub-style star button: [★ Star] [count] with the connecting caret */
.gh-star{
display:inline-flex;align-items:stretch;
font-size:12px;font-weight:600;line-height:1;
text-decoration:none;color:var(--fg);
}
.gh-star:hover{text-decoration:none}
.gh-star-btn{
display:inline-flex;align-items:center;gap:6px;
padding:5px 10px;
color:var(--fg);background:var(--bg2);
border:1px solid var(--border);border-radius:6px 0 0 6px;
transition:background 0.15s,border-color 0.15s;
}
.gh-star-btn svg{width:14px;height:14px;fill:currentColor}
.gh-star:hover .gh-star-btn{background:var(--bg3);border-color:var(--fg-dim)}
.gh-star-count{
display:none;align-items:center;position:relative;
padding:5px 10px;margin-left:7px;
color:var(--fg);background:var(--bg);
border:1px solid var(--border);border-radius:6px;
font-variant-numeric:tabular-nums;
}
/* the little triangle that points from the count box back at the button */
.gh-star-count::before{
content:"";position:absolute;left:-7px;top:50%;transform:translateY(-50%);
border:7px solid transparent;border-right-color:var(--border);border-left:0;
}
.gh-star-count::after{
content:"";position:absolute;left:-6px;top:50%;transform:translateY(-50%);
border:6px solid transparent;border-right-color:var(--bg);border-left:0;
}
/* ─── SECTIONS ──────────────────────────────────────────────── */
.sec{
max-width:var(--maxw);margin:0 auto;
padding:80px var(--pad) 40px;
border-top:1px solid var(--border);
}
.sec:first-of-type{border-top:0}
.sec-eyebrow{
display:flex;align-items:center;gap:10px;
font-size:10px;letter-spacing:0.15em;text-transform:uppercase;
color:var(--fg-mute);margin-bottom:20px;font-family:var(--mono);
}
.sec-eyebrow .dash{color:var(--green)}
.sec-eyebrow .rule{flex:1;height:1px;background:var(--border2);max-width:180px}
.sec-title{
font-size:clamp(26px,3.6vw,38px);
font-weight:700;letter-spacing:-0.01em;line-height:1.18;
color:var(--fg-hi);margin-bottom:14px;
}
.sec-title em{color:var(--green);font-style:normal}
.sec-lede{
color:var(--fg-dim);font-size:15px;line-height:1.6;
max-width:620px;margin-bottom:36px;
}
/* ─── HERO ──────────────────────────────────────────────────── */
.hero{padding:48px var(--pad) 60px}
.hero-tag{
font-size:10px;letter-spacing:0.16em;text-transform:uppercase;
color:var(--fg-mute);margin-bottom:22px;font-family:var(--mono);
}
.hero-tag b{color:var(--green);font-weight:600}
/* Logo to the LEFT of the intro, vertically centred against the whole
block (tag + title + lede + buttons) so it frames the text instead of
floating beside the title alone. */
.hero-top{display:flex;align-items:center;gap:clamp(24px,4vw,56px)}
.hero-intro{flex:1;min-width:0}
.hero-logo{
flex-shrink:0;width:clamp(132px,17vw,232px);height:auto;
filter:drop-shadow(0 0 22px rgba(63,185,80,0.28));
}
.hero h1{
font-size:clamp(40px,5vw,68px);
font-weight:700;line-height:0.98;letter-spacing:-0.02em;
color:var(--fg-hi);margin-bottom:20px;text-wrap:balance;
}
.hero h1 em{color:var(--green);font-style:normal}
@media(max-width:720px){
.hero-top{flex-direction:column;align-items:flex-start;gap:22px}
.hero-logo{width:128px}
}
.hero .lede{
font-size:16px;line-height:1.62;color:var(--fg-dim);
max-width:600px;margin-bottom:28px;text-wrap:pretty;
}
.hero .lede b{color:var(--fg-hi)}
.hero-act{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:40px}
.btn{
display:inline-flex;align-items:center;gap:8px;
padding:10px 20px;
font-size:14px;font-weight:600;letter-spacing:0.02em;
cursor:pointer;border:1px solid transparent;
text-decoration:none;transition:all 0.18s;white-space:nowrap;
border-radius:6px;
}
.btn:hover{text-decoration:none}
.btn-pri{background:var(--green);color:#fff;border-color:var(--green)}
.btn-pri:hover{background:var(--green-dim);border-color:var(--green-dim)}
.btn-gh{
background:transparent;color:var(--fg-dim);
border-color:var(--border)
}
.btn-gh:hover{color:var(--fg-hi);border-color:var(--fg-dim)}
/* Hero stats */
.hero-stats{
display:grid;grid-template-columns:repeat(4,1fr);
border-top:1px solid var(--border);
border-bottom:1px solid var(--border);
max-width:640px;
}
.hs{padding:18px 14px;border-right:1px solid var(--border);text-align:center}
.hs:last-child{border-right:0}
.hs b{display:block;font-size:28px;font-weight:700;line-height:1;color:var(--fg-hi)}
.hs span{display:block;margin-top:6px;font-size:10px;letter-spacing:0.1em;text-transform:uppercase;color:var(--fg-mute)}
/* ─── dirge TUI recreation (phosphor theme, always dark) ───── */
.tui-win{
margin-top:14px;border:1px solid var(--border);border-radius:8px;
overflow:hidden;background:#04080c;
}
.tui-bar{
display:flex;align-items:center;gap:10px;
padding:9px 14px;background:#0d1117;border-bottom:1px solid #1b2027;
}
.tui-bar .dots{display:flex;gap:6px}
.tui-bar .dots i{width:9px;height:9px;border-radius:50%;display:inline-block}
.tui-bar .dots i:nth-child(1){background:#f85149}
.tui-bar .dots i:nth-child(2){background:#d29922}
.tui-bar .dots i:nth-child(3){background:#3fb950}
.tui-bar .t{font-size:11px;color:#8b949e;letter-spacing:0.04em;font-family:var(--mono)}
.tui{
/* dirge's real phosphor palette (src/ui/theme.rs :: phosphor()) — exact RGB.
#222 background, agent green, user cyan, critic lavender, perm amber,
vivid-green panel headers — so the mock matches the running TUI. */
--ph-bg:#222222;--ph-line:#4e9e6a;--ph-label:#60dc8c;
--ph-fg:#8ae89c;--ph-bright:#9eeeac;--ph-dim:#567460;
--ph-add-bg:#17331f;--ph-add:#8ae89c;--ph-del-bg:#3a1517;--ph-del:#ff8a86;
--ph-amber:#ffb955;--ph-cyan:#7dcdd2;--ph-gray:#6a8c78;
--ph-tool:#6cbc96;--ph-critic:#baa6d8;--ph-red:#ff5f5a;
background:var(--ph-bg);color:var(--ph-fg);
font-family:var(--mono);font-size:11px;line-height:1.5;padding:15px 14px 12px;
}
.tui-grid{display:grid;grid-template-columns:134px 1fr 148px;gap:11px;align-items:start}
.tui-col{display:flex;flex-direction:column;gap:15px;min-width:0}
.pnl{position:relative;border:1px solid var(--ph-line);padding:10px 9px 8px;border-radius:3px;min-width:0}
.pnl > .pl{
position:absolute;top:-6px;left:9px;background:var(--ph-bg);
padding:0 5px;color:var(--ph-label);font-size:8.5px;letter-spacing:0.14em;white-space:nowrap;
}
.pnl p{margin:0;color:var(--ph-fg);line-height:1.55;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
/* Left ([AGENT STATUS]) reads in muted green; right ([SYSTEM]: mcp / lsp /
todos / modified) reads in the system green-grey — matching the TUI. */
.lcol .pnl p{color:var(--ph-gray)}
.rcol .pnl p{color:var(--ph-gray)}
.dimt{color:var(--ph-dim)}
.brt{color:var(--ph-bright)}
.amb{color:var(--ph-amber)}
.cy{color:var(--ph-cyan)}
.ok{color:var(--ph-add)}
/* IRC-style handles, exactly as the TUI colors them. */
.h-dirge{color:var(--ph-fg)} /* assistant — agent green */
.h-you{color:var(--ph-cyan)} /* you — cyan */
.h-critic{color:var(--ph-critic)} /* critic — lavender */
.tl{color:var(--ph-tool)} /* tool headers — teal */
.rd{color:var(--ph-red)}
/* Bottom input row: status face + prompt field */
.tui-input{display:grid;grid-template-columns:88px 1fr;gap:11px;margin-top:14px}
.tui-face{
border:1px solid var(--ph-line);border-radius:3px;
display:flex;align-items:center;justify-content:center;
color:var(--ph-fg);font-size:12px;letter-spacing:0.08em;
}
.tui-field{
border:1px solid var(--ph-line);border-radius:3px;
padding:0 10px;color:var(--ph-fg);
display:flex;align-items:center;min-height:34px;
}
.log p{white-space:normal;margin-bottom:2px}
.log .step{padding-left:12px;text-indent:-12px}
.diff{margin-top:9px;border:1px solid var(--ph-line);border-radius:3px;overflow:hidden}
.diff .dh{padding:4px 8px;color:var(--ph-dim);border-bottom:1px solid #11331f;font-size:10px}
.diff .ln{padding:1px 9px;white-space:pre;font-size:10.5px;overflow:hidden;text-overflow:ellipsis}
.diff .del{background:var(--ph-del-bg);color:var(--ph-del)}
.diff .add{background:var(--ph-add-bg);color:var(--ph-add)}
.tui-status{
margin-top:13px;border-top:1px solid #11331f;padding-top:9px;
font-size:10px;color:var(--ph-dim);display:flex;align-items:center;gap:8px;flex-wrap:wrap;
}
.tcur{display:inline-block;width:7px;height:12px;background:var(--ph-add);vertical-align:-2px;animation:blink 1s steps(1) infinite}
@keyframes blink{50%{opacity:0}}
@media(max-width:720px){
.tui-grid{grid-template-columns:1fr}
.tui .side{display:none}
.diff .ln{font-size:11px}
}
/* ─── LORE / ON THE NAME ────────────────────────────────────── */
.lore{
max-width:var(--maxw);margin:0 auto;
padding:72px var(--pad);
border-top:1px solid var(--border);
}
.lore-body{
max-width:740px;
font-size:18px;line-height:1.78;color:var(--fg-dim);
text-wrap:pretty;
padding-left:22px;
border-left:2px solid var(--green);
}
.lore-body .lead{
display:block;color:var(--fg-hi);font-weight:600;
font-size:22px;line-height:1.4;letter-spacing:-0.01em;
margin-bottom:18px;text-wrap:balance;
}
.lore-body em{color:var(--green);font-style:normal}
@media(max-width:500px){
.lore-body{font-size:16px;padding-left:16px}
.lore-body .lead{font-size:19px}
}
/* ─── FEATURES ──────────────────────────────────────────────── */
.feat-grid{
display:grid;grid-template-columns:repeat(3,1fr);
border-top:1px solid var(--border);
border-left:1px solid var(--border);
border-radius:6px;overflow:hidden;
}
.feat{
padding:26px 22px;
border-right:1px solid var(--border);
border-bottom:1px solid var(--border);
transition:background 0.2s;
}
.feat:hover{background:var(--bg2)}
.feat h3{font-size:15px;font-weight:600;letter-spacing:0.01em;color:var(--fg-hi);margin-bottom:7px}
.feat p{font-size:13px;line-height:1.55;color:var(--fg-dim)}
/* ─── INSTALL TABS ─────────────────────────────────────────── */
.tabs{display:inline-flex;border:1px solid var(--border);border-radius:6px;margin-bottom:14px;overflow:hidden}
.tabs button{
background:transparent;border:none;border-right:1px solid var(--border);
padding:9px 15px;font-family:var(--mono);font-size:11px;
color:var(--fg-dim);cursor:pointer;letter-spacing:0.08em;
text-transform:uppercase;transition:all 0.15s;
}
.tabs button:last-child{border-right:0}
.tabs button.on{color:#fff;background:var(--green-dim)}
.tabs button:hover:not(.on){color:var(--fg-hi);background:var(--bg2)}
.code-block{
background:var(--t-panel);border:1px solid var(--border);
font-family:var(--mono);font-size:13px;overflow:hidden;
max-width:700px;border-radius:6px;
}
.code-head{
display:flex;align-items:center;padding:8px 14px;
border-bottom:1px solid #21262d;background:var(--t-head);
font-size:10px;color:var(--t-mute);letter-spacing:0.08em;
}
.code-body{
margin:0;padding:14px 16px;white-space:pre-wrap;
word-break:break-all;color:var(--t-fg);line-height:1.7;overflow-x:auto;
}
.code-body .p{color:var(--t-blue)}
.code-body .c{color:var(--t-mute)}
.code-body .f{color:var(--t-blue2)}
.code-body .s{color:var(--t-green)}
/* ─── CARDS GRID ───────────────────────────────────────────── */
.card-grid{
display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));
gap:1px;background:var(--border);border:1px solid var(--border);
border-radius:6px;overflow:hidden;
}
/* Fixed-column variant for grids whose card count divides evenly,
so no empty cells show the gap background. */
.card-grid.g3{grid-template-columns:repeat(3,1fr)}
.card{
background:var(--bg);padding:18px 16px;transition:background 0.15s;
}
.card:hover{background:var(--bg2)}
.card h4{font-size:14px;font-weight:600;color:var(--fg-hi);margin-bottom:4px;font-family:var(--mono)}
.card p{font-size:12.5px;color:var(--fg-dim);line-height:1.5}
.card p code{font-size:0.92em;background:none;border:0;padding:0;color:var(--accent2)}
/* ─── TWO-COLUMN ───────────────────────────────────────────── */
.col2{
display:grid;grid-template-columns:220px 1fr;
gap:36px;align-items:start;margin-top:12px;
}
.col2-side{
display:flex;flex-direction:column;
border-top:1px solid var(--border);
}
.col2-tab{
display:flex;align-items:baseline;gap:12px;
padding:16px 0;background:none;border:none;
border-bottom:1px solid var(--border);
cursor:pointer;transition:all 0.15s;
color:var(--fg-dim);font-size:14px;
text-align:left;
}
.col2-tab:hover{color:var(--fg-hi);background:var(--bg2)}
.col2-tab.on{color:var(--fg-hi)}
.col2-tab .idx{font-size:10px;color:var(--fg-mute);letter-spacing:0.08em;flex-shrink:0;width:24px;font-family:var(--mono)}
.col2-tab.on .idx{color:var(--green)}
.col2-content{padding:4px 0 0}
.col2-content h3{font-size:22px;font-weight:700;color:var(--fg-hi);margin-bottom:12px}
.col2-content p{color:var(--fg-dim);font-size:14px;line-height:1.65;margin-bottom:14px}
/* ─── FAQ ───────────────────────────────────────────────────── */
.faq{border-top:1px solid var(--border)}
.faq-q{
display:flex;align-items:baseline;gap:14px;
padding:18px 0;cursor:pointer;
border-bottom:1px solid var(--border);
color:var(--fg-hi);font-size:15px;font-weight:600;
letter-spacing:0.01em;transition:color 0.2s;
}
.faq-q:hover{color:var(--accent)}
.faq-q .qm{color:var(--accent);font-weight:700;flex-shrink:0}
.faq-q .chev{margin-left:auto;transition:transform 0.25s;color:var(--fg-mute);flex-shrink:0}
.faq-q.open .chev{transform:rotate(180deg)}
.faq-a{
max-height:0;overflow:hidden;transition:max-height 0.3s ease,padding 0.3s ease;
padding:0 0 0 32px;color:var(--fg-dim);font-size:14px;line-height:1.65;
}
.faq-a.open{max-height:520px;padding:0 0 18px 32px}
.faq-a code{font-size:0.9em}
.faq-a b{color:var(--fg-hi)}
/* ─── FOOTER ────────────────────────────────────────────────── */
.foot{
border-top:1px solid var(--border);
padding:56px 0 28px;background:var(--bg2);
}
.foot-inner{
max-width:var(--maxw);margin:0 auto;padding:0 var(--pad);
display:grid;grid-template-columns:2fr 1fr 1fr 1fr;gap:36px;
}
.foot h5{font-size:10px;letter-spacing:0.14em;text-transform:uppercase;color:var(--fg-mute);margin-bottom:12px;font-weight:600;font-family:var(--mono)}
.foot ul{list-style:none;display:flex;flex-direction:column;gap:6px}
.foot a{color:var(--fg-dim);text-decoration:none;font-size:13px;transition:color 0.18s}
.foot a:hover{color:var(--fg-hi);text-decoration:none}
.foot-bot{
max-width:var(--maxw);margin:44px auto 0;padding:20px var(--pad) 0;
border-top:1px solid var(--border);
display:flex;align-items:center;gap:14px;
font-size:11px;color:var(--fg-mute);letter-spacing:0.06em;
}
.foot-bot .sp{flex:1}
/* ─── RESPONSIVE ────────────────────────────────────────────── */
@media(max-width:780px){
.feat-grid{grid-template-columns:1fr 1fr}
.card-grid.g3{grid-template-columns:1fr 1fr}
.hero-stats{grid-template-columns:repeat(2,1fr)}
.col2{grid-template-columns:1fr;gap:12px}
.col2-side{flex-direction:row;flex-wrap:wrap;border-top:0}
.col2-tab{border-right:1px solid var(--border);padding:10px 14px;font-size:12px}
.col2-tab .idx{display:none}
.foot-inner{grid-template-columns:1fr 1fr}
.nav-links{display:none}
}
@media(max-width:500px){
.feat-grid{grid-template-columns:1fr}
.card-grid,.card-grid.g3{grid-template-columns:1fr}
.hero-stats{grid-template-columns:1fr 1fr}
.foot-inner{grid-template-columns:1fr}
}
pre{margin:0}
</style>
</head>
<body>
<!-- ═══ NAV ═══ -->
<nav class="nav">
<div class="nav-inner">
<a href="#" class="brand"><span class="brand-mark">▸</span>dirge<span class="brand-ver">v0.21.14</span></a>
<div class="nav-links">
<a href="#features">Features</a>
<a href="#install">Install</a>
<a href="#plugins">Plugins</a>
<a href="#config">Config</a>
<a href="#faq">FAQ</a>
</div>
<div class="nav-right">
<a href="https://github.com/dirge-code/dirge" class="gh-star" aria-label="Star dirge-code/dirge on GitHub">
<span class="gh-star-btn">
<svg viewBox="0 0 16 16" aria-hidden="true"><path d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.751.751 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25Z"/></svg>
Star
</span>
<span class="gh-star-count" id="ghStars"></span>
</a>
</div>
</div>
</nav>
<!-- ═══ HERO ═══ -->
<section class="hero sec">
<div class="hero-top">
<img class="hero-logo" src="img/dirge.png" width="500" height="500"
alt="dirge logo" decoding="async">
<div class="hero-intro">
<div class="hero-tag">GPL-3.0 · Rust · <b>on crates.io</b></div>
<h1><em>dirge</em> — The Batteries-Included<br>Rust Coding Agent</h1>
<p class="lede">
Everything on by default — <b>MCP, LSP, ACP</b>, a <b>Janet plugin system</b>,
tree-sitter <b>code intelligence</b>, and <b>self-improving memory</b>. Yet it's
native Rust: <b>~8 MB RAM</b> idle, <b>~36 MB binary</b>, no runtime.
And an agent loop built to keep even small, cheap models on the rails.
</p>
<div class="hero-act">
<a href="#install" class="btn btn-pri">▸ Get started</a>
<a href="https://github.com/dirge-code/dirge" class="btn btn-gh">→ View on GitHub</a>
</div>
</div><!-- /hero-intro -->
</div><!-- /hero-top -->
<div class="hero-stats">
<div class="hs"><b>8MB</b><span>RAM idle</span></div>
<div class="hs"><b>36MB</b><span>Binary size</span></div>
<div class="hs"><b>25+</b><span>Built-in tools</span></div>
<div class="hs"><b>8</b><span>Providers</span></div>
</div>
<!-- dirge's actual TUI (phosphor theme), recreated in CSS -->
<div class="tui-win">
<div class="tui-bar">
<span class="dots"><i></i><i></i><i></i></span>
<span class="t">dirge — ~/src/voxel</span>
</div>
<div class="tui">
<div class="tui-grid">
<!-- LEFT -->
<div class="tui-col side lcol">
<div class="pnl">
<span class="pl">CONTEXT</span>
<p>ctx [██░░░░░░░░] 1%</p>
<p>11.5k / 1.0M · cmp:0</p>
</div>
<div class="pnl">
<span class="pl">ACTIVITY</span>
<p><span class="tl">edit</span> voxel.cljs</p>
<p><span class="tl">read</span> voxel.cljs</p>
<p><span class="tl">skill</span> paren-check</p>
<p><span class="tl">bash</span> cd …/voxel</p>
</div>
</div>
<!-- CENTER -->
<div class="tui-col">
<div class="pnl log">
<span class="pl">AGENT LOG STREAM</span>
<p><span class="h-you"><you></span> add FPS-style mouse-look + wheel height to <span class="cy">voxel.cljs</span></p>
<p><span class="h-dirge"><dirge></span> <span class="brt">Here's the plan:</span></p>
<p class="step">1. add <span class="cy">:mouseX</span>/<span class="cy">:mouseY</span> delta fields to <span class="cy">input</span></p>
<p class="step">2. mousemove + wheel listeners (pointer lock)</p>
<p class="step">3. consume deltas in <span class="cy">update-camera</span>, reset per frame</p>
<div class="diff">
<div class="dh"><span class="tl">BASH</span> · clojure -M:dev -e "(require 'voxel)"</div>
<div class="ln"><span class="ok">✓ compiled — 0 warnings</span></div>
</div>
<div class="diff">
<div class="dh"><span class="tl">EDIT</span> — voxel.cljs <span class="ok">(+2 lines, validated)</span></div>
<div class="ln del">- :lookUp false})</div>
<div class="ln add">+ :lookUp false</div>
<div class="ln add">+ :mouseX 0.0</div>
<div class="ln add">+ :mouseY 0.0})</div>
</div>
<p><span class="h-critic"><critic></span> <span class="dimt">deltas reset each frame ✓ — looks complete</span></p>
</div>
</div>
<!-- RIGHT -->
<div class="tui-col side rcol">
<div class="pnl">
<span class="pl">SYSTEM LOAD</span>
<p>CPU [██░░░░░░] 24%</p>
<p>MEM [████░░░░] 55%</p>
</div>
<div class="pnl">
<span class="pl">MCP</span>
<p><span class="ok">●</span> chiasmus</p>
<p><span class="ok">●</span> rlm</p>
<p><span class="ok">●</span> wavescope</p>
<p><span class="ok">●</span> lattice</p>
</div>
<div class="pnl">
<span class="pl">LSP</span>
<p><span class="ok">●</span> clojure-lsp</p>
</div>
<div class="pnl">
<span class="pl">TODOS</span>
<p><span class="ok">✓</span> input delta fields</p>
<p><span class="amb">▸</span> pointer-lock listeners</p>
<p><span class="dimt">○</span> minimap overlay</p>
</div>
<div class="pnl">
<span class="pl">MODIFIED</span>
<p>voxel.cljs</p>
</div>
</div>
</div>
<div class="tui-input">
<div class="tui-face">[$_$]</div>
<div class="tui-field"><span class="brt">░▌</span> add a minimap overlay to the HUD<span class="tcur"></span></div>
</div>
<div class="tui-status">
<span>voxel:main</span><span class="dimt">·</span>
<span>deepseek-v4-pro</span><span class="dimt">·</span>
<span>11k/1.0M (1%)</span><span class="dimt">·</span>
<span>3 msgs</span><span class="dimt">·</span>
<span>code</span><span class="dimt">·</span>
<span class="brt">running</span>
</div>
</div>
</div>
</section>
<!-- ═══ ON THE NAME ═══ -->
<section class="lore">
<div class="sec-eyebrow"><span class="dash">[*]</span> ON THE NAME <span class="rule"></span></div>
<p class="lore-body">
<span class="lead">A dirge is a song to keep the dead from losing their way.</span>
It turns grief into something that is remembered. Agents are like mayflies
awoken for a moment to work and to forget, with every new session effacing
the old one. Dirge keeps watch over things said and done, always folding
context <em>into memory</em> to carry past mistakes and preferences across
the gulf between sessions. It sings the past forward, so that no grave need
be dug twice. Dirge grieves for nothing, since nothing is truly buried under
its care, and its lament is a promise that what was built here once will be
<em>remembered</em>.
</p>
</section>
<!-- ═══ FEATURES ═══ -->
<section class="sec" id="features">
<div class="sec-eyebrow"><span class="dash">[*]</span> WHY DIRGE <span class="rule"></span></div>
<h2 class="sec-title">Small footprint, <em>serious</em> reliability</h2>
<p class="sec-lede">
Native Rust, no runtime — and an agent loop engineered so cheaper models
stay productive instead of derailing.
</p>
<div class="feat-grid">
<div class="feat">
<h3>Terminal-First TUI</h3>
<p>ratatui + crossterm. Live token streaming, a branching session tree, and configurable info panes via <code>/display</code> — all keyboard-driven.</p>
</div>
<div class="feat">
<h3>Robust Agent Loop</h3>
<p>Repairs malformed tool calls, validates every write through tree-sitter before it hits disk, breaks repeat-loops, and — when a model keeps failing — injects a recovery checkpoint, suggests the tool/path it likely meant, then escalates to a stronger model.</p>
</div>
<div class="feat">
<h3>One Permission Engine</h3>
<p>A single Policy Decision Point with four modes, op-based rules, and session allowlists. The <code>/why</code> command traces exactly which policy decided — and why.</p>
</div>
<div class="feat">
<h3>Role-Based Routing</h3>
<p>Point the main loop, review, escalation, summarization, and subagent roles at different models. Mix DeepSeek, GLM, Anthropic, OpenAI, and Ollama in one session.</p>
</div>
<div class="feat">
<h3>Self-Improving Memory</h3>
<p>Two-tier per-project memory — hot facts inline, the rest a searchable breadcrumb index — plus a global cross-project tier for durable preferences, injected as a cache-stable snapshot. Reusable skills share the same salience engine: <code>/learn</code> distills one from any source or the current session, and the curator prunes on proven usefulness — decay plus a success/failure record — not just age.</p>
</div>
<div class="feat">
<h3>Built-In Issue Board</h3>
<p>A persistent, agent-facing kanban in the session DB — a stateful extension of the memory model. The harness surfaces the top open issues at the <em>start of every turn</em>, so the agent works its backlog without polling a tracker. The <code>issue</code> tool manages it (create / start / close, priorities, cross-session); <code>/issues</code> views it. SQLite rows, no external tracker.</p>
</div>
<div class="feat">
<h3>Long-Horizon Sessions</h3>
<p>Durable, incrementally-refreshed checkpoints anchored to a stable identity — so resuming a long, compacted session recovers its live state instead of a stale snapshot. Hold autonomous runs to a natural-language stop condition with <code>--goal</code>. Adapted from <a href="https://github.com/XiaomiMiMo/MiMo-Code">MiMo-Code</a>.</p>
</div>
<div class="feat">
<h3>Code Intelligence</h3>
<p>Tree-sitter semantic tools and inline LSP diagnostics for 10+ languages — surfaced in tool output so the agent fixes compile errors on the same turn.</p>
</div>
<div class="feat">
<h3>Extensible at Runtime</h3>
<p>A <a href="https://janet-lang.org">Janet</a> plugin system hooks the full lifecycle — intercept tools, rewrite prompts, register commands — plus Claude-compatible skills loaded on demand and grown from any source with <code>/learn</code>.</p>
</div>
<div class="feat">
<h3>MCP & ACP</h3>
<p>Connect MCP servers for extra tools — or run <code>dirge mcp</code> to <em>be</em> one, so another agent (e.g. Claude Code) delegates implementation tasks to dirge and reviews them. ACP for editor integration with Zed.</p>
</div>
<div class="feat">
<h3>Sandbox Mode</h3>
<p>Run every bash command in isolation with <code>--sandbox</code>: <a href="https://github.com/containers/bubblewrap">bubblewrap</a> for a namespaced jail, or a hardware-isolated <a href="https://github.com/containers/libkrun">libkrun</a> microVM — defense in depth on top of the permission engine.</p>
</div>
<div class="feat">
<h3>Phased Planning</h3>
<p>An opt-in <code>/plan</code> workflow runs <b>explore → plan → implement → review</b> as context-isolated phases: a read-only agent maps the code, a second drafts the plan, then a write-disabled reviewer <em>runs the code</em> and feeds gaps back for a bounded retry.</p>
</div>
<div class="feat">
<h3>Diff-Aware Code Review</h3>
<p>As agents write code, a reviewer reads the <em>actual diff</em> — not just the transcript — in two passes (review, then verify to drop false positives). <b>High/critical</b> findings block the loop until fixed or justified; <b>medium/low</b> surface as advisories. Run it any time with <code>/code-review</code>. Reuses the critic's judge, so it's one opt-in with no cost when off.</p>
</div>
<div class="feat">
<h3>Spec-Driven Workflow</h3>
<p>Align on <em>what</em> before <em>how</em>. The <code>spec</code> tool tracks changes — proposal, requirement deltas, and a task checklist with real status — as <b>SQLite rows, not markdown</b>; living specs are the current truth, and archiving folds a change's deltas into them transactionally. The active change is injected into context; archiving forms a memory. Inspired by <a href="https://github.com/Fission-AI/OpenSpec">OpenSpec</a>.</p>
</div>
<div class="feat">
<h3>Token-Efficient I/O</h3>
<p>Tree-sitter <code>read_minified</code>/<code>edit_minified</code> collapse files to their skeleton; a hard read-before-edit gate blocks blind edits; and oversized <code>bash</code>/<code>webfetch</code> output is relayed to disk with a head+tail summary so the context window stays lean.</p>
</div>
<div class="feat">
<h3>Step-Through Debugging</h3>
<p>A built-in Debug Adapter Protocol client drives real debuggers — set breakpoints, step, inspect stacks and variables — straight from the agent loop and Janet plugins (<code>debug</code> tool, <code>dap/*</code> bindings).</p>
</div>
<div class="feat">
<h3>Vision & Image Paste</h3>
<p>Paste a clipboard image into the prompt with <code>Ctrl+V</code> and send it to a vision model — turns are multipart, interleaving text and pictures. Images live out-of-line in the session's <code>assets/</code> dir and are re-read at the provider boundary each turn, so transcripts stay small. Gated by provider/model vision support, with a <code>multimodal</code> override for local models like Ollama <code>llama3.2-vision</code>.</p>
</div>
</div>
</section>
<!-- ═══ INSTALL ═══ -->
<section class="sec" id="install">
<div class="sec-eyebrow"><span class="dash">[*]</span> GET STARTED <span class="rule"></span></div>
<h2 class="sec-title"><em>Install</em> from crates.io in one line</h2>
<p class="sec-lede">
The crate is published as <code>dirge-agent</code> (the short name was taken);
the installed command is still <code>dirge</code>. Set an API key and start coding.
</p>
<div class="tabs" id="tabs">
<button class="on" data-t="cargo">cargo</button>
<button data-t="homebrew">homebrew</button>
<button data-t="source">from source</button>
<button data-t="apikey">API key</button>
<button data-t="usage">usage</button>
</div>
<div id="tab-cargo" class="code-block">
<div class="code-head">▸ install</div>
<pre class="code-body"><span class="c"># Batteries included — MCP, LSP, ACP, plugins, and every</span>
<span class="c"># tree-sitter language are on by default.</span>
<span class="p">$</span> cargo install dirge-agent
<span class="c"># Leaner build — opt out of defaults, pick what you need:</span>
<span class="p">$</span> cargo install dirge-agent <span class="f">--no-default-features</span> \
<span class="f">--features</span> <span class="s">"loop,git-worktree,mcp,lsp,semantic-rust"</span></pre>
</div>
<div id="tab-homebrew" class="code-block" style="display:none">
<div class="code-head">▸ install with homebrew (macOS & Linux)</div>
<pre class="code-body"><span class="c"># Prebuilt binary — no Rust toolchain needed.</span>
<span class="p">$</span> brew install <span class="s">dirge-code/dirge/dirge</span>
<span class="c"># Or tap once, then install / upgrade by short name:</span>
<span class="p">$</span> brew tap <span class="s">dirge-code/dirge</span>
<span class="p">$</span> brew install dirge
<span class="p">$</span> brew upgrade dirge
<span class="c"># On macOS this skips the Gatekeeper quarantine prompt you'd</span>
<span class="c"># hit from a downloaded tarball.</span></pre>
</div>
<div id="tab-source" class="code-block" style="display:none">
<div class="code-head">▸ build from source</div>
<pre class="code-body"><span class="c"># Clone the repo</span>
<span class="p">$</span> git clone https://github.com/dirge-code/dirge
<span class="p">$</span> <span class="f">cd</span> dirge
<span class="c"># Release build (all default features)</span>
<span class="p">$</span> cargo build <span class="f">--release</span>
<span class="p">$</span> ./target/release/dirge</pre>
</div>
<div id="tab-apikey" class="code-block" style="display:none">
<div class="code-head">▸ set API key (auto-detected by provider)</div>
<pre class="code-body"><span class="c"># OpenRouter (default provider)</span>
<span class="p">$</span> <span class="f">export</span> <span class="s">OPENROUTER_API_KEY</span>=sk-or-...
<span class="c"># Or any provider:</span>
<span class="p">$</span> <span class="f">export</span> <span class="s">ANTHROPIC_API_KEY</span>=sk-ant-...
<span class="p">$</span> <span class="f">export</span> <span class="s">OPENAI_API_KEY</span>=sk-...
<span class="p">$</span> <span class="f">export</span> <span class="s">DEEPSEEK_API_KEY</span>=sk-...
<span class="c"># Or pass directly:</span>
<span class="p">$</span> dirge <span class="f">--api-key</span> sk-...</pre>
</div>
<div id="tab-usage" class="code-block" style="display:none">
<div class="code-head">▸ run modes</div>
<pre class="code-body"><span class="c"># Interactive TUI (default)</span>
<span class="p">$</span> dirge
<span class="c"># One-shot: run and print to stdout</span>
<span class="p">$</span> dirge <span class="f">-p</span> <span class="s">"explain this codebase"</span>
<span class="c"># Headless iterative loop</span>
<span class="p">$</span> dirge <span class="f">--loop</span> <span class="s">"refactor auth module"</span>
<span class="c"># Resume last session</span>
<span class="p">$</span> dirge <span class="f">-c</span>
<span class="c"># Sandbox every bash command (needs bubblewrap)</span>
<span class="p">$</span> dirge <span class="f">--sandbox</span>
<span class="c"># Restrictive mode (prompt every tool)</span>
<span class="p">$</span> dirge <span class="f">-R</span>
<span class="c"># MCP server: let another agent delegate tasks to dirge</span>
<span class="p">$</span> dirge <span class="f">mcp</span></pre>
</div>
</section>
<!-- ═══ PROVIDERS ═══ -->
<section class="sec">
<div class="sec-eyebrow"><span class="dash">[*]</span> PROVIDERS <span class="rule"></span></div>
<h2 class="sec-title">Bring your <em>own model</em></h2>
<p class="sec-lede">Works with all major providers, and any OpenAI-compatible endpoint. OpenRouter is the default — no setup for most. Switch with <code>/model</code>.</p>
<div class="card-grid">
<div class="card"><h4>OpenAI</h4><p>GPT-4o · o-series</p></div>
<div class="card"><h4>Anthropic</h4><p>Claude Sonnet · Opus</p></div>
<div class="card"><h4>DeepSeek</h4><p>V4 Pro · R1 · V3</p></div>
<div class="card"><h4>Gemini</h4><p>2.5 Pro · 2.0 Flash</p></div>
<div class="card"><h4>Ollama</h4><p>Llama · Qwen · Mistral</p></div>
<div class="card"><h4>OpenRouter</h4><p>Default · 200+ models</p></div>
<div class="card"><h4>GLM</h4><p>GLM-4 · ZhipuAI</p></div>
<div class="card"><h4>Custom</h4><p>Any OpenAI-compatible endpoint</p></div>
</div>
</section>
<!-- ═══ TOOLS ═══ -->
<section class="sec">
<div class="sec-eyebrow"><span class="dash">[*]</span> TOOLS <span class="rule"></span></div>
<h2 class="sec-title">25+ <em>built-in</em> tools</h2>
<p class="sec-lede">Everything the agent needs — files, shell, search, code intelligence, and delegation — with zero configuration.</p>
<div class="card-grid g3">
<div class="card"><h4>Files & edits</h4><p><code>read</code> · <code>write</code> · <code>edit</code> · <code>apply_patch</code> · <code>list_dir</code> · <code>find_files</code></p></div>
<div class="card"><h4>Shell</h4><p><code>bash</code> · <code>bash_output</code> · <code>kill_shell</code> — foreground & background</p></div>
<div class="card"><h4>Search</h4><p><code>grep</code> · <code>glob</code> · <code>session_search</code></p></div>
<div class="card"><h4>Web</h4><p><code>webfetch</code> · <code>websearch</code></p></div>
<div class="card"><h4>Code intelligence</h4><p><code>list_symbols</code> · <code>get_symbol_body</code> · <code>find_callers</code> · <code>find_callees</code> · <code>find_definition</code> · <code>lsp</code> · <code>repo_overview</code></p></div>
<div class="card"><h4>Agent & memory</h4><p><code>task</code> · <code>task_status</code> · <code>write_todo_list</code> · <code>memory</code> · <code>skill</code> · <code>spec</code> · <code>question</code></p></div>
<div class="card"><h4>Token-efficient I/O</h4><p><code>read_minified</code> · <code>edit_minified</code> — collapse a file to its tree-sitter skeleton</p></div>
<div class="card"><h4>Debugging</h4><p><code>debug</code> — DAP step-through: breakpoints, step, inspect stacks & variables</p></div>
<div class="card"><h4>Dynamic discovery</h4><p><code>tool_search</code> — load tools on demand to keep the prompt lean</p></div>
</div>
</section>
<!-- ═══ SLASH COMMANDS ═══ -->
<section class="sec">
<div class="sec-eyebrow"><span class="dash">[*]</span> COMMANDS <span class="rule"></span></div>
<h2 class="sec-title">Drive it with <em>slash</em> commands</h2>
<p class="sec-lede">Control the agent from the TUI — switch models, manage sessions, inspect decisions. Type <code>/help</code> for the full list.</p>
<div class="card-grid">
<div class="card"><h4>/model</h4><p>Show or switch LLM model</p></div>
<div class="card"><h4>/agent</h4><p>Switch the active agent profile</p></div>
<div class="card"><h4>/prompt</h4><p>List or activate system prompts</p></div>
<div class="card"><h4>/plan</h4><p>Run the phased plan workflow</p></div>
<div class="card"><h4>/code-review</h4><p>Review the working-tree diff for issues</p></div>
<div class="card"><h4>/mode</h4><p>Set security permission mode</p></div>
<div class="card"><h4>/why</h4><p>Trace the last permission decision</p></div>
<div class="card"><h4>/allow</h4><p>Manage the session allowlist</p></div>
<div class="card"><h4>/sandbox</h4><p>Inspect & control bash sandboxing</p></div>
<div class="card"><h4>/display</h4><p>Pick visible info panes</p></div>
<div class="card"><h4>/panel</h4><p>Toggle the side gutters</p></div>
<div class="card"><h4>/compress</h4><p>Compact history for context</p></div>
<div class="card"><h4>/sessions</h4><p>List, save, load sessions</p></div>
<div class="card"><h4>/issues</h4><p>View the native issue board</p></div>
<div class="card"><h4>/tree</h4><p>Show session branch tree</p></div>
<div class="card"><h4>/fork</h4><p>Branch the conversation</p></div>
<div class="card"><h4>/loop</h4><p>Start an iterative coding loop</p></div>
<div class="card"><h4>/tasks</h4><p>List background shells & agents</p></div>
<div class="card"><h4>/spec</h4><p>Inspect spec changes & living specs</p></div>
<div class="card"><h4>/mcp</h4><p>List MCP servers and tools</p></div>
<div class="card"><h4>/worktree</h4><p>Create a git worktree</p></div>
<div class="card"><h4>/plugins</h4><p>List loaded Janet plugins</p></div>
<div class="card"><h4>/reasoning</h4><p>Toggle reasoning visibility</p></div>
<div class="card"><h4>/btw</h4><p>Quick question (no tools)</p></div>
<div class="card"><h4>/help</h4><p>Show all commands</p></div>
</div>
</section>
<!-- ═══ PLUGINS ═══ -->
<section class="sec" id="plugins">
<div class="sec-eyebrow"><span class="dash">[*]</span> PLUGINS <span class="rule"></span></div>
<h2 class="sec-title"><em>Plugin</em> system in Janet</h2>
<p class="sec-lede">
dirge embeds <a href="https://janet-lang.org">Janet</a>
as a plugin language. Plugins are small scripts that hook into the agent loop,
intercept tools, rewrite prompts, register slash commands, gate execution, and
drive session navigation — all from a few lines of Lisp.
</p>
<div class="col2" id="pluginCols">
<div class="col2-side">
<button class="col2-tab on" data-pl="quickstart"><span class="idx">01</span> Quickstart</button>
<button class="col2-tab" data-pl="hooks"><span class="idx">02</span> Hook Reference</button>
<button class="col2-tab" data-pl="tool-interception"><span class="idx">03</span> Tool Interception</button>
<button class="col2-tab" data-pl="custom-tools"><span class="idx">04</span> Custom Tools</button>
<button class="col2-tab" data-pl="commands-shortcuts"><span class="idx">05</span> Commands & Keys</button>
<button class="col2-tab" data-pl="providers"><span class="idx">06</span> Custom Providers</button>
<button class="col2-tab" data-pl="dialogs"><span class="idx">07</span> User Dialogs</button>
<button class="col2-tab" data-pl="renderers"><span class="idx">08</span> Renderers</button>
</div>
<div class="col2-content">
<!-- Quickstart -->
<div data-plc="quickstart">
<h3>Your first plugin</h3>
<p>
Plugins live in <code>~/.config/dirge/plugins/</code> (global)
or <code>./.dirge/plugins/</code> (project-local).
A plugin is a single <code>.janet</code> file — no boilerplate, no exports required.
</p>
<div class="code-block">
<div class="code-head">~/.config/dirge/plugins/hello.janet</div>
<pre class="code-body"><span class="c">;; Every time the user sends a prompt, print a line</span>
<span class="p">(defn</span> on-prompt [ctx]
(<span class="s">harness/notify</span> (<span class="s">string</span> <span class="s">"user said: "</span> (ctx <span class="s">:prompt</span>)) <span class="s">:info</span>))</pre>
</div>
<p style="margin-top:10px">
That's it. Restart dirge, type a message, and the notification appears in chat.
The plugin system is on by default.
</p>
<p style="margin-top:8px">
<b>Multi-file plugins:</b> create a directory of <code>.janet</code> files that share
one Janet environment and load in alphabetical order. Name files
<code>00-state.janet</code>, <code>01-hooks.janet</code> to control load order.
</p>
</div>
<!-- Hooks -->
<div data-plc="hooks" style="display:none">
<h3>Hook reference</h3>
<p>
Every hook takes a <code>ctx</code> table and returns nil or a string.
Define them as top-level functions in your plugin file.
</p>
<div class="card-grid" style="grid-template-columns:1fr;max-width:640px">
<div class="card"><h4>on-init</h4><p>Once at session start. ctx: model, cwd, provider.</p></div>
<div class="card"><h4>on-prompt</h4><p>After user submits, before LLM call. Use <code>harness/replace-prompt</code> to rewrite.</p></div>
<div class="card"><h4>on-turn-start</h4><p>Start of one LLM call cycle. ctx: index.</p></div>