@kat-ai/cli 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,212 @@
1
+ # @kat-ai/cli
2
+
3
+ Knowledge Base Tools CLI - A unified command-line interface for managing Pinecone knowledge bases.
4
+
5
+ ## Installation
6
+
7
+ ### From npm (when published)
8
+
9
+ ```bash
10
+ npm install -g @kat-ai/cli
11
+ ```
12
+
13
+ Introspection + Eval baseline package set:
14
+
15
+ ```bash
16
+ npm install @kat-ai/sdk@0.1.0 @kat-ai/eval@0.1.0 @kat-ai/cli@0.1.0
17
+ ```
18
+
19
+ ### From source
20
+
21
+ ```bash
22
+ # Clone the repository
23
+ git clone https://github.com/pinecone-io/kat.git
24
+ cd kat
25
+
26
+ # Install dependencies
27
+ pnpm install
28
+
29
+ # Build the CLI
30
+ pnpm cli:build
31
+
32
+ # Link for global usage
33
+ cd packages/cli
34
+ npm link
35
+ ```
36
+
37
+ ## Usage
38
+
39
+ ### Interactive Mode
40
+
41
+ Run without arguments to enter interactive mode:
42
+
43
+ ```bash
44
+ kat
45
+ ```
46
+
47
+ ### Commands
48
+
49
+ #### Ingest Data
50
+
51
+ Ingest CSV data into Pinecone assistants with topic extraction:
52
+
53
+ ```bash
54
+ # Interactive mode
55
+ kat ingest -i
56
+
57
+ # Direct mode
58
+ kat ingest --output pinecone
59
+ kat ingest --output local --dir ./data/ingested
60
+ kat ingest --output both --dry-run
61
+ ```
62
+
63
+ Options:
64
+ - `-o, --output <mode>` - Output mode: pinecone, local, or both (default: pinecone)
65
+ - `-d, --dir <path>` - Local output directory for ingested files
66
+ - `--dry-run` - Preview changes without making them
67
+ - `-i, --interactive` - Run in interactive mode
68
+
69
+ #### Compose Manifest
70
+
71
+ Build KB manifests with AI assistance:
72
+
73
+ ```bash
74
+ # Interactive mode
75
+ kat compose -i
76
+
77
+ # Direct mode
78
+ kat compose --kb-id my_kb --domain support --description "Support KB"
79
+ kat compose --kb-id my_kb --source ./data/faq.csv --storage both
80
+ ```
81
+
82
+ Options:
83
+ - `--kb-id <id>` - KB identifier
84
+ - `--domain <domain>` - Domain name
85
+ - `--description <desc>` - Short description
86
+ - `--assistant <name>` - Pinecone assistant name
87
+ - `--source <path>` - Path to source CSV data
88
+ - `-s, --storage <mode>` - Storage mode: local, pinecone, or both
89
+ - `--dry-run` - Preview without saving
90
+
91
+ #### Introspect Assistant
92
+
93
+ Generate manifest from existing Pinecone assistant:
94
+
95
+ ```bash
96
+ # Interactive mode
97
+ kat introspect -i
98
+
99
+ # Direct mode
100
+ kat introspect --assistant my-assistant --kb-id my_kb
101
+ kat introspect --assistant my-assistant --storage both --verbose
102
+ ```
103
+
104
+ Options:
105
+ - `-a, --assistant <name>` - Pinecone assistant name
106
+ - `--kb-id <id>` - KB identifier
107
+ - `--domain <domain>` - Domain name
108
+ - `-s, --storage <mode>` - Storage mode
109
+ - `--verbose` - Show detailed Q&A during introspection
110
+ - `--dry-run` - Preview without saving
111
+
112
+ #### Validate Data
113
+
114
+ Validate CSV data against KB definitions:
115
+
116
+ ```bash
117
+ # Interactive mode
118
+ kat validate -i
119
+
120
+ # Direct mode
121
+ kat validate
122
+ kat validate --path ./data
123
+ kat validate --json
124
+ ```
125
+
126
+ Options:
127
+ - `-p, --path <path>` - Path to CSV file or directory
128
+ - `--json` - Output results as JSON
129
+
130
+ #### Test Topics
131
+
132
+ Test topic extraction on files:
133
+
134
+ ```bash
135
+ # Interactive mode
136
+ kat topics -i
137
+
138
+ # Direct mode
139
+ kat topics ./data/document.txt
140
+ kat topics ./data/*.csv --mode slm --top-n 10
141
+ kat topics ./docs --mode hybrid --verbose
142
+ ```
143
+
144
+ Options:
145
+ - `-m, --mode <mode>` - Extraction mode: classic (TF-IDF), slm (LLM), or hybrid
146
+ - `-n, --top-n <n>` - Number of topics per document (default: 5)
147
+ - `--verbose` - Show document previews
148
+ - `--json` - Output as JSON
149
+
150
+ #### Sync Manifests
151
+
152
+ Sync manifests between local files and Pinecone:
153
+
154
+ ```bash
155
+ # Interactive mode
156
+ kat sync -i
157
+
158
+ # Direct mode
159
+ kat sync --direction toLocal
160
+ kat sync --direction toPinecone
161
+ kat sync --direction both --dry-run
162
+ ```
163
+
164
+ Options:
165
+ - `-d, --direction <dir>` - Sync direction: toLocal, toPinecone, or both
166
+ - `--dry-run` - Preview changes without making them
167
+
168
+ ### Global Options
169
+
170
+ - `-v, --version` - Display version number
171
+ - `--no-color` - Disable colored output
172
+ - `--verbose` - Enable verbose output
173
+ - `-h, --help` - Display help
174
+
175
+ ## Environment Variables
176
+
177
+ Create a `.env.local` file with the following variables:
178
+
179
+ ```env
180
+ PINECONE_API_KEY=your-pinecone-api-key
181
+ OPENAI_API_KEY=your-openai-api-key
182
+ ```
183
+
184
+ The CLI will automatically look for `.env.local` in the current directory and parent directories.
185
+
186
+ ## Development
187
+
188
+ ### Build
189
+
190
+ ```bash
191
+ pnpm cli:build
192
+ ```
193
+
194
+ ### Development Mode (watch)
195
+
196
+ ```bash
197
+ pnpm cli:dev
198
+ ```
199
+
200
+ ### Run locally
201
+
202
+ ```bash
203
+ # After building
204
+ node packages/cli/dist/index.js
205
+
206
+ # Or with tsx (development)
207
+ pnpm cli:legacy
208
+ ```
209
+
210
+ ## License
211
+
212
+ MIT
@@ -0,0 +1 @@
1
+ #!/usr/bin/env node