feat: add documents discovery filters and title resolvers (#37)#43
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds discovery filters and title-based resolvers to the
documentscommand group so agents don't have tolist → --json → jq → copy ID → get/describe. All three additions are client-side over the existingfind-allDocument query — no new RPCs.Changes
documents list --title-contains TEXT— case-insensitive substring match on title, applied client-side afterfind-all. Help text notes callers should bump-nin large workspaces since the filter runs over the fetched page, not the whole workspace.documents list --parent DOC_ID— forwardsparentinto thefind-allquery so callers can walk a hierarchy without fetching the whole workspace.documents get --title TITLEanddocuments 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. ArgumentDOC_IDis 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-fulltextonce search: add top-level search command using confirmed-working /search-fulltext endpoint #41 lands.Docs updated:
README.md(documents usage examples) andskills/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, andskills/huly-cli/SKILL.md. No changes toclient.py,output.py, or any other command module.Test plan
uv run ruff format . && uv run ruff check .— cleanuv run pytest -x— 277 passed (266 before + 11 new command-layer tests)parentforwarded 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