appxen 0.1.0__tar.gz
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.
- appxen-0.1.0/.gitignore +51 -0
- appxen-0.1.0/PKG-INFO +338 -0
- appxen-0.1.0/README.md +324 -0
- appxen-0.1.0/pyproject.toml +28 -0
- appxen-0.1.0/src/appxen_cli/__init__.py +3 -0
- appxen-0.1.0/src/appxen_cli/client.py +119 -0
- appxen-0.1.0/src/appxen_cli/commands/__init__.py +0 -0
- appxen-0.1.0/src/appxen_cli/commands/ingest.py +140 -0
- appxen-0.1.0/src/appxen_cli/commands/login.py +36 -0
- appxen-0.1.0/src/appxen_cli/commands/search.py +35 -0
- appxen-0.1.0/src/appxen_cli/commands/sources.py +76 -0
- appxen-0.1.0/src/appxen_cli/commands/stats.py +32 -0
- appxen-0.1.0/src/appxen_cli/commands/status.py +45 -0
- appxen-0.1.0/src/appxen_cli/config.py +89 -0
- appxen-0.1.0/src/appxen_cli/display.py +104 -0
- appxen-0.1.0/src/appxen_cli/main.py +60 -0
- appxen-0.1.0/tests/__init__.py +0 -0
- appxen-0.1.0/tests/conftest.py +16 -0
- appxen-0.1.0/tests/test_client.py +75 -0
- appxen-0.1.0/tests/test_commands/__init__.py +0 -0
- appxen-0.1.0/tests/test_commands/test_ingest.py +88 -0
- appxen-0.1.0/tests/test_commands/test_login.py +37 -0
- appxen-0.1.0/tests/test_commands/test_search.py +50 -0
- appxen-0.1.0/tests/test_commands/test_sources.py +52 -0
- appxen-0.1.0/tests/test_commands/test_stats.py +51 -0
- appxen-0.1.0/tests/test_commands/test_status.py +36 -0
- appxen-0.1.0/tests/test_config.py +74 -0
appxen-0.1.0/.gitignore
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Dependencies
|
|
2
|
+
node_modules/
|
|
3
|
+
|
|
4
|
+
# Build outputs
|
|
5
|
+
website/dist/
|
|
6
|
+
*.log
|
|
7
|
+
|
|
8
|
+
# OS files
|
|
9
|
+
.DS_Store
|
|
10
|
+
Thumbs.db
|
|
11
|
+
|
|
12
|
+
# IDE
|
|
13
|
+
.idea/
|
|
14
|
+
.vscode/
|
|
15
|
+
*.swp
|
|
16
|
+
*.swo
|
|
17
|
+
|
|
18
|
+
# Environment
|
|
19
|
+
.env
|
|
20
|
+
.env.local
|
|
21
|
+
.env.*.local
|
|
22
|
+
|
|
23
|
+
# Astro
|
|
24
|
+
.astro/
|
|
25
|
+
|
|
26
|
+
# Debug
|
|
27
|
+
npm-debug.log*
|
|
28
|
+
yarn-debug.log*
|
|
29
|
+
yarn-error.log*
|
|
30
|
+
|
|
31
|
+
# Firebase
|
|
32
|
+
firebase-debug.log
|
|
33
|
+
.firebase/
|
|
34
|
+
|
|
35
|
+
# Packer
|
|
36
|
+
*.box
|
|
37
|
+
packer_cache/
|
|
38
|
+
|
|
39
|
+
# Python
|
|
40
|
+
__pycache__/
|
|
41
|
+
*.pyc
|
|
42
|
+
*.pyo
|
|
43
|
+
.venv/
|
|
44
|
+
*.egg-info/
|
|
45
|
+
dist/
|
|
46
|
+
|
|
47
|
+
# AWS
|
|
48
|
+
.aws-sam/
|
|
49
|
+
|
|
50
|
+
# Worktrees
|
|
51
|
+
.worktrees/
|
appxen-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: appxen
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: AppXen CLI — manage your MCP Gateway and RAG Engine from the terminal
|
|
5
|
+
Author-email: AppXen <support@appxen.ai>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Requires-Python: >=3.10
|
|
8
|
+
Requires-Dist: httpx>=0.27.0
|
|
9
|
+
Requires-Dist: rich>=13.0.0
|
|
10
|
+
Requires-Dist: tomli-w>=1.0.0
|
|
11
|
+
Requires-Dist: tomli>=2.0.0; python_version < '3.11'
|
|
12
|
+
Requires-Dist: typer>=0.15.0
|
|
13
|
+
Description-Content-Type: text/markdown
|
|
14
|
+
|
|
15
|
+
# AppXen CLI
|
|
16
|
+
|
|
17
|
+
Command-line tool for managing your AppXen MCP Gateway and RAG Engine. Ingest documents, search your knowledge base, and manage sources — all from the terminal.
|
|
18
|
+
|
|
19
|
+
## Install
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
curl -sSL https://appxen.ai/install.sh | sh
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Or install directly with pip:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
pip install https://appxen.ai/releases/appxen-0.1.0-py3-none-any.whl
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
For local development:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
pip install -e products/appxen-cli/
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Requires Python 3.10+.
|
|
38
|
+
|
|
39
|
+
## Quick Start
|
|
40
|
+
|
|
41
|
+
### 1. Log in with your API key
|
|
42
|
+
|
|
43
|
+
Get an API key from the [AppXen Console](https://console.appxen.ai) under **API Keys**, then:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
appxen login
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
You'll be prompted for your key (input is hidden). The CLI validates the key format (`axgw_*`) and tests connectivity before saving.
|
|
50
|
+
|
|
51
|
+
Your key is stored in `~/.config/appxen/config.toml` with `0600` permissions.
|
|
52
|
+
|
|
53
|
+
### 2. Check connectivity
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
appxen status
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
Endpoint: https://api.appxen.ai
|
|
61
|
+
Service: mcp-gateway-pro
|
|
62
|
+
Version: 0.1.0
|
|
63
|
+
Status: Connected
|
|
64
|
+
RAG: 12 sources, 347 chunks
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### 3. Ingest documents
|
|
68
|
+
|
|
69
|
+
Single file:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
appxen ingest ./report.pdf
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Entire directory (recursive by default):
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
appxen ingest ./docs/
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
The CLI uploads each file, then polls until ingestion completes (chunking, embedding, indexing). You'll see progress bars for both stages:
|
|
82
|
+
|
|
83
|
+
```
|
|
84
|
+
Found 14 file(s) to ingest.
|
|
85
|
+
Uploading architecture.pdf ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 14/14
|
|
86
|
+
Waiting for 14 file(s) to process...
|
|
87
|
+
Processing architecture.pdf ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 14/14
|
|
88
|
+
|
|
89
|
+
OK 14 file(s) ingested successfully.
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### 4. Search
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
appxen search "how does authentication work"
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
```
|
|
99
|
+
╭──────────── #1 auth-design.md (score: 0.847) ────────────╮
|
|
100
|
+
│ Authentication uses passkeys (WebAuthn) as the primary │
|
|
101
|
+
│ method with magic link email as a fallback... │
|
|
102
|
+
╰──────────────────────── chunk: a1b2c3d4-e5f ─────────────╯
|
|
103
|
+
╭──────────── #2 api-keys.md (score: 0.723) ────────────────╮
|
|
104
|
+
│ API keys use the format axgw_{mode}_{version}_{hex} and │
|
|
105
|
+
│ are stored as SHA-256 hashes in DynamoDB... │
|
|
106
|
+
╰──────────────────────── chunk: f6g7h8i9-j0k ─────────────╯
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Commands
|
|
110
|
+
|
|
111
|
+
### `appxen login`
|
|
112
|
+
|
|
113
|
+
Save your API key to the local config.
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
appxen login # default profile, production endpoint
|
|
117
|
+
appxen login --profile staging # named profile
|
|
118
|
+
appxen login --endpoint http://localhost:8080 # custom endpoint
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
| Option | Short | Default | Description |
|
|
122
|
+
|--------|-------|---------|-------------|
|
|
123
|
+
| `--profile` | `-p` | `default` | Profile name |
|
|
124
|
+
| `--endpoint` | `-e` | `https://api.appxen.ai` | Gateway endpoint |
|
|
125
|
+
|
|
126
|
+
### `appxen status`
|
|
127
|
+
|
|
128
|
+
Check connectivity, show gateway info and RAG stats.
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
appxen status
|
|
132
|
+
appxen status --json # machine-readable output
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### `appxen ingest <path>`
|
|
136
|
+
|
|
137
|
+
Upload files to the RAG knowledge base. Accepts a single file or a directory.
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
appxen ingest ./report.pdf # single file
|
|
141
|
+
appxen ingest ./docs/ # directory (recursive)
|
|
142
|
+
appxen ingest ./docs/ --glob "*.md" # only markdown files
|
|
143
|
+
appxen ingest ./docs/ --no-recursive # top-level only
|
|
144
|
+
appxen ingest ./docs/ --no-poll # upload and exit (don't wait)
|
|
145
|
+
appxen ingest ./docs/ --json # JSON output (implies --no-poll)
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
| Option | Short | Default | Description |
|
|
149
|
+
|--------|-------|---------|-------------|
|
|
150
|
+
| `--glob` | `-g` | `*` | Glob pattern for filtering files in a directory |
|
|
151
|
+
| `--recursive / --no-recursive` | | `--recursive` | Recurse into subdirectories |
|
|
152
|
+
| `--poll / --no-poll` | | `--poll` | Wait for ingestion to complete |
|
|
153
|
+
| `--json` | | `false` | Output raw JSON results |
|
|
154
|
+
|
|
155
|
+
**Supported file types:**
|
|
156
|
+
|
|
157
|
+
| Category | Extensions |
|
|
158
|
+
|----------|------------|
|
|
159
|
+
| Documents | `.pdf` `.docx` `.html` `.htm` `.md` `.txt` `.csv` `.json` `.xml` `.yaml` `.yml` |
|
|
160
|
+
| Code | `.py` `.js` `.ts` `.jsx` `.tsx` `.css` `.sql` `.sh` `.rs` `.go` `.java` `.c` `.cpp` `.h` `.rb` `.php` |
|
|
161
|
+
| Images (OCR) | `.png` `.jpg` `.jpeg` `.tiff` `.bmp` |
|
|
162
|
+
|
|
163
|
+
Unsupported file types are silently skipped when scanning directories. The maximum file size is 100 MB.
|
|
164
|
+
|
|
165
|
+
**Exit codes:**
|
|
166
|
+
|
|
167
|
+
| Code | Meaning |
|
|
168
|
+
|------|---------|
|
|
169
|
+
| `0` | All files ingested successfully |
|
|
170
|
+
| `1` | Fatal error (no files found, not logged in, etc.) |
|
|
171
|
+
| `2` | Partial failure (some files failed) |
|
|
172
|
+
|
|
173
|
+
### `appxen search <query>`
|
|
174
|
+
|
|
175
|
+
Semantic search over your knowledge base.
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
appxen search "database schema design"
|
|
179
|
+
appxen search "error handling" --top-k 10
|
|
180
|
+
appxen search "deployment steps" --json
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
| Option | Short | Default | Description |
|
|
184
|
+
|--------|-------|---------|-------------|
|
|
185
|
+
| `--top-k` | `-k` | `5` | Number of results to return |
|
|
186
|
+
| `--json` | | `false` | Output raw JSON |
|
|
187
|
+
|
|
188
|
+
### `appxen sources`
|
|
189
|
+
|
|
190
|
+
List and manage knowledge base sources.
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
appxen sources # list all sources
|
|
194
|
+
appxen sources --status ready # filter by status
|
|
195
|
+
appxen sources --search "report" # filter by filename
|
|
196
|
+
appxen sources --limit 50 # more results
|
|
197
|
+
appxen sources --json # JSON output
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
| Option | Short | Default | Description |
|
|
201
|
+
|--------|-------|---------|-------------|
|
|
202
|
+
| `--status` | `-s` | | Filter by status (`ready`, `processing`, `queued`, `failed`) |
|
|
203
|
+
| `--search` | `-q` | | Filter by filename |
|
|
204
|
+
| `--limit` | `-n` | `20` | Results per page |
|
|
205
|
+
| `--offset` | | `0` | Pagination offset |
|
|
206
|
+
| `--json` | | `false` | Output raw JSON |
|
|
207
|
+
|
|
208
|
+
```
|
|
209
|
+
Sources (47 total)
|
|
210
|
+
┏━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┓
|
|
211
|
+
┃ ID ┃ Filename ┃ Status ┃ Chunks ┃ Created ┃
|
|
212
|
+
┡━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━┩
|
|
213
|
+
│ a1b2c3d4-e5f │ architecture.pdf │ ready │ 23 │ 2026-02-08T14:30:00 │
|
|
214
|
+
│ f6g7h8i9-j0k │ api-reference.md │ ready │ 8 │ 2026-02-08T14:28:00 │
|
|
215
|
+
│ ... │ ... │ ... │ ... │ ... │
|
|
216
|
+
└──────────────┴───────────────────────┴────────┴────────┴─────────────────────┘
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
### `appxen sources delete <source_id>`
|
|
220
|
+
|
|
221
|
+
Delete a source and all its chunks.
|
|
222
|
+
|
|
223
|
+
```bash
|
|
224
|
+
appxen sources delete a1b2c3d4-e5f6-7890-abcd-1234567890ab
|
|
225
|
+
appxen sources delete a1b2c3d4-e5f6-7890-abcd-1234567890ab --yes # skip confirmation
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
| Option | Short | Description |
|
|
229
|
+
|--------|-------|-------------|
|
|
230
|
+
| `--yes` | `-y` | Skip the confirmation prompt |
|
|
231
|
+
|
|
232
|
+
### `appxen stats`
|
|
233
|
+
|
|
234
|
+
Show knowledge base statistics.
|
|
235
|
+
|
|
236
|
+
```bash
|
|
237
|
+
appxen stats
|
|
238
|
+
appxen stats --json
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
```
|
|
242
|
+
╭──────────────────────── RAG Engine Stats ─────────────────────────╮
|
|
243
|
+
│ Sources: 47 │
|
|
244
|
+
│ Chunks: 1,203 │
|
|
245
|
+
│ Storage: 24.7 MB │
|
|
246
|
+
╰───────────────────────────────────────────────────────────────────╯
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
## Configuration
|
|
250
|
+
|
|
251
|
+
### Config file
|
|
252
|
+
|
|
253
|
+
Stored at `~/.config/appxen/config.toml`:
|
|
254
|
+
|
|
255
|
+
```toml
|
|
256
|
+
[default]
|
|
257
|
+
api_key = "axgw_live_k1_..."
|
|
258
|
+
endpoint = "https://api.appxen.ai"
|
|
259
|
+
|
|
260
|
+
[staging]
|
|
261
|
+
api_key = "axgw_test_k1_..."
|
|
262
|
+
endpoint = "https://staging-api.appxen.ai"
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
Switch profiles with `--profile`:
|
|
266
|
+
|
|
267
|
+
```bash
|
|
268
|
+
appxen --profile staging sources
|
|
269
|
+
appxen -p staging search "test query"
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
### Environment variables
|
|
273
|
+
|
|
274
|
+
Environment variables override the config file:
|
|
275
|
+
|
|
276
|
+
| Variable | Description |
|
|
277
|
+
|----------|-------------|
|
|
278
|
+
| `APPXEN_API_KEY` | API key (overrides config file) |
|
|
279
|
+
| `APPXEN_ENDPOINT` | Gateway endpoint (overrides config file) |
|
|
280
|
+
| `APPXEN_PROFILE` | Default profile name (default: `default`) |
|
|
281
|
+
|
|
282
|
+
```bash
|
|
283
|
+
# One-off command against local dev stack
|
|
284
|
+
APPXEN_API_KEY=axgw_test_k1_abc123 APPXEN_ENDPOINT=http://localhost:8080 appxen status
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
## JSON Output
|
|
288
|
+
|
|
289
|
+
Every command supports `--json` for scripting and piping:
|
|
290
|
+
|
|
291
|
+
```bash
|
|
292
|
+
# Get source IDs for all ready sources
|
|
293
|
+
appxen sources --json | jq '.sources[] | select(.status == "ready") | .source_id'
|
|
294
|
+
|
|
295
|
+
# Count chunks across all sources
|
|
296
|
+
appxen stats --json | jq '.chunk_count'
|
|
297
|
+
|
|
298
|
+
# Ingest and capture results
|
|
299
|
+
appxen ingest ./docs/ --json | jq '.[] | {file, status, source_id}'
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
## Examples
|
|
303
|
+
|
|
304
|
+
### Ingest a project's documentation
|
|
305
|
+
|
|
306
|
+
```bash
|
|
307
|
+
appxen ingest ./docs/ --glob "*.md" --recursive
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
### Ingest only PDFs from a folder
|
|
311
|
+
|
|
312
|
+
```bash
|
|
313
|
+
appxen ingest ./reports/ --glob "*.pdf"
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
### Search and get raw JSON for processing
|
|
317
|
+
|
|
318
|
+
```bash
|
|
319
|
+
appxen search "error handling patterns" --top-k 20 --json
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
### Delete all failed sources
|
|
323
|
+
|
|
324
|
+
```bash
|
|
325
|
+
appxen sources --status failed --json \
|
|
326
|
+
| jq -r '.sources[].source_id' \
|
|
327
|
+
| xargs -I{} appxen sources delete {} --yes
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
### Use in CI/CD
|
|
331
|
+
|
|
332
|
+
```bash
|
|
333
|
+
export APPXEN_API_KEY=${{ secrets.APPXEN_API_KEY }}
|
|
334
|
+
export APPXEN_ENDPOINT=https://api.appxen.ai
|
|
335
|
+
|
|
336
|
+
# Sync docs on every deploy
|
|
337
|
+
appxen ingest ./docs/ --glob "*.md"
|
|
338
|
+
```
|
appxen-0.1.0/README.md
ADDED
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
# AppXen CLI
|
|
2
|
+
|
|
3
|
+
Command-line tool for managing your AppXen MCP Gateway and RAG Engine. Ingest documents, search your knowledge base, and manage sources — all from the terminal.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
curl -sSL https://appxen.ai/install.sh | sh
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Or install directly with pip:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
pip install https://appxen.ai/releases/appxen-0.1.0-py3-none-any.whl
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
For local development:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
pip install -e products/appxen-cli/
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Requires Python 3.10+.
|
|
24
|
+
|
|
25
|
+
## Quick Start
|
|
26
|
+
|
|
27
|
+
### 1. Log in with your API key
|
|
28
|
+
|
|
29
|
+
Get an API key from the [AppXen Console](https://console.appxen.ai) under **API Keys**, then:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
appxen login
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
You'll be prompted for your key (input is hidden). The CLI validates the key format (`axgw_*`) and tests connectivity before saving.
|
|
36
|
+
|
|
37
|
+
Your key is stored in `~/.config/appxen/config.toml` with `0600` permissions.
|
|
38
|
+
|
|
39
|
+
### 2. Check connectivity
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
appxen status
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
Endpoint: https://api.appxen.ai
|
|
47
|
+
Service: mcp-gateway-pro
|
|
48
|
+
Version: 0.1.0
|
|
49
|
+
Status: Connected
|
|
50
|
+
RAG: 12 sources, 347 chunks
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### 3. Ingest documents
|
|
54
|
+
|
|
55
|
+
Single file:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
appxen ingest ./report.pdf
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Entire directory (recursive by default):
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
appxen ingest ./docs/
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
The CLI uploads each file, then polls until ingestion completes (chunking, embedding, indexing). You'll see progress bars for both stages:
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
Found 14 file(s) to ingest.
|
|
71
|
+
Uploading architecture.pdf ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 14/14
|
|
72
|
+
Waiting for 14 file(s) to process...
|
|
73
|
+
Processing architecture.pdf ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 14/14
|
|
74
|
+
|
|
75
|
+
OK 14 file(s) ingested successfully.
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### 4. Search
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
appxen search "how does authentication work"
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
╭──────────── #1 auth-design.md (score: 0.847) ────────────╮
|
|
86
|
+
│ Authentication uses passkeys (WebAuthn) as the primary │
|
|
87
|
+
│ method with magic link email as a fallback... │
|
|
88
|
+
╰──────────────────────── chunk: a1b2c3d4-e5f ─────────────╯
|
|
89
|
+
╭──────────── #2 api-keys.md (score: 0.723) ────────────────╮
|
|
90
|
+
│ API keys use the format axgw_{mode}_{version}_{hex} and │
|
|
91
|
+
│ are stored as SHA-256 hashes in DynamoDB... │
|
|
92
|
+
╰──────────────────────── chunk: f6g7h8i9-j0k ─────────────╯
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Commands
|
|
96
|
+
|
|
97
|
+
### `appxen login`
|
|
98
|
+
|
|
99
|
+
Save your API key to the local config.
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
appxen login # default profile, production endpoint
|
|
103
|
+
appxen login --profile staging # named profile
|
|
104
|
+
appxen login --endpoint http://localhost:8080 # custom endpoint
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
| Option | Short | Default | Description |
|
|
108
|
+
|--------|-------|---------|-------------|
|
|
109
|
+
| `--profile` | `-p` | `default` | Profile name |
|
|
110
|
+
| `--endpoint` | `-e` | `https://api.appxen.ai` | Gateway endpoint |
|
|
111
|
+
|
|
112
|
+
### `appxen status`
|
|
113
|
+
|
|
114
|
+
Check connectivity, show gateway info and RAG stats.
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
appxen status
|
|
118
|
+
appxen status --json # machine-readable output
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### `appxen ingest <path>`
|
|
122
|
+
|
|
123
|
+
Upload files to the RAG knowledge base. Accepts a single file or a directory.
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
appxen ingest ./report.pdf # single file
|
|
127
|
+
appxen ingest ./docs/ # directory (recursive)
|
|
128
|
+
appxen ingest ./docs/ --glob "*.md" # only markdown files
|
|
129
|
+
appxen ingest ./docs/ --no-recursive # top-level only
|
|
130
|
+
appxen ingest ./docs/ --no-poll # upload and exit (don't wait)
|
|
131
|
+
appxen ingest ./docs/ --json # JSON output (implies --no-poll)
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
| Option | Short | Default | Description |
|
|
135
|
+
|--------|-------|---------|-------------|
|
|
136
|
+
| `--glob` | `-g` | `*` | Glob pattern for filtering files in a directory |
|
|
137
|
+
| `--recursive / --no-recursive` | | `--recursive` | Recurse into subdirectories |
|
|
138
|
+
| `--poll / --no-poll` | | `--poll` | Wait for ingestion to complete |
|
|
139
|
+
| `--json` | | `false` | Output raw JSON results |
|
|
140
|
+
|
|
141
|
+
**Supported file types:**
|
|
142
|
+
|
|
143
|
+
| Category | Extensions |
|
|
144
|
+
|----------|------------|
|
|
145
|
+
| Documents | `.pdf` `.docx` `.html` `.htm` `.md` `.txt` `.csv` `.json` `.xml` `.yaml` `.yml` |
|
|
146
|
+
| Code | `.py` `.js` `.ts` `.jsx` `.tsx` `.css` `.sql` `.sh` `.rs` `.go` `.java` `.c` `.cpp` `.h` `.rb` `.php` |
|
|
147
|
+
| Images (OCR) | `.png` `.jpg` `.jpeg` `.tiff` `.bmp` |
|
|
148
|
+
|
|
149
|
+
Unsupported file types are silently skipped when scanning directories. The maximum file size is 100 MB.
|
|
150
|
+
|
|
151
|
+
**Exit codes:**
|
|
152
|
+
|
|
153
|
+
| Code | Meaning |
|
|
154
|
+
|------|---------|
|
|
155
|
+
| `0` | All files ingested successfully |
|
|
156
|
+
| `1` | Fatal error (no files found, not logged in, etc.) |
|
|
157
|
+
| `2` | Partial failure (some files failed) |
|
|
158
|
+
|
|
159
|
+
### `appxen search <query>`
|
|
160
|
+
|
|
161
|
+
Semantic search over your knowledge base.
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
appxen search "database schema design"
|
|
165
|
+
appxen search "error handling" --top-k 10
|
|
166
|
+
appxen search "deployment steps" --json
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
| Option | Short | Default | Description |
|
|
170
|
+
|--------|-------|---------|-------------|
|
|
171
|
+
| `--top-k` | `-k` | `5` | Number of results to return |
|
|
172
|
+
| `--json` | | `false` | Output raw JSON |
|
|
173
|
+
|
|
174
|
+
### `appxen sources`
|
|
175
|
+
|
|
176
|
+
List and manage knowledge base sources.
|
|
177
|
+
|
|
178
|
+
```bash
|
|
179
|
+
appxen sources # list all sources
|
|
180
|
+
appxen sources --status ready # filter by status
|
|
181
|
+
appxen sources --search "report" # filter by filename
|
|
182
|
+
appxen sources --limit 50 # more results
|
|
183
|
+
appxen sources --json # JSON output
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
| Option | Short | Default | Description |
|
|
187
|
+
|--------|-------|---------|-------------|
|
|
188
|
+
| `--status` | `-s` | | Filter by status (`ready`, `processing`, `queued`, `failed`) |
|
|
189
|
+
| `--search` | `-q` | | Filter by filename |
|
|
190
|
+
| `--limit` | `-n` | `20` | Results per page |
|
|
191
|
+
| `--offset` | | `0` | Pagination offset |
|
|
192
|
+
| `--json` | | `false` | Output raw JSON |
|
|
193
|
+
|
|
194
|
+
```
|
|
195
|
+
Sources (47 total)
|
|
196
|
+
┏━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┓
|
|
197
|
+
┃ ID ┃ Filename ┃ Status ┃ Chunks ┃ Created ┃
|
|
198
|
+
┡━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━┩
|
|
199
|
+
│ a1b2c3d4-e5f │ architecture.pdf │ ready │ 23 │ 2026-02-08T14:30:00 │
|
|
200
|
+
│ f6g7h8i9-j0k │ api-reference.md │ ready │ 8 │ 2026-02-08T14:28:00 │
|
|
201
|
+
│ ... │ ... │ ... │ ... │ ... │
|
|
202
|
+
└──────────────┴───────────────────────┴────────┴────────┴─────────────────────┘
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
### `appxen sources delete <source_id>`
|
|
206
|
+
|
|
207
|
+
Delete a source and all its chunks.
|
|
208
|
+
|
|
209
|
+
```bash
|
|
210
|
+
appxen sources delete a1b2c3d4-e5f6-7890-abcd-1234567890ab
|
|
211
|
+
appxen sources delete a1b2c3d4-e5f6-7890-abcd-1234567890ab --yes # skip confirmation
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
| Option | Short | Description |
|
|
215
|
+
|--------|-------|-------------|
|
|
216
|
+
| `--yes` | `-y` | Skip the confirmation prompt |
|
|
217
|
+
|
|
218
|
+
### `appxen stats`
|
|
219
|
+
|
|
220
|
+
Show knowledge base statistics.
|
|
221
|
+
|
|
222
|
+
```bash
|
|
223
|
+
appxen stats
|
|
224
|
+
appxen stats --json
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
```
|
|
228
|
+
╭──────────────────────── RAG Engine Stats ─────────────────────────╮
|
|
229
|
+
│ Sources: 47 │
|
|
230
|
+
│ Chunks: 1,203 │
|
|
231
|
+
│ Storage: 24.7 MB │
|
|
232
|
+
╰───────────────────────────────────────────────────────────────────╯
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
## Configuration
|
|
236
|
+
|
|
237
|
+
### Config file
|
|
238
|
+
|
|
239
|
+
Stored at `~/.config/appxen/config.toml`:
|
|
240
|
+
|
|
241
|
+
```toml
|
|
242
|
+
[default]
|
|
243
|
+
api_key = "axgw_live_k1_..."
|
|
244
|
+
endpoint = "https://api.appxen.ai"
|
|
245
|
+
|
|
246
|
+
[staging]
|
|
247
|
+
api_key = "axgw_test_k1_..."
|
|
248
|
+
endpoint = "https://staging-api.appxen.ai"
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
Switch profiles with `--profile`:
|
|
252
|
+
|
|
253
|
+
```bash
|
|
254
|
+
appxen --profile staging sources
|
|
255
|
+
appxen -p staging search "test query"
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
### Environment variables
|
|
259
|
+
|
|
260
|
+
Environment variables override the config file:
|
|
261
|
+
|
|
262
|
+
| Variable | Description |
|
|
263
|
+
|----------|-------------|
|
|
264
|
+
| `APPXEN_API_KEY` | API key (overrides config file) |
|
|
265
|
+
| `APPXEN_ENDPOINT` | Gateway endpoint (overrides config file) |
|
|
266
|
+
| `APPXEN_PROFILE` | Default profile name (default: `default`) |
|
|
267
|
+
|
|
268
|
+
```bash
|
|
269
|
+
# One-off command against local dev stack
|
|
270
|
+
APPXEN_API_KEY=axgw_test_k1_abc123 APPXEN_ENDPOINT=http://localhost:8080 appxen status
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
## JSON Output
|
|
274
|
+
|
|
275
|
+
Every command supports `--json` for scripting and piping:
|
|
276
|
+
|
|
277
|
+
```bash
|
|
278
|
+
# Get source IDs for all ready sources
|
|
279
|
+
appxen sources --json | jq '.sources[] | select(.status == "ready") | .source_id'
|
|
280
|
+
|
|
281
|
+
# Count chunks across all sources
|
|
282
|
+
appxen stats --json | jq '.chunk_count'
|
|
283
|
+
|
|
284
|
+
# Ingest and capture results
|
|
285
|
+
appxen ingest ./docs/ --json | jq '.[] | {file, status, source_id}'
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
## Examples
|
|
289
|
+
|
|
290
|
+
### Ingest a project's documentation
|
|
291
|
+
|
|
292
|
+
```bash
|
|
293
|
+
appxen ingest ./docs/ --glob "*.md" --recursive
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
### Ingest only PDFs from a folder
|
|
297
|
+
|
|
298
|
+
```bash
|
|
299
|
+
appxen ingest ./reports/ --glob "*.pdf"
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
### Search and get raw JSON for processing
|
|
303
|
+
|
|
304
|
+
```bash
|
|
305
|
+
appxen search "error handling patterns" --top-k 20 --json
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
### Delete all failed sources
|
|
309
|
+
|
|
310
|
+
```bash
|
|
311
|
+
appxen sources --status failed --json \
|
|
312
|
+
| jq -r '.sources[].source_id' \
|
|
313
|
+
| xargs -I{} appxen sources delete {} --yes
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
### Use in CI/CD
|
|
317
|
+
|
|
318
|
+
```bash
|
|
319
|
+
export APPXEN_API_KEY=${{ secrets.APPXEN_API_KEY }}
|
|
320
|
+
export APPXEN_ENDPOINT=https://api.appxen.ai
|
|
321
|
+
|
|
322
|
+
# Sync docs on every deploy
|
|
323
|
+
appxen ingest ./docs/ --glob "*.md"
|
|
324
|
+
```
|