WeKnora/cli/cmd/kb
nullkey f89d54362d feat(cli): doc/kb resource expansion — upload flags + list filters + view fields
Closes deep-tuning gaps in v0.4-shipped doc / kb / session commands.
Each command had multiple SDK fields the CLI silently hardcoded or
omitted; this commit threads them through.

doc upload:
- --enable-multimodel (tri-state via NoOptDefVal): toggle multimodal
  extraction (PDF/DOCX image-to-text) per upload. Empty explicit
  value (e.g. --enable-multimodel="" from uninterpolated shell var)
  rejected as input.invalid_argument rather than silently coerced.
- --metadata key=value (repeatable): attach arbitrary metadata
- --channel <name> (default api, override for browser / wechat ingests)
- URL mode gains --title / --file-type / --tag-id; URL-only flags
  rejected with input.invalid_argument when used without --from-url

doc list filter flags:
- --keyword (server-side LIKE — case-sensitive per PG)
- --file-type / --source / --tag-id
- --start-time / --end-time (RFC3339)

search docs switches from client-side substring to server-side Keyword
via ListKnowledgeWithFilter — smaller wire payload, but case-sensitivity
shifts (documented in CHANGELOG + help text + Long).

MCP doc_list schema gains the same 6 filter fields (parity with CLI).

session view --full + --limit: loads chat history via LoadMessages SDK
method.

kb view human KV expanded: type / pinned / temporary / processing
state + count / summary model / created timestamp. All omit-empty.

doc view human KV expanded: title (when distinct from filename) /
description / source / channel / summary_status / enable_status /
tag_id / storage (human bytes) / file_hash (12-char prefix).
2026-05-16 16:56:33 +08:00
..
create.go refactor(cli): drop aiclient package; align AGENTS.md with mainstream 2026-05-15 12:03:56 +08:00
create_test.go refactor(cli): drop --dry-run + introduce bare-JSON output path 2026-05-15 12:03:56 +08:00
delete.go refactor(cli): drop aiclient package; align AGENTS.md with mainstream 2026-05-15 12:03:56 +08:00
delete_test.go refactor(cli): drop aiclient package; align AGENTS.md with mainstream 2026-05-15 12:03:56 +08:00
edit.go refactor(cli): drop aiclient package; align AGENTS.md with mainstream 2026-05-15 12:03:56 +08:00
edit_test.go chore(cli): gofmt sweep 2026-05-15 12:03:56 +08:00
empty.go refactor(cli): drop aiclient package; align AGENTS.md with mainstream 2026-05-15 12:03:56 +08:00
empty_test.go chore(cli): gofmt sweep 2026-05-15 12:03:56 +08:00
kb.go refactor(cli): v0.3 cross-cutting cleanup 2026-05-14 10:57:17 +08:00
list.go refactor(cli): drop aiclient package; align AGENTS.md with mainstream 2026-05-15 12:03:56 +08:00
list_test.go refactor(cli): drop --dry-run + introduce bare-JSON output path 2026-05-15 12:03:56 +08:00
pin.go refactor(cli): drop aiclient package; align AGENTS.md with mainstream 2026-05-15 12:03:56 +08:00
pin_test.go refactor(cli): drop --dry-run + introduce bare-JSON output path 2026-05-15 12:03:56 +08:00
view.go feat(cli): doc/kb resource expansion — upload flags + list filters + view fields 2026-05-16 16:56:33 +08:00
view_test.go feat(cli): doc/kb resource expansion — upload flags + list filters + view fields 2026-05-16 16:56:33 +08:00