@ultrafilterai/ultrafilter-cli
v0.1.6
Published
Ultrafilter agent-first CLI (TypeScript rewrite)
Readme
Ultrafilter CLI
Ultrafilter CLI is the agent-first command surface for the Ultrafilter backend.
This repository is a standalone npm package. It is not a second backend. It is a thin orchestration layer over the same control-plane and public bucket APIs used by the Ultrafilter product.
Purpose
The CLI is designed for AI agents and automation systems that need to:
- authenticate with project-scoped API keys
- inspect shared work sessions created from either the dashboard or the CLI
- create and resume staged indexing sessions
- connect a bucket or upload a local folder
- choose what to index
- assign file types to text, image, pdf, or skip
- preview and run sync safely
- retrieve the final query endpoint
- use lower-level project, connector, mapping, sync, and search commands when debugging is required
Primary Workflow
The default workflow is uf index ....
Main commands:
uf auth key use <raw_key> --jsonuf auth key status --jsonuf session list --jsonuf session show <work_session_ref> --jsonuf index init --jsonuf index status --session <session_id> --jsonuf index source bucket --session <session_id> ... --jsonuf index source folder --session <session_id> --path <folder> --jsonuf index source verify --session <session_id> --jsonuf index select --session <session_id> ... --jsonuf index route --session <session_id> --route .txt=text --route .jpg=image --jsonuf index preview --session <session_id> --jsonuf index sync --session <session_id> [--confirm-deletes] --jsonuf index sync-start --session <session_id> [--confirm-deletes] --jsonuf index check --session <session_id> --jsonuf index endpoint --session <session_id> --json
The lower-level namespaces remain available:
uf project ...uf connector ...uf mapping ...uf sync ...uf search ...uf docs ...
Important auth rules:
- normal agent runtime should use API-key auth
uf connector createis API-key-safe and now routes through theindex_sessionsource flowuf connector verifyis still legacy session-only; agents should useuf index source verify --session <session_id>insteaduf session list/showis the shared visibility surface for dashboard and CLI workuf sync cleanis API-key-safe and removes indexed state while keeping the source configuration
Waiting vs Background Sync
Use the blocking sync command for small jobs:
uf index sync --session <session_id> --jsonUse background sync for larger jobs or when the agent should keep working:
uf index sync-start --session <session_id> --json
uf index check --session <session_id> --json
uf index endpoint --session <session_id> --jsonGuidance:
- small batches can use
uf index syncand wait - larger batches should use
uf index sync-start uf index checkis the progress command; agents can call it whenever they want without holding the original sync command open
Output Contract
For agent use, prefer --json.
The uf index ... commands return a structured envelope that includes:
okstagestage_statussessionauth_contextstatesummarywarningsmissing_requirementsnext_actionsartifacts
next_actions always contains exact runnable commands so an agent can continue without guessing.
Cleanup
Use the existing backend cleanup endpoint through the CLI when you want to wipe indexed state but keep the source.
Examples:
uf sync clean my-bucket --type text --confirm
uf sync clean my-bucket --all-types --confirmBehavior:
- keeps the connector or managed folder source definition
- deletes vectors for the selected type(s)
- deletes indexed manifests and source-object tracking for the selected type(s)
- does not delete the underlying R2 bucket or uploaded folder contents
Safety Rules
- do not use human email/password login for the normal agent workflow
- do not skip preview before sync
- do not confirm deletions unless intended
- do not guess ids; reuse the returned
session.id,connector_id, andsync_run_id - read
missing_requirementsandnext_actionsbefore deciding what to do next
Example
uf auth key use <raw-managed-api-key> --json
uf auth key status --json
uf session list --json
uf index init --json
uf index source bucket --session <session_id> --bucket-name my-bucket --provider r2 --region auto --access-key-id <id> --secret-access-key <secret> --json
uf index source verify --session <session_id> --json
uf index select --session <session_id> --include-ext .json --include-ext .jpg --json
uf index route --session <session_id> --route .json=text --route .jpg=image --json
uf index preview --session <session_id> --json
uf index sync --session <session_id> --json
uf index endpoint --session <session_id> --jsonDevelopment
Run from this package root:
npm install
npm run typecheck
npm test
npm run build
node dist/main.js --helpRead local docs:
node dist/main.js docs readme --plain
node dist/main.js docs skill --plainPublishing
Package name: @tuzhenzhao/ultrafilter-cli
Before publishing:
npm install
npm run typecheck
npm test
npm run build
npm pack --dry-run