-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocs.html
More file actions
1204 lines (1150 loc) · 49 KB
/
Copy pathdocs.html
File metadata and controls
1204 lines (1150 loc) · 49 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.0" />
<title>Thoth CLI Reference v1.0.0</title>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Geist+Mono:wght@300;400;500&family=Instrument+Sans:ital,wght@0,400;0,500;1,400&display=swap"
rel="stylesheet" />
<link rel="stylesheet" href="css/variables.css" />
<link rel="stylesheet" href="css/reset.css" />
<link rel="stylesheet" href="css/base.css" />
<link rel="stylesheet" href="css/nav.css" />
<link rel="stylesheet" href="css/footer.css" />
<link rel="stylesheet" href="css/docs.css" />
<link rel="stylesheet" href="css/animations.css" />
</head>
<body>
<div class="cursor" id="cursor"></div>
<div class="cursor-ring" id="cursor-ring"></div>
<header class="nav" id="site-nav">
<div class="nav__inner">
<div class="nav__left">
<a href="index.html" class="nav__logo"><span class="nav__logo-accent">T</span>hoth</a>
<nav class="nav__links">
<a href="index.html" class="nav__link">Landing</a>
<a href="docs.html" class="nav__link active">Docs</a>
</nav>
</div>
<a href="index.html" class="nav__cta">Get Started <span class="nav__cta-arrow">›</span></a>
<button class="mobile-trigger" id="mobile-trigger" aria-label="Menu">
<span class="mobile-trigger__icon"><span></span><span></span><span></span></span>
</button>
</div>
</header>
<div class="mobile-scrim" id="mobile-scrim"></div>
<div class="mobile-drawer" id="mobile-drawer">
<div class="mobile-drawer__header">
<span class="mobile-drawer__logo">Thoth</span>
<button class="mobile-drawer__close" id="mobile-drawer-close">✕</button>
</div>
<nav class="mobile-drawer__nav">
<a href="index.html" class="mobile-drawer__link">
<span class="mobile-drawer__link-marker"></span> Home
</a>
<a href="index.html#how" class="mobile-drawer__link">
<span class="mobile-drawer__link-marker"></span> How it Works
</a>
<a href="index.html#privacy" class="mobile-drawer__link">
<span class="mobile-drawer__link-marker"></span> Privacy
</a>
<a href="docs.html" class="mobile-drawer__link">
<span class="mobile-drawer__link-marker"></span> Docs
</a>
</nav>
</div>
<div class="docs-layout">
<aside class="docs-sidebar" id="sidebar">
<nav class="sidebar-nav">
<a href="#overview" class="sidebar-link">Overview</a>
<a href="#installation" class="sidebar-link">Installation</a>
<a href="#global-options" class="sidebar-link">Global Options</a>
<a href="#configuration" class="sidebar-link">Configuration</a>
<a href="#ai-providers" class="sidebar-link">AI Providers</a>
<span class="sidebar-heading">Commands</span>
<a href="#cmd-init" class="sidebar-link sidebar-link--sub">init</a>
<a href="#cmd-import-voice" class="sidebar-link sidebar-link--sub">import_voice</a>
<a href="#cmd-import-knowledge" class="sidebar-link sidebar-link--sub">import_knowledge</a>
<a href="#cmd-import-publications" class="sidebar-link sidebar-link--sub">import_publications</a>
<a href="#cmd-generate-profile" class="sidebar-link sidebar-link--sub">generate_profile</a>
<a href="#cmd-profile-status" class="sidebar-link sidebar-link--sub">profile_status</a>
<a href="#cmd-research" class="sidebar-link sidebar-link--sub">research</a>
<a href="#cmd-generate-article" class="sidebar-link sidebar-link--sub">generate_article</a>
<a href="#cmd-list-articles" class="sidebar-link sidebar-link--sub">list_articles</a>
<a href="#cmd-get-article" class="sidebar-link sidebar-link--sub">get_article</a>
<a href="#cmd-create-series" class="sidebar-link sidebar-link--sub">create_series</a>
<a href="#cmd-list-series" class="sidebar-link sidebar-link--sub">list_series</a>
<a href="#cmd-add-to-series" class="sidebar-link sidebar-link--sub">add_to_series</a>
<a href="#cmd-get-series" class="sidebar-link sidebar-link--sub">get_series</a>
<a href="#cmd-export-article" class="sidebar-link sidebar-link--sub">export_article</a>
<a href="#cmd-export-series" class="sidebar-link sidebar-link--sub">export_series</a>
<span class="sidebar-heading">Reference</span>
<a href="#workflows" class="sidebar-link">Workflows</a>
<a href="#domain-entities" class="sidebar-link">Domain Entities</a>
<a href="#system-details" class="sidebar-link">System Details</a>
</nav>
</aside>
<main class="docs-content">
<section id="overview" class="reveal">
<h1 class="doc-title">CLI Reference <span class="doc-version">v1.0.0</span></h1>
<p class="doc-subtitle">
Identity Preserving Publishing Engine generate articles and series in your authentic
voice using AI.
</p>
<div class="doc-install">
<span class="doc-install-prompt">$</span>
<span class="doc-install-cmd">npx @serticode/thoth <command> [options]</span>
</div>
</section>
<div class="section-rule"></div>
<section id="installation" class="reveal">
<h2 class="doc-section-title">Installation</h2>
<p class="doc-section-desc">
<strong>Prerequisites:</strong> Node.js 22+ and a C++ compiler (required by
<code>better-sqlite3</code> and <code>sqlite-vec</code> native modules). On macOS, Xcode Command
Line Tools (<code>xcode-select --install</code>) is sufficient.
</p>
<pre class="doc-code-block"><code>npm install -g @serticode/thoth</code></pre>
<p class="doc-section-desc">Or run without installing:</p>
<pre class="doc-code-block"><code>npx @serticode/thoth init</code></pre>
<h3 class="doc-subsection-title">AI Provider Setup (optional)</h3>
<p class="doc-section-desc">
Set at least one API key environment variable to use cloud AI. Add these to your shell profile
(<code>~/.zshrc</code> or <code>~/.bashrc</code>) so they persist across sessions. If no keys
are set, Thoth falls back to local Ollama.
</p>
<pre
class="doc-code-block"><code><span class="dc-dim">export OPENAI_API_KEY</span>=sk-... <span class="dc-comment">// OpenAI </span>
<span class="dc-dim">export ANTHROPIC_API_KEY</span>=sk-... <span class="dc-comment">// Anthropic Claude</span>
<span class="dc-dim">export GEMINI_API_KEY</span>=... <span class="dc-comment">// Gemini (free tier available)</span>
<span class="dc-dim">export GROQ_API_KEY</span>=... <span class="dc-comment">// Groq (fast inference)</span></code></pre>
<p class="doc-section-desc">
To run entirely offline with no API keys,
<a href="https://ollama.com" target="_blank" rel="noopener">install Ollama</a> and pass
<code>--local</code>:
</p>
<pre class="doc-code-block"><code>thoth --local init</code></pre>
</section>
<div class="section-rule"></div>
<section id="global-options" class="reveal">
<h2 class="doc-section-title">Global Options</h2>
<p class="doc-section-desc">
Global options apply to every command. <code>--local</code> and <code>--provider</code> can also
be set in <code>thoth.json</code> or environment variables.
</p>
<div class="doc-table-wrap">
<table class="doc-table">
<thead>
<tr>
<th>Option</th>
<th>Env Var</th>
<th>Example</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>--local</code></td>
<td><code>THOTH_LOCAL=true</code></td>
<td><code>thoth --local init</code></td>
<td>Use only local AI (Ollama). No data sent to external providers</td>
</tr>
<tr>
<td><code>--provider <name></code></td>
<td><code>THOTH_PROVIDER</code></td>
<td><code>thoth --provider anthropic research "Flutter"</code></td>
<td>AI provider: <code>openai</code>, <code>groq</code>, <code>gemini</code>, <code>anthropic</code>, <code>ollama</code></td>
</tr>
<tr>
<td><code>-V, --version</code></td>
<td></td>
<td><code>thoth --version</code></td>
<td>Print version (1.0.0)</td>
</tr>
<tr>
<td><code>--help</code></td>
<td></td>
<td><code>thoth --help</code><br><code>thoth import_voice --help</code></td>
<td>Show help. Use <code>thoth <command> --help</code> for any command</td>
</tr>
</tbody>
</table>
</div>
</section>
<div class="section-rule"></div>
<section id="configuration" class="reveal">
<h2 class="doc-section-title">Configuration</h2>
<p class="doc-section-desc">Thoth reads config from two locations (merged in order, later wins):</p>
<ol class="doc-list">
<li>
<strong>Project config</strong> <code>./thoth.json</code> (current working
directory)
</li>
<li><strong>User config</strong> <code>~/.thoth/thoth.json</code> (home directory)</li>
</ol>
<h3 class="doc-subsection-title">Schema</h3>
<pre class="doc-code-block"><code>{
<span class="dc-dim">"provider"</span>: <span class="dc-str">"openai"</span>, <span class="dc-comment">// Default AI provider</span>
<span class="dc-dim">"chatModel"</span>: <span class="dc-str">"gpt-4o-mini"</span>, <span class="dc-comment">// Override chat model</span>
<span class="dc-dim">"embeddingModel"</span>: <span class="dc-str">"text-embedding-3-small"</span>, <span class="dc-comment">// Override embedding model</span>
<span class="dc-dim">"local"</span>: <span class="dc-kw">false</span>, <span class="dc-comment">// Force local only mode</span>
<span class="dc-dim">"dbPath"</span>: <span class="dc-str">"/path/to/custom.db"</span>, <span class="dc-comment">// Custom database location</span>
<span class="dc-dim">"logLevel"</span>: <span class="dc-str">"error"</span>, <span class="dc-comment">// Logging level (error, warn, info, debug)</span>
<span class="dc-dim">"export"</span>: {
<span class="dc-dim">"format"</span>: <span class="dc-str">"md"</span>, <span class="dc-comment">// Default export format</span>
<span class="dc-dim">"outputDir"</span>: <span class="dc-str">"./out"</span> <span class="dc-comment">// Default export directory</span>
}
}</code></pre>
<h3 class="doc-subsection-title">Environment Variables</h3>
<div class="doc-table-wrap">
<table class="doc-table">
<thead>
<tr>
<th>Variable</th>
<th>Overrides</th>
<th>Default</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>THOTH_LOCAL=true</code></td>
<td><code>local</code> config field</td>
<td><code>false</code></td>
</tr>
<tr>
<td><code>THOTH_PROVIDER</code></td>
<td><code>provider</code> config field</td>
<td>auto detect</td>
</tr>
<tr>
<td><code>THOTH_DB_PATH</code></td>
<td><code>dbPath</code> config field</td>
<td><code>~/.thoth/thoth.db</code></td>
</tr>
<tr>
<td><code>THOTH_CHAT_MODEL</code></td>
<td><code>chatModel</code> config field</td>
<td>provider dependent</td>
</tr>
<tr>
<td><code>THOTH_EMBEDDING_MODEL</code></td>
<td><code>embeddingModel</code> config field</td>
<td>provider dependent</td>
</tr>
<tr>
<td><code>LOG_LEVEL</code></td>
<td><code>logLevel</code> config field</td>
<td><code>info</code></td>
</tr>
</tbody>
</table>
</div>
<h3 class="doc-subsection-title">Config Merge Priority</h3>
<p class="doc-section-desc">
<strong class="doc-em">CLI flag > Environment variable > Config file > Default</strong>
</p>
</section>
<div class="section-rule"></div>
<section id="ai-providers" class="reveal">
<h2 class="doc-section-title">AI Providers</h2>
<p class="doc-section-desc">
Thoth supports five AI providers. Each has its own API key env var and default model. Providers
are tried in priority order; if one fails, the next is attempted (3 retries with exponential
backoff per provider).
</p>
<h3 class="doc-subsection-title">Provider Chain</h3>
<p class="doc-section-desc">
Providers are tried in quality priority order. Each gets 3 retries with exponential backoff
before falling through to the next. Ollama is always last as the local fallback.
</p>
<pre class="doc-code-block"><code>OpenAI → Groq → Gemini → Anthropic → Ollama
<span class="dc-dim">(tried in order; Ollama is the always-available last resort)</span></code></pre>
<h3 class="doc-subsection-title">Provider Reference</h3>
<div class="doc-table-wrap">
<table class="doc-table">
<thead>
<tr>
<th>Provider</th>
<th>Env Var</th>
<th>Default Chat Model</th>
<th>Default Embedding Model</th>
<th>Embeddings</th>
<th>Kind</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>OpenAI</strong></td>
<td><code>OPENAI_API_KEY</code></td>
<td><code>gpt-4o-mini</code></td>
<td><code>text-embedding-3-small</code></td>
<td>Yes</td>
<td>openai compatible</td>
</tr>
<tr>
<td><strong>Groq</strong></td>
<td><code>GROQ_API_KEY</code></td>
<td><code>mixtral-8x7b-32768</code></td>
<td></td>
<td>No</td>
<td>openai compatible</td>
</tr>
<tr>
<td><strong>Gemini</strong></td>
<td><code>GEMINI_API_KEY</code></td>
<td><code>gemini-1.5-flash</code></td>
<td><code>text-embedding-004</code></td>
<td>Yes</td>
<td>openai compatible</td>
</tr>
<tr>
<td><strong>Anthropic</strong></td>
<td><code>ANTHROPIC_API_KEY</code></td>
<td><code>claude-sonnet-4-20250514</code></td>
<td></td>
<td>No</td>
<td>anthropic</td>
</tr>
<tr>
<td><strong>Ollama</strong></td>
<td>(none, localhost)</td>
<td><code>qwen2.5:7b</code></td>
<td><code>nomic-embed-text</code></td>
<td>Yes</td>
<td>openai compatible</td>
</tr>
</tbody>
</table>
</div>
<h3 class="doc-subsection-title">Custom Models</h3>
<p class="doc-section-desc">Override any provider's default model:</p>
<pre
class="doc-code-block"><code><span class="dc-dim">THOTH_CHAT_MODEL=gpt-4o</span> thoth generate_article --topic "My Topic"
<span class="dc-dim">THOTH_EMBEDDING_MODEL=text-embedding-ada-002</span> thoth import_knowledge ./docs</code></pre>
<h3 class="doc-subsection-title">Ollama Configuration</h3>
<pre
class="doc-code-block"><code><span class="dc-dim">OLLAMA_BASE_URL</span>=http://localhost:11434/v1 <span class="dc-comment">// default</span>
<span class="dc-dim">OLLAMA_CHAT_MODEL</span>=qwen2.5:7b
<span class="dc-dim">OLLAMA_EMBEDDING_MODEL</span>=nomic-embed-text</code></pre>
<h3 class="doc-subsection-title">Privacy</h3>
<p class="doc-section-desc">
Pass <code>--local</code> (or set <code>THOTH_LOCAL=true</code> or <code>"local": true</code> in
config) to restrict Thoth to Ollama only. No source content leaves your machine.
</p>
</section>
<div class="section-rule"></div>
<section id="commands" class="reveal">
<h2 class="doc-section-title">Commands</h2>
<div id="cmd-init" class="doc-command">
<h3 class="doc-cmd-title"><span class="doc-cmd-hash">#</span> thoth init</h3>
<p class="doc-cmd-desc">Initialize Thoth create the SQLite database and run migrations.</p>
<pre class="doc-code-block"><code>thoth init [options]</code></pre>
<p class="doc-section-desc">
Creates the database file at <code>~/.thoth/thoth.db</code> (or <code>THOTH_DB_PATH</code>)
and ensures all tables exist. Safe to run multiple times existing data is preserved.
</p>
<div class="doc-terminal-sample">
<div class="doc-terminal-bar">
<span class="doc-terminal-dot"></span>
<span class="doc-terminal-dot"></span>
<span class="doc-terminal-dot"></span>
<span class="doc-terminal-label">output</span>
</div>
<div class="doc-terminal-body">
<div class="dt-prompt">$</div>
<div class="dt-cmd">thoth init</div>
<div class="dt-output">Thoth initialized.</div>
<div class="dt-output">Database: ~/.thoth/thoth.db</div>
<div class="dt-output">Sources: 0 voice, 0 knowledge, 0 publication</div>
<div class="dt-output"> </div>
<div class="dt-output dim">Privacy notice:</div>
<div class="dt-output dim">Thoth sends source content to external AI providers</div>
<div class="dt-output dim">for profile generation and embedding.</div>
<div class="dt-output dim">Run with --local to use only local AI (Ollama).</div>
<div class="dt-output"> </div>
<div class="dt-section">Next steps: thoth import_voice <path> ...</div>
</div>
</div>
<div class="doc-errors">
<span class="doc-errors-label">Errors</span>
<p>
If the database directory cannot be created or migrations fail, Thoth exits with code 1.
</p>
</div>
</div>
<div id="cmd-import-voice" class="doc-command">
<h3 class="doc-cmd-title"><span class="doc-cmd-hash">#</span> thoth import_voice</h3>
<p class="doc-cmd-desc">
Import voice sources journals, essays, blog posts, personal writing.
</p>
<pre class="doc-code-block"><code>thoth import_voice <path></code></pre>
<div class="doc-table-wrap">
<table class="doc-table">
<thead>
<tr>
<th>Arg</th>
<th>Required</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>path</code></td>
<td>Yes</td>
<td>File or directory path to import</td>
</tr>
</tbody>
</table>
</div>
<p class="doc-section-desc">
Reads text files from the given path, chunks them, imports each chunk as a "voice" source,
stores a content checksum to prevent duplicates, then generates vector embeddings for
semantic search.
</p>
<div class="doc-terminal-sample">
<div class="doc-terminal-bar">
<span class="doc-terminal-dot"></span>
<span class="doc-terminal-dot"></span>
<span class="doc-terminal-dot"></span>
<span class="doc-terminal-label">output</span>
</div>
<div class="doc-terminal-body">
<div class="dt-output">Importing voice sources from: ./my-journal/</div>
<div class="dt-output">Imported 24 chunks.</div>
<div class="dt-output">Generating embeddings...</div>
<div class="dt-output">Embedding: [████████████████████] 100% | 24/24</div>
<div class="dt-success">Embeddings complete.</div>
<div class="dt-output"> </div>
<div class="dt-section">Import complete. Run `thoth generate_profile`</div>
</div>
</div>
<div class="doc-errors">
<span class="doc-errors-label">Errors</span>
<p>Path does not exist: <code>ENOENT: no such file or directory</code></p>
<p>Embedding failure: nonfatal, logs warning, retry by rerunning</p>
<p>Duplicate content: silently skipped (checksum match)</p>
</div>
</div>
<div id="cmd-import-knowledge" class="doc-command">
<h3 class="doc-cmd-title"><span class="doc-cmd-hash">#</span> thoth import_knowledge</h3>
<p class="doc-cmd-desc">
Import knowledge sources technical notes, documentation, repositories.
</p>
<pre class="doc-code-block"><code>thoth import_knowledge <path></code></pre>
<div class="doc-table-wrap">
<table class="doc-table">
<thead>
<tr>
<th>Arg</th>
<th>Required</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>path</code></td>
<td>Yes</td>
<td>File or directory path to import</td>
</tr>
</tbody>
</table>
</div>
<p class="doc-section-desc">
Same behavior as <code>import_voice</code> but sources are tagged as type
<code>knowledge</code>. Used for research retrieval and profile generation.
</p>
</div>
<div id="cmd-import-publications" class="doc-command">
<h3 class="doc-cmd-title"><span class="doc-cmd-hash">#</span> thoth import_publications</h3>
<p class="doc-cmd-desc">
Import publication sources existing articles, series, published work.
</p>
<pre class="doc-code-block"><code>thoth import_publications <path></code></pre>
<div class="doc-table-wrap">
<table class="doc-table">
<thead>
<tr>
<th>Arg</th>
<th>Required</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>path</code></td>
<td>Yes</td>
<td>File or directory path to import</td>
</tr>
</tbody>
</table>
</div>
<p class="doc-section-desc">
Same behavior as <code>import_voice</code> but sources are tagged as type
<code>publication</code>. Used for publication profile (themes, series structure).
</p>
</div>
<div id="cmd-generate-profile" class="doc-command">
<h3 class="doc-cmd-title"><span class="doc-cmd-hash">#</span> thoth generate_profile</h3>
<p class="doc-cmd-desc">Generate identity profiles from imported sources.</p>
<pre class="doc-code-block"><code>thoth generate_profile [options]</code></pre>
<p class="doc-section-desc">
Analyzes all imported sources across the three categories and generates AI derived profiles:
</p>
<ul class="doc-list">
<li>
<strong>Voice profile</strong> tone, pacing, storytelling patterns, vocabulary,
sentence structure, transitions, humor, reader engagement
</li>
<li><strong>Knowledge profile</strong> domains of expertise, topics, summary</li>
<li>
<strong>Publication profile</strong> themes, series structure, publication summary
</li>
</ul>
<div class="doc-terminal-sample">
<div class="doc-terminal-bar">
<span class="doc-terminal-dot"></span>
<span class="doc-terminal-dot"></span>
<span class="doc-terminal-dot"></span>
<span class="doc-terminal-label">output</span>
</div>
<div class="doc-terminal-body">
<div class="dt-output">Generating identity profiles...</div>
<div class="dt-output">Generating voice profile...</div>
<div class="dt-success">Voice profile: vp_abc123def</div>
<div class="dt-output">Summary: Analytical yet approachable...</div>
<div class="dt-output">Generating knowledge profile...</div>
<div class="dt-success">Knowledge profile: kp_def456ghi</div>
<div class="dt-output">Domains: machine learning, distributed systems</div>
<div class="dt-success">Publication profile: pp_789ghi012</div>
<div class="dt-section">Identity profiles generated successfully.</div>
</div>
</div>
<div class="doc-errors">
<span class="doc-errors-label">Errors</span>
<p>No sources imported: exits with code 1</p>
<p>Profile generation failure for a type: logs error, continues with remaining types</p>
</div>
</div>
<div id="cmd-profile-status" class="doc-command">
<h3 class="doc-cmd-title"><span class="doc-cmd-hash">#</span> thoth profile_status</h3>
<p class="doc-cmd-desc">Show profile generation status and source counts.</p>
<pre class="doc-code-block"><code>thoth profile_status [options]</code></pre>
<div class="doc-terminal-sample">
<div class="doc-terminal-bar">
<span class="doc-terminal-dot"></span>
<span class="doc-terminal-dot"></span>
<span class="doc-terminal-dot"></span>
<span class="doc-terminal-label">output</span>
</div>
<div class="doc-terminal-body">
<div class="dt-section">Thoth Status</div>
<div class="dt-output"> </div>
<div class="dt-output">Sources:</div>
<div class="dt-output">Voice: 24 chunks</div>
<div class="dt-output">Knowledge: 15 chunks</div>
<div class="dt-output">Publications: 8 chunks</div>
<div class="dt-output"> </div>
<div class="dt-output">Profiles:</div>
<div class="dt-success">Voice: [ready] Analytical yet approachable...</div>
<div class="dt-success">
Knowledge: [ready] machine learning, distributed systems...
</div>
<div class="dt-output">Publication: [missing] Not generated</div>
</div>
</div>
</div>
<div id="cmd-research" class="doc-command">
<h3 class="doc-cmd-title"><span class="doc-cmd-hash">#</span> thoth research</h3>
<p class="doc-cmd-desc">Research a topic using imported knowledge sources.</p>
<pre class="doc-code-block"><code>thoth research <topic></code></pre>
<div class="doc-table-wrap">
<table class="doc-table">
<thead>
<tr>
<th>Arg</th>
<th>Required</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>topic</code></td>
<td>Yes</td>
<td>Topic to research</td>
</tr>
</tbody>
</table>
</div>
<p class="doc-section-desc">
Performs semantic search over imported knowledge sources, retrieving the most relevant
chunks by embedding similarity, and generates a structured research note with inline
citations.
</p>
<div class="doc-terminal-sample">
<div class="doc-terminal-bar">
<span class="doc-terminal-dot"></span>
<span class="doc-terminal-dot"></span>
<span class="doc-terminal-dot"></span>
<span class="doc-terminal-label">output</span>
</div>
<div class="doc-terminal-body">
<div class="dt-output">Researching: "Vector search performance optimization"</div>
<div class="dt-output"> </div>
<div class="dt-output">Distributed vector search systems face three primary</div>
<div class="dt-output">bottlenecks: index build latency, query throughput under</div>
<div class="dt-output">recall constraints, and memory bandwidth...</div>
<div class="dt-output"> </div>
<div class="dt-output">Sources cited: 4</div>
<div class="dt-section">Research ID: rn_abc123</div>
</div>
</div>
</div>
<div id="cmd-generate-article" class="doc-command">
<h3 class="doc-cmd-title"><span class="doc-cmd-hash">#</span> thoth generate_article</h3>
<p class="doc-cmd-desc">Generate an article in your authentic voice.</p>
<pre
class="doc-code-block"><code>thoth generate_article --topic <topic> [--research <id>]
thoth generate_article --research <id></code></pre>
<div class="doc-table-wrap">
<table class="doc-table">
<thead>
<tr>
<th>Option</th>
<th>Required?</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>-t, --topic <topic></code></td>
<td>Yes (if no <code>--research</code>)</td>
<td>Topic to write about</td>
</tr>
<tr>
<td><code>-r, --research <id></code></td>
<td>Yes (if no <code>--topic</code>)</td>
<td>Research note ID to use as source</td>
</tr>
</tbody>
</table>
</div>
<p class="doc-section-desc">
Generates an article by combining your voice profile with optional research context.
</p>
<div class="doc-terminal-sample">
<div class="doc-terminal-bar">
<span class="doc-terminal-dot"></span>
<span class="doc-terminal-dot"></span>
<span class="doc-terminal-dot"></span>
<span class="doc-terminal-label">output</span>
</div>
<div class="doc-terminal-body">
<div class="dt-output">Generating article...</div>
<div class="dt-output">Topic: Vector Search Performance Optimization</div>
<div class="dt-output"> </div>
<div class="dt-success">Title: Optimizing Vector Search at Scale</div>
<div class="dt-output">Words: 1850</div>
<div class="dt-section">ID: art_def456</div>
</div>
</div>
<div class="doc-errors">
<span class="doc-errors-label">Errors</span>
<p>No topic or research ID: exits with code 1</p>
<p>Research ID not found: <code>Research note not found</code></p>
</div>
</div>
<div id="cmd-list-articles" class="doc-command">
<h3 class="doc-cmd-title"><span class="doc-cmd-hash">#</span> thoth list_articles</h3>
<p class="doc-cmd-desc">List all generated articles.</p>
<pre class="doc-code-block"><code>thoth list_articles [options]</code></pre>
<div class="doc-terminal-sample">
<div class="doc-terminal-bar">
<span class="doc-terminal-dot"></span>
<span class="doc-terminal-dot"></span>
<span class="doc-terminal-dot"></span>
<span class="doc-terminal-label">output</span>
</div>
<div class="doc-terminal-body">
<div class="dt-section">Articles:</div>
<div class="dt-output">art_def45 Optimizing Vector Search at Scale (1850 words)</div>
<div class="dt-output">art_78901 Building a Personal Knowledge Base (2200 words)</div>
</div>
</div>
<div class="doc-errors">
<span class="doc-errors-label">Empty state</span>
<p><code>No articles generated yet. Run thoth generate_article --topic "..."</code></p>
</div>
</div>
<div id="cmd-get-article" class="doc-command">
<h3 class="doc-cmd-title"><span class="doc-cmd-hash">#</span> thoth get_article</h3>
<p class="doc-cmd-desc">Show an article by ID.</p>
<pre class="doc-code-block"><code>thoth get_article <id></code></pre>
<div class="doc-table-wrap">
<table class="doc-table">
<thead>
<tr>
<th>Arg</th>
<th>Required</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>id</code></td>
<td>Yes</td>
<td>Article ID</td>
</tr>
</tbody>
</table>
</div>
<div class="doc-terminal-sample">
<div class="doc-terminal-bar">
<span class="doc-terminal-dot"></span>
<span class="doc-terminal-dot"></span>
<span class="doc-terminal-dot"></span>
<span class="doc-terminal-label">output</span>
</div>
<div class="doc-terminal-body">
<div class="dt-output">Title: Optimizing Vector Search at Scale</div>
<div class="dt-output">Words: 1850</div>
<div class="dt-output">Status: draft</div>
<div class="dt-section">Created: 4/15/2026, 2:30:00 PM</div>
</div>
</div>
<div class="doc-errors">
<span class="doc-errors-label">Errors</span>
<p>Article not found: <code>Article not found: art_badid</code></p>
</div>
</div>
<div id="cmd-create-series" class="doc-command">
<h3 class="doc-cmd-title"><span class="doc-cmd-hash">#</span> thoth create_series</h3>
<p class="doc-cmd-desc">Create a new series to group articles.</p>
<pre
class="doc-code-block"><code>thoth create_series <name> [--description <text>]</code></pre>
<div class="doc-table-wrap">
<table class="doc-table">
<thead>
<tr>
<th>Arg/Option</th>
<th>Required</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>name</code></td>
<td>Yes</td>
<td>Series name</td>
</tr>
<tr>
<td><code>-d, --description <text></code></td>
<td>No</td>
<td>Series description</td>
</tr>
</tbody>
</table>
</div>
<div class="doc-terminal-sample">
<div class="doc-terminal-bar">
<span class="doc-terminal-dot"></span>
<span class="doc-terminal-dot"></span>
<span class="doc-terminal-dot"></span>
<span class="doc-terminal-label">output</span>
</div>
<div class="doc-terminal-body">
<div class="dt-success">Series created: Performance Engineering</div>
<div class="dt-section">ID: ser_abc123</div>
</div>
</div>
</div>
<div id="cmd-list-series" class="doc-command">
<h3 class="doc-cmd-title"><span class="doc-cmd-hash">#</span> thoth list_series</h3>
<p class="doc-cmd-desc">List all series.</p>
<pre class="doc-code-block"><code>thoth list_series [options]</code></pre>
<div class="doc-terminal-sample">
<div class="doc-terminal-bar">
<span class="doc-terminal-dot"></span>
<span class="doc-terminal-dot"></span>
<span class="doc-terminal-dot"></span>
<span class="doc-terminal-label">output</span>
</div>
<div class="doc-terminal-body">
<div class="dt-section">Series:</div>
<div class="dt-output">ser_abc12 Performance Engineering (3 articles)</div>
<div class="dt-output">ser_def45 Distributed Systems (1 article)</div>
</div>
</div>
<div class="doc-errors">
<span class="doc-errors-label">Empty state</span>
<p><code>No series created yet. Run thoth create_series <name></code></p>
</div>
</div>
<div id="cmd-add-to-series" class="doc-command">
<h3 class="doc-cmd-title"><span class="doc-cmd-hash">#</span> thoth add_to_series</h3>
<p class="doc-cmd-desc">Add an article to a series.</p>
<pre
class="doc-code-block"><code>thoth add_to_series <series-id> <article-id></code></pre>
<div class="doc-table-wrap">
<table class="doc-table">
<thead>
<tr>
<th>Arg</th>
<th>Required</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>series-id</code></td>
<td>Yes</td>
<td>Series ID</td>
</tr>
<tr>
<td><code>article-id</code></td>
<td>Yes</td>
<td>Article ID</td>
</tr>
</tbody>
</table>
</div>
<div class="doc-terminal-sample">
<div class="doc-terminal-bar">
<span class="doc-terminal-dot"></span>
<span class="doc-terminal-dot"></span>
<span class="doc-terminal-dot"></span>
<span class="doc-terminal-label">output</span>
</div>
<div class="doc-terminal-body">
<div class="dt-success">Article art_def45 added to series ser_abc12</div>
</div>
</div>
<div class="doc-errors">
<span class="doc-errors-label">Errors</span>
<p>Series not found: <code>Series not found</code></p>
<p>Article not found: <code>Article not found</code></p>
<p>Article already in series: silently ignored (idempotent)</p>
</div>
</div>
<div id="cmd-get-series" class="doc-command">
<h3 class="doc-cmd-title"><span class="doc-cmd-hash">#</span> thoth get_series</h3>
<p class="doc-cmd-desc">Show series details, including all articles.</p>
<pre class="doc-code-block"><code>thoth get_series <id></code></pre>
<div class="doc-table-wrap">
<table class="doc-table">
<thead>
<tr>
<th>Arg</th>
<th>Required</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>id</code></td>
<td>Yes</td>
<td>Series ID</td>
</tr>
</tbody>
</table>
</div>
<div class="doc-terminal-sample">
<div class="doc-terminal-bar">
<span class="doc-terminal-dot"></span>
<span class="doc-terminal-dot"></span>
<span class="doc-terminal-dot"></span>
<span class="doc-terminal-label">output</span>
</div>
<div class="doc-terminal-body">
<div class="dt-output">Series: Performance Engineering</div>
<div class="dt-output">Description: Practical guides to perf analysis</div>
<div class="dt-output">Created: 4/15/2026, 3:00:00 PM</div>
<div class="dt-section">Articles: 2</div>
</div>
</div>
<div class="doc-errors">
<span class="doc-errors-label">Errors</span>
<p>Series not found: <code>Series not found: ser_badid</code></p>
</div>
</div>
<div id="cmd-export-article" class="doc-command">
<h3 class="doc-cmd-title"><span class="doc-cmd-hash">#</span> thoth export_article</h3>
<p class="doc-cmd-desc">Export an article to a file.</p>
<pre
class="doc-code-block"><code>thoth export_article <id> [--format <format>] [--output <dir>] [--stdout]</code></pre>
<div class="doc-table-wrap">
<table class="doc-table">
<thead>
<tr>
<th>Arg/Option</th>
<th>Required</th>
<th>Description</th>
<th>Default</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>id</code></td>
<td>Yes</td>
<td>Article ID</td>
<td></td>
</tr>
<tr>
<td><code>-f, --format <format></code></td>
<td>No</td>
<td>Output format: <code>md</code>, <code>html</code>, <code>txt</code></td>
<td><code>md</code></td>
</tr>
<tr>
<td><code>-o, --output <path></code></td>
<td>No</td>
<td>Output directory</td>
<td><code>~/Documents/Thoth/singles</code></td>
</tr>
<tr>
<td><code>--stdout</code></td>
<td>No</td>
<td>Print to stdout instead of writing a file</td>
<td><code>false</code></td>
</tr>
</tbody>
</table>
</div>
<div class="doc-terminal-sample">
<div class="doc-terminal-bar">
<span class="doc-terminal-dot"></span>
<span class="doc-terminal-dot"></span>
<span class="doc-terminal-dot"></span>
<span class="doc-terminal-label">output</span>
</div>
<div class="doc-terminal-body">
<div class="dt-success">[ok] Article exported.</div>
<div class="dt-output">Title optimizing-vector-search-at-scale</div>
<div class="dt-output">Format html</div>
<div class="dt-section">
Path /Users/you/Documents/Thoth/singles/optimizing-vector-search-at-scale.html
</div>
</div>
</div>
<div class="doc-errors">
<span class="doc-errors-label">Errors</span>
<p>Article not found: <code>Article not found: art_badid</code></p>
<p>Invalid format: <code>Invalid format. Choose one of: md, html, txt</code></p>
</div>
</div>
<div id="cmd-export-series" class="doc-command">
<h3 class="doc-cmd-title"><span class="doc-cmd-hash">#</span> thoth export_series</h3>
<p class="doc-cmd-desc">Export a full series to a file.</p>
<pre
class="doc-code-block"><code>thoth export_series <id> [--format <format>] [--output <dir>]</code></pre>
<div class="doc-table-wrap">
<table class="doc-table">
<thead>
<tr>
<th>Arg/Option</th>
<th>Required</th>
<th>Description</th>
<th>Default</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>id</code></td>
<td>Yes</td>
<td>Series ID</td>
<td></td>
</tr>
<tr>
<td><code>-f, --format <format></code></td>
<td>No</td>
<td>Output format: <code>md</code>, <code>html</code>, <code>rss</code></td>