Skip to content

feat: add documents discovery filters and title resolvers (#37)#43

Merged
teslakoile merged 6 commits into
masterfrom
feat/issue-37-discovery-filters
Apr 19, 2026
Merged

feat: add documents discovery filters and title resolvers (#37)#43
teslakoile merged 6 commits into
masterfrom
feat/issue-37-discovery-filters

Conversation

@teslakoile

Copy link
Copy Markdown
Owner

Summary

Adds discovery filters and title-based resolvers to the documents command group so agents don't have to list → --json → jq → copy ID → get/describe. All three additions are client-side over the existing find-all Document query — no new RPCs.

Changes

  • documents list --title-contains TEXT — case-insensitive substring match on title, applied client-side after find-all. Help text notes callers should bump -n in large workspaces since the filter runs over the fetched page, not the whole workspace.
  • documents list --parent DOC_ID — forwards parent into the find-all query so callers can walk a hierarchy without fetching the whole workspace.
  • documents get --title TITLE and documents describe --title TITLE — case-insensitive exact title → ID resolver. If multiple documents share the title, exits 1 with a formatted (title, id) table rather than silently picking one. Argument DOC_ID is now optional; exactly one of {DOC_ID, --title} must be provided.
  • documents search "query" — new command; currently a client-side title-substring filter (thin wrapper over --title-contains). Will swap the backend to /search-fulltext once search: add top-level search command using confirmed-working /search-fulltext endpoint #41 lands.

Docs updated: README.md (documents usage examples) and skills/huly-cli/SKILL.md (document discovery helpers block + documents row in command groups).

Scope stayed within src/huly_cli/commands/documents.py, tests/test_commands.py, README.md, and skills/huly-cli/SKILL.md. No changes to client.py, output.py, or any other command module.

Test plan

  • uv run ruff format . && uv run ruff check . — clean
  • uv run pytest -x — 277 passed (266 before + 11 new command-layer tests)
  • New tests cover: title-contains filter, parent filter (asserts parent forwarded into the find-all query), title resolver unique match (get + describe), title resolver multiple-match error with match table, title resolver not-found, both-args error, neither-args error, search happy path, search empty result.

Closes #37

teslakoile and others added 6 commits April 19, 2026 21:05
Lets agents find a document without the list → --json → jq → copy-ID dance:

- `documents list --title-contains TEXT` — case-insensitive substring filter
  (client-side over the fetched page; bump -n in large workspaces)
- `documents list --parent DOC_ID` — direct children of a given document
- `documents get --title TITLE` and `documents describe --title TITLE` —
  case-insensitive exact match; errors with a match table (title + id) if
  multiple documents share the title, rather than silently picking one
- `documents search "query"` — thin wrapper around `--title-contains`; will
  swap the backend to /search-fulltext once #41 lands

All three are client-side over the existing find-all Document query. No
changes to client.py or any other command module.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…very-filters

# Conflicts:
#	skills/huly-cli/SKILL.md
…very-filters

# Conflicts:
#	skills/huly-cli/SKILL.md
#	tests/test_commands.py
…very-filters

# Conflicts:
#	skills/huly-cli/SKILL.md
#	src/huly_cli/commands/documents.py
…very-filters

# Conflicts:
#	skills/huly-cli/SKILL.md
#	src/huly_cli/commands/documents.py
@teslakoile teslakoile merged commit 3062183 into master Apr 19, 2026
1 check passed
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.

documents: add discovery filters and title-based resolvers

1 participant