WeKnora/cli/internal/cmdutil
nullkey 34bb0b5096 feat(cli): doc delete multi-id + api --paginate + paginate fixes + batch deletes
Batch-write surface and pagination consistency:

* weknora doc delete <doc-id> [<doc-id>...] — positional multi-id, default
  keep-going on failure. Single -y confirms entire batch.
* weknora session delete <session-id> [<session-id>...] — same shape.
* weknora chunk delete <chunk-id> [<chunk-id>...] --doc <doc-id> — multi-id
  with shared --doc parent.
* Multi-id partial-failure rolls up as operation.failed (exit 1), not
  server.error (exit 7) — failures are operation outcomes, not transient
  transport issues, and the retry-with-backoff hint for server.* would
  mislead callers.
* weknora api <path> --paginate — auto-walks offset pagination and merges
  pages into a single {data, total} JSON response.
* Paginate truncation fix across 6 list/follower call sites.
* All doc / search / chunk / session / kb list commands migrated to
  FormatOptions API.

Multi-id RunE only emits the {ok, failed} envelope when the operation
actually ran — pre-flight failures (e.g. confirmation_required) leave
stdout empty per the wire contract.

doc upload's missing-positional-or-flag check is wrapped as FlagError so
the exit code (2) matches the convention used by other commands that
require a positional argument directly.
2026-05-18 11:10:19 +08:00
..
agentconfig.go feat(cli): --log-level + kb/agent status & check + cross-cutting refactor 2026-05-18 11:10:19 +08:00
agentconfig_test.go chore(cli): polish + docs sync + pre-PR audit fixes 2026-05-16 16:56:33 +08:00
agenthelp.go feat(cli): --format / NDJSON / chat & agent invoke / MCP / SetAgentHelp / signal-aware ctx / kb create --storage-provider 2026-05-18 11:10:19 +08:00
agenthelp_test.go feat(cli): --format / NDJSON / chat & agent invoke / MCP / SetAgentHelp / signal-aware ctx / kb create --storage-provider 2026-05-18 11:10:19 +08:00
authrefresh.go refactor(cli): drop aiclient package; align AGENTS.md with mainstream 2026-05-15 12:03:56 +08:00
authretry.go chore(cli): gofmt sweep 2026-05-15 12:03:56 +08:00
authretry_test.go refactor(cli): drop aiclient package; align AGENTS.md with mainstream 2026-05-15 12:03:56 +08:00
confirm.go feat(cli): doc delete multi-id + api --paginate + paginate fixes + batch deletes 2026-05-18 11:10:19 +08:00
errors.go feat(cli): doc wait command (multi-target wait-all) 2026-05-18 11:10:19 +08:00
errors_codes_test.go refactor(cli): drop aiclient package; align AGENTS.md with mainstream 2026-05-15 12:03:56 +08:00
errors_test.go feat(cli): scaffold weknora CLI module foundation (PR-1) 2026-05-07 23:19:46 +08:00
exit.go feat(cli): doc wait command (multi-target wait-all) 2026-05-18 11:10:19 +08:00
exit_test.go feat(cli): doc wait command (multi-target wait-all) 2026-05-18 11:10:19 +08:00
factory.go feat(cli): --log-level + kb/agent status & check + cross-cutting refactor 2026-05-18 11:10:19 +08:00
factory_test.go refactor(cli): drop aiclient package; align AGENTS.md with mainstream 2026-05-15 12:03:56 +08:00
format.go feat(cli): --format / NDJSON / chat & agent invoke / MCP / SetAgentHelp / signal-aware ctx / kb create --storage-provider 2026-05-18 11:10:19 +08:00
format_test.go feat(cli): --format / NDJSON / chat & agent invoke / MCP / SetAgentHelp / signal-aware ctx / kb create --storage-provider 2026-05-18 11:10:19 +08:00
host.go refactor(cli): drop aiclient package; align AGENTS.md with mainstream 2026-05-15 12:03:56 +08:00
input.go chore(cli): polish + docs sync + pre-PR audit fixes 2026-05-16 16:56:33 +08:00
kb.go refactor(cli): drop aiclient package; align AGENTS.md with mainstream 2026-05-15 12:03:56 +08:00
loglevel.go feat(cli): --log-level + kb/agent status & check + cross-cutting refactor 2026-05-18 11:10:19 +08:00
loglevel_test.go feat(cli): --log-level + kb/agent status & check + cross-cutting refactor 2026-05-18 11:10:19 +08:00