@kat-ai/cli 0.1.0 → 0.1.1

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.
Files changed (2) hide show
  1. package/README.md +41 -173
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -1,212 +1,80 @@
1
1
  # @kat-ai/cli
2
2
 
3
- Knowledge Base Tools CLI - A unified command-line interface for managing Pinecone knowledge bases.
3
+ CLI for scaffolding KAT apps, generating manifests, introspecting Pinecone Assistants, and running eval workflows.
4
4
 
5
- ## Installation
5
+ ## Install
6
6
 
7
- ### From npm (when published)
7
+ Run once with `npx`:
8
8
 
9
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
10
+ npx @kat-ai/cli --help
61
11
  ```
62
12
 
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:
13
+ Install globally if you use it often:
72
14
 
73
15
  ```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
16
+ npm install -g @kat-ai/cli
17
+ kat --help
80
18
  ```
81
19
 
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
20
+ The published package is `@kat-ai/cli`, but the installed binary is `kat`.
92
21
 
93
- Generate manifest from existing Pinecone assistant:
22
+ ## Environment
94
23
 
95
- ```bash
96
- # Interactive mode
97
- kat introspect -i
24
+ Most commands expect these environment variables, either in your shell or in `.env.local`:
98
25
 
99
- # Direct mode
100
- kat introspect --assistant my-assistant --kb-id my_kb
101
- kat introspect --assistant my-assistant --storage both --verbose
26
+ ```env
27
+ OPENAI_API_KEY=sk-...
28
+ PINECONE_API_KEY=...
102
29
  ```
103
30
 
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
31
+ ## Quick Start
111
32
 
112
- #### Validate Data
113
-
114
- Validate CSV data against KB definitions:
33
+ Generate a new app:
115
34
 
116
35
  ```bash
117
- # Interactive mode
118
- kat validate -i
119
-
120
- # Direct mode
121
- kat validate
122
- kat validate --path ./data
123
- kat validate --json
36
+ npx @kat-ai/cli generate -i
124
37
  ```
125
38
 
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:
39
+ Generate manifests from an existing Pinecone Assistant:
133
40
 
134
41
  ```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
42
+ npx @kat-ai/cli introspect --assistant my-assistant --verbose
142
43
  ```
143
44
 
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:
45
+ Build manifests interactively:
153
46
 
154
47
  ```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
48
+ npx @kat-ai/cli compose -i
162
49
  ```
163
50
 
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
51
+ Run the eval baseline:
189
52
 
190
53
  ```bash
191
- pnpm cli:build
54
+ npx @kat-ai/cli eval \
55
+ --assistant my-assistant \
56
+ --endpoint http://localhost:3000/api/chat \
57
+ --baseline
192
58
  ```
193
59
 
194
- ### Development Mode (watch)
195
-
196
- ```bash
197
- pnpm cli:dev
198
- ```
60
+ ## Commands
199
61
 
200
- ### Run locally
62
+ - `generate`: scaffold a new KAT application
63
+ - `introspect`: derive manifests from an existing Pinecone Assistant
64
+ - `compose`: build manifests interactively
65
+ - `sync`: sync local manifests and Pinecone state
66
+ - `validate`: validate data and manifest inputs
67
+ - `ingest`: optional CSV ingestion workflow
68
+ - `topics`: inspect topic extraction behavior
69
+ - `eval`: run introspection, retrieval, and agent evaluation
201
70
 
202
- ```bash
203
- # After building
204
- node packages/cli/dist/index.js
71
+ ## Related Packages
205
72
 
206
- # Or with tsx (development)
207
- pnpm cli:legacy
208
- ```
73
+ - `@kat-ai/sdk`: core runtime and server-side integration helpers
74
+ - `@kat-ai/react`: React components for citations and follow-up options
75
+ - `@kat-ai/eval`: programmatic evaluation APIs used by `kat eval`
209
76
 
210
- ## License
77
+ ## Docs
211
78
 
212
- MIT
79
+ - Repository: [github.com/pinecone-io/KAT](https://github.com/pinecone-io/KAT)
80
+ - CLI docs: [docs-site/docs/cli](https://github.com/pinecone-io/KAT/tree/main/docs-site/docs/cli)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kat-ai/cli",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "CLI for KAT ingestion, composition, introspection, and evaluation workflows",
5
5
  "type": "module",
6
6
  "bin": {
@@ -29,8 +29,8 @@
29
29
  "dotenv": "^17.2.3",
30
30
  "natural": "^8.0.1",
31
31
  "zod": "^3.23.0",
32
- "@kat-ai/sdk": "0.1.0",
33
- "@kat-ai/eval": "0.1.0"
32
+ "@kat-ai/eval": "0.1.1",
33
+ "@kat-ai/sdk": "0.1.1"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@types/natural": "^5.1.5",