Skip to content

Conversation

@gwythyr
Copy link

@gwythyr gwythyr commented Feb 2, 2026

Summary

  • Add docs resolve command to search and resolve library names to Context7 library IDs with relevance ranking
  • Add docs get command to fetch documentation context for a specific library based on a query
  • Support both human-readable and JSON output formats
  • Include telemetry tracking for usage analytics

Details

This PR introduces two new CLI commands under the docs namespace that enable users to query library documentation directly from the terminal.

ctx7 docs resolve <library> <query>

Searches for libraries matching the given name and ranks results by relevance to the query. Displays:

  • Library title and Context7 ID
  • Description, snippet count, GitHub stars, and trust score
  • Available versions
  • Quick command hint with the best match

ctx7 docs get <libraryId> <query>

Fetches documentation context for a specific library ID. Features:

  • Validates library ID format (must start with /)
  • Handles library redirects gracefully with suggested new ID
  • Returns code snippets and info snippets relevant to the query
  • Supports --json flag for programmatic consumption

Both commands support authenticated requests via OAuth tokens and include spinner feedback for better UX.

… retrieval

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.

1 participant