WeKnora/cli/cmd
nullkey a2e368b1e8 refactor(cli): command-surface rename — session ask / doc fetch / doc create / doc delete --all
Three command renames consolidate the v0.7 verb table:

- `weknora agent invoke` → `weknora session ask --agent <id>`.
  Server route POST /sessions/{session_id}/agent-qa is session-
  anchored, so the verb moves with it. `weknora agent` subtree keeps
  CRUD only (list / view / create / edit / delete / status / check).
  SDK call (AgentQAStreamWithRequest) preserved verbatim; only the
  command surface + flag layout move.

- `weknora doc upload` split into three commands:
  - `weknora doc upload <file>`  — local file (only).
  - `weknora doc fetch <url>`    — server-side remote fetch (was
    `upload --from-url`). URL-only flags (--title / --file-type /
    --tag-id) move with the verb.
  - `weknora doc create --text`  — direct text knowledge entry via
    server CreateManualKnowledge.

- `weknora kb empty <id>` → `weknora doc delete --all --kb=<id>`.
  Atomic server ClearKnowledgeBaseContents (no list-then-delete
  race). Same exit-10 -y/--yes guard as other destructive verbs;
  unified through the extended ConfirmDestructive helper.

Parent commands (agent, kb, doc, chunk, session, auth, profile,
search) lose their explicit Args:NoArgs + Run:cmd.Help so the
unknown-subcommand guard fires correctly — `weknora agent invoke
ag_x q` now emits the typed input.unknown_subcommand envelope with
detail.available[] instead of cobra's free-form exit-2 prose.

Spec: docs/superpowers/specs/2026-05-20-weknora-cli-v0.7-design.md §3.4 / §10.7
2026-05-27 10:56:34 +08:00
..
agent refactor(cli): command-surface rename — session ask / doc fetch / doc create / doc delete --all 2026-05-27 10:56:34 +08:00
api refactor(cli): envelope sweep — Emit shape, batch ops, MCP StructuredContent, api flag cleanup 2026-05-27 10:56:34 +08:00
auth refactor(cli): envelope sweep — Emit shape, batch ops, MCP StructuredContent, api flag cleanup 2026-05-27 10:56:34 +08:00
chat feat(cli): --format / NDJSON / chat & agent invoke / MCP / SetAgentHelp / signal-aware ctx / kb create --storage-provider 2026-05-18 11:10:19 +08:00
chunk refactor(cli): envelope sweep — Emit shape, batch ops, MCP StructuredContent, api flag cleanup 2026-05-27 10:56:34 +08:00
context docs(cli): README / AGENTS.md / CHANGELOG + CI parity test 2026-05-18 11:10:19 +08:00
doc refactor(cli): command-surface rename — session ask / doc fetch / doc create / doc delete --all 2026-05-27 10:56:34 +08:00
doctor refactor(cli): envelope sweep — Emit shape, batch ops, MCP StructuredContent, api flag cleanup 2026-05-27 10:56:34 +08:00
kb refactor(cli): command-surface rename — session ask / doc fetch / doc create / doc delete --all 2026-05-27 10:56:34 +08:00
link feat(cli): --log-level + kb/agent status & check + cross-cutting refactor 2026-05-18 11:10:19 +08:00
mcp chore(cli): polish + docs sync + pre-PR audit fixes 2026-05-16 16:56:33 +08:00
search refactor(cli): envelope sweep — Emit shape, batch ops, MCP StructuredContent, api flag cleanup 2026-05-27 10:56:34 +08:00
session refactor(cli): command-surface rename — session ask / doc fetch / doc create / doc delete --all 2026-05-27 10:56:34 +08:00
completion_test.go feat(cli): api --input + completion smoke 2026-05-14 10:57:17 +08:00
root.go refactor(cli): symmetric envelope infrastructure (supersedes e623e820) 2026-05-27 10:56:34 +08:00
root_test.go refactor(cli): symmetric envelope infrastructure (supersedes e623e820) 2026-05-27 10:56:34 +08:00
root_unknown_subcommand_test.go refactor(cli): symmetric envelope infrastructure (supersedes e623e820) 2026-05-27 10:56:34 +08:00