The knowledge-studio CLI provides terminal-based automation for managing your knowledge base. It uses the same repository layer as the browser app but runs in Node.js via better-sqlite3.
| Flag | Description | Default |
|---|---|---|
--db-path <path> |
Custom path to SQLite database file | ~/.local/share/do-knowledge-studio/data.db |
--version |
Show version number | — |
--help |
Show help for any command | — |
Run any command with pnpm run cli -- <command> [args] [options].
Initialize the workspace. Creates the ./export directory if it doesn't exist.
pnpm run cli -- initSync data from a directory of Markdown files or a URL into the database.
Arguments:
<source>— Directory path or HTTP(S) URL
From a directory: Reads all .md files. The first H1 heading becomes the entity name. Entities are created as type concept.
pnpm run cli -- sync ./path/to/markdown/filesFrom a URL: Fetches content via Jina AI reader (cross-origin) or direct fetch (same-origin). Creates an entity with the page title and content.
pnpm run cli -- sync https://example.com/articleExport the knowledge base to various formats.
Options:
| Flag | Description | Default |
|---|---|---|
-f, --format <format> |
Export format: md, json, or site |
md |
-o, --output <dir> |
Output directory | ./export |
# Markdown — one file per entity
pnpm run cli -- export --format md --output ./export/markdown
# JSON — single knowledge.json file
pnpm run cli -- export --format json --output ./export/json
# Static site — portable HTML file
pnpm run cli -- export --format site --output ./export/siteFull-text search across entities using FTS5.
pnpm run cli -- search "artificial intelligence"Create a new entity.
Options:
| Flag | Description | Default |
|---|---|---|
-t, --type <type> |
Entity type | concept |
-d, --description <text> |
Entity description | — |
-u, --source-url <url> |
Source URL for auto-hydration | — |
pnpm run cli -- entity-create "TRIZ" --type concept --description "Theory of Inventive Problem Solving"
# Auto-hydrate description from URL
pnpm run cli -- entity-create "TRIZ" --source-url https://en.wikipedia.org/wiki/TRIZList all entities in the database.
pnpm run cli -- entity-listOutput: [type] name per line.
Get detailed information about an entity by name.
pnpm run cli -- entity-get "TRIZ"Update an entity's type or description.
Options:
| Flag | Description |
|---|---|
-t, --type <type> |
New entity type |
-d, --description <text> |
New description |
pnpm run cli -- entity-update "TRIZ" --type methodology --description "Updated description"Delete an entity and all its cascading data (claims, notes, links).
pnpm run cli -- entity-delete "Old Entity"Create a claim (assertion) about an entity.
Options:
| Flag | Description | Default |
|---|---|---|
-c, --confidence <value> |
Confidence score (0.0–1.0) | 1.0 |
pnpm run cli -- claim-create "TRIZ" "TRIZ was developed by Genrich Altshuller" --confidence 0.95Create a relationship link between two entities.
Options:
| Flag | Description | Default |
|---|---|---|
-r, --relation <type> |
Relation type | related |
pnpm run cli -- link-create "TRIZ" "Genrich Altshuller" --relation "created_by"List all links in the database.
pnpm run cli -- link-listOutput: [id] source --[relation]--> target per line.
Delete a link by its ID.
pnpm run cli -- link-delete <link-id>Create a note attached to an entity.
pnpm run cli -- note-create "TRIZ" "Key insight: contradictions drive innovation"List all notes for an entity.
pnpm run cli -- note-list "TRIZ"List all saved graph snapshots.
pnpm run cli -- snapshot-listRun pending database migrations.
pnpm run cli -- db:migrateRoll back the last applied migration.
pnpm run cli -- db:rollbackShow the status of all migrations (applied or pending).
pnpm run cli -- db:statusCreate a backup of the SQLite database using VACUUM INTO.
pnpm run cli -- db:backup # Default: .studio-cli-backup-<timestamp>.db
pnpm run cli -- db:backup ./backups/my.db # Custom pathDestructive. Drop all tables and re-run the schema from scratch.
pnpm run cli -- db:resetTo see CLI-created data in the browser app:
- Open the app in Chrome or Edge
- Go to AI Harness → click the Settings (gear) icon
- Click Connect Local Database
- Select the database directory (usually
~/.local/share/do-knowledge-studio/) - Reload the page when prompted
The browser synchronizes its OPFS storage with the data.db file in that directory.
| Problem | Solution |
|---|---|
Database not initialized |
Ensure --db-path points to a valid SQLite file, or run init first |
Entity not found |
Use entity-list to verify the entity name (case-sensitive) |
Sync found 0 files |
Ensure the directory contains .md files with H1 headings |
Backup failed |
Check write permissions for the output directory |