Skip to content

feat(#411): document CLI commands — uteke doc create/get/list/delete/export - #427

Merged
ajianaz merged 3 commits into
developfrom
feat/411-doc-cli
Jun 21, 2026
Merged

ajianaz merged 3 commits into
developfrom
feat/411-doc-cli

Conversation

@ajianaz

@ajianaz ajianaz commented Jun 21, 2026

Copy link
Copy Markdown
Collaborator

Implements #411. Depends on #406 (included via cherry-pick).

CLI Commands

# Create from file
uteke doc create getting-started --file guide.md --tags wiki,guide

# Create from inline content
uteke doc create notes --content "# Notes\n\nQuick notes" --title "My Notes"

# Get by slug or ID
uteke doc get getting-started

# List
uteke doc list --limit 20

# Delete
uteke doc delete <id>

# Export all
uteke doc export

All commands support --json and --namespace.
Title auto-derived from first # heading if not specified.

Milestone: v0.3.0 — Graph RAG

ajianaz added 2 commits June 21, 2026 21:29
…ema v11)

Core wiki/knowledge base engine for uteke.

Schema v11: documents + document_chunks tables.
Store layer: upsert, get, list, delete, chunk insertion.
Uteke API: doc_upsert (auto-chunk + embed), doc_get, doc_list, doc_delete.
3 unit tests: CRUD, version increment, namespace isolation.

Foundation for #411 (doc CLI commands).
…export

Add CLI commands for the document engine (#406):

  uteke doc create <slug> [--file path.md | --content "text"] [--title T] [--tags a,b]
  uteke doc get <slug-or-id>
  uteke doc list [--limit 20]
  uteke doc delete <id>
  uteke doc export [--output file]

All commands support --json output and --namespace flag.
Title auto-derived from first # heading if not specified.

Includes #406 document engine (cherry-picked for dependency).
@github-actions

github-actions Bot commented Jun 21, 2026 •

Copy link
Copy Markdown

🔍 Cora AI Code Review

❌ Blocked — critical issues found.

🔴 Error (5)

  • crates/uteke-cli/src/commands/doc.rs:55 — In the DocCommands::Create JSON branch, the code prints println!("{{\"id\": \"{id}\", \"slug\": \"{slug}\", \"status\": \"created\"}}"); directly. If id or slug contains characters that need JSON escaping, this produces invalid JSON and can break consumers of --json. Other commands in this codebase use output::print_json or serde_json for this reason.
  • crates/uteke-cli/src/commands/doc.rs:114 — The DocCommands::Delete JSON branch uses println!("{{\"deleted\": \"{id}\"}}");. As with the create path, this bypasses JSON escaping. A document ID containing quotes, backslashes, or control characters will produce malformed JSON output.
  • crates/uteke-cli/src/commands/doc.rs:126 — The DocCommands::Export match arm destructures output as output: _, and then always writes exported data to stdout. This makes the documented --output flag in cli.rs non-functional, which is a user-visible behavior bug tied directly to this diff.
  • crates/uteke-cli/src/commands/doc.rs:127 — The export command is documented in cli.rs as Export all documents as JSON, but the implementation calls uteke.doc_list(ns, 1000). Any namespace with more than 1000 documents will silently produce an incomplete export. This is both a functional bug and a data-loss risk for users relying on export for backup.
  • crates/uteke-cli/src/commands/doc.rs:134 — Inside the non-JSON export loop, uteke.doc_get(&d.id, ns).ok().flatten() converts any retrieval error into None and skips that document without reporting a problem. This can silently generate incomplete exports even when individual document fetches fail.

Review powered by cora-cli · BYOK · MIT

});

let tag_refs: Vec<&str> = tags.iter().map(|s| s.as_str()).collect();
let id = uteke
Comment thread crates/uteke-core/src/lib.rs Fixed
Comment thread crates/uteke-core/src/lib.rs Fixed
);
}
println!();
println!("{} document(s)", docs.len());
if cli.json {
println!("{{\"deleted\": \"{id}\"}}");
} else {
println!("\u{2713} Document deleted: {id}");
println!("{{\"deleted\": \"{id}\"}}");
} else {
println!("\u{2713} Document deleted: {id}");
}
}

DocCommands::Export { output: _ } => {
let docs = uteke
@ajianaz
ajianaz merged commit 06ec50e into develop Jun 21, 2026
8 of 9 checks passed
@ajianaz
ajianaz deleted the feat/411-doc-cli branch June 21, 2026 15:18
ajianaz added a commit that referenced this pull request Aug 13, 2026
…export (#427)

* feat(#406): document engine — documents + document_chunks tables (schema v11)

Core wiki/knowledge base engine for uteke.

Schema v11: documents + document_chunks tables.
Store layer: upsert, get, list, delete, chunk insertion.
Uteke API: doc_upsert (auto-chunk + embed), doc_get, doc_list, doc_delete.
3 unit tests: CRUD, version increment, namespace isolation.

Foundation for #411 (doc CLI commands).

* feat(#411): document CLI commands — uteke doc create/get/list/delete/export

Add CLI commands for the document engine (#406):

  uteke doc create <slug> [--file path.md | --content "text"] [--title T] [--tags a,b]
  uteke doc get <slug-or-id>
  uteke doc list [--limit 20]
  uteke doc delete <id>
  uteke doc export [--output file]

All commands support --json output and --namespace flag.
Title auto-derived from first # heading if not specified.

Includes #406 document engine (cherry-picked for dependency).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants