Commit Graph

83 Commits

Author SHA1 Message Date
github-actions[bot] 945f9aec8b chore(release): version packages (#2183)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-03-10 17:20:02 +03:00
Fahreddin Özcan 9aae852681 feat(cli): show source repo in skill search results (#2185)
* feat(cli): show source repo next to skill name in search and suggest results

Adds the project repo in parentheses after each skill name to help
disambiguate skills with identical names from different repositories.

* chore: add changeset for repo display in skill search

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 17:19:12 +03:00
Enes Gules 9de3f0627c feat: add searchFilterApplied field to LibrarySearchResponse and SearchResponse interfaces; add warnings to cli and mcp (#2160) 2026-03-10 17:15:55 +03:00
Fahreddin Özcan 05a440600a fix(cli): remove default universal selection on skills install prompt (#2184) 2026-03-10 16:17:13 +03:00
Fahreddin Özcan 31b4fb8435 feat(cli): add docs skill and align CLI output with MCP format (#2176)
* feat(docs): add dedicated docs skill and restructure CLI documentation

- Add new `docs` skill as a single-file skill for documentation retrieval
- Align skill prompts with MCP tool descriptions (selection process, query guidance, 3-call limit)
- Enrich CLI docs page with result fields, query tips, and version-specific IDs
- Move CLI page to Overview section in docs nav
- Make `query` required for `ctx7 library` across all skills and docs
- Update trust score display label in skills.mdx

* feat(cli): align library output format with MCP labels

Use labeled fields and categorical Source Reputation labels
(High/Medium/Low/Unknown) instead of numeric trust scores to match
the MCP transport format.

* refactor: move skills from .agents/skills to skills/ at repo root

Source-control location for skills — users install them into
.agents/, .claude/, etc. via the CLI. Also updates install
instructions to use `npm install -g ctx7@latest` or `npx ctx7@latest`.

* docs: use natural-language query examples across skills and CLI docs

Replace keyword-style queries ("useEffect cleanup") with full
question-style queries ("How to clean up useEffect with async
operations") to better demonstrate how the query parameter works.

* docs: fix trust score description to show numeric range
2026-03-10 16:04:05 +03:00
github-actions[bot] ffb14fd426 chore(release): version packages (#2128)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-03-06 16:21:30 +03:00
Fahreddin Özcan df60e3e20e feat(cli): add resolve and query commands for library documentation (#2119)
* feat(cli): add resolve and query commands for library documentation

Expose Context7's resolve-library and query-docs API as CLI commands,
enabling agents and developers to fetch documentation directly from
the terminal without MCP setup.

- `ctx7 resolve <library> [query]` - resolve library name to Context7 ID
- `ctx7 query <libraryId> <query>` - fetch documentation for a library
- Both support --json for structured output
- TTY-aware: spinners and colors in terminal, clean output when piped
- Auth: CONTEXT7_API_KEY env var > OAuth token > unauthenticated

* refactor(cli): rename resolve/query to library/docs commands

Rename commands for a more natural CLI interface:
- `ctx7 library <name> [query]` instead of `ctx7 resolve`
- `ctx7 docs <libraryId> <query>` instead of `ctx7 query`

* fix(cli): show benchmark score and all versions in library results

* chore: add changeset for library and docs commands

* style(cli): fix lint formatting in api.ts

* refactor(cli): remove redundant spinner success messages

The output itself is self-evident, no need for "Found 5 libraries"
or "Documentation retrieved" messages.
2026-03-06 16:18:16 +03:00
Bryan Thompson ceac1a5356 fix(mcpb): Update manifest to v0.3 spec and switch to npx-based bundle (#1488)
Co-authored-by: triepod-ai <199543909+triepod-ai@users.noreply.github.com>
Co-authored-by: enesgules <abdullah.enes.gules@gmail.com>
2026-03-06 04:03:48 +03:00
github-actions[bot] 7e0309b718 chore(release): version packages (#2100)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-03-04 15:51:01 +03:00
Fahreddin Özcan 59d0327b07 feat(mcp): include source field in search result response (#2031)
* feat(mcp): include source field in search result response

* chore: add changeset
2026-03-04 15:49:25 +03:00
Fahreddin Özcan 9523522d33 fix: reject GET requests on MCP endpoints to eliminate idle SSE timeouts (#2099)
* fix: reject GET requests on MCP endpoints to eliminate idle SSE timeouts

Stateless MCP server does not send server-initiated notifications, so
GET SSE streams sit idle until NGINX proxy_read_timeout (3600s) kills them.
Humio data shows ~4M GET timeouts vs 69 actual POST tool calls over 2 days,
accounting for 99.997% of all 5XX errors.

Returning 405 is spec-compliant per MCP StreamableHTTP (2025-03-26).

* chore: add changeset for MCP GET rejection fix

* refactor: move GET rejection into handleMcpRequest and fix error code

- Consolidate GET check into handleMcpRequest to avoid duplication
- Fix JSON-RPC error code from -32601 (method not found) to -32000 (server error)
2026-03-04 15:45:08 +03:00
github-actions[bot] 76d70a1223 chore(release): version packages (#1956)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-02-23 13:06:21 +03:00
enesgules e81f7e3c8c fix: formatting 2026-02-23 13:04:15 +03:00
enesgules 617d8edb87 Remove unnecessary warning from encryption key validation and update tool descriptions for clarity. 2026-02-23 13:01:03 +03:00
enesgules d2c34b04c3 Update installation commands across multiple languages to include the --scope user flag for Context7 in Claude Code. 2026-02-20 16:41:09 +03:00
Enes Gules e3416985e8 Move explanation in tool responses into the description (#1892)
* Update tool descriptions in index.ts for clarity on library ID resolution process

* Move explanation in tool responses into the description
2026-02-19 06:01:25 -08:00
Enes Gules 1a52cb918e Update tool descriptions in index.ts for clarity on library ID resolution process (#1890) 2026-02-18 14:35:45 -08:00
Enes Gules 2427fb2710 Update OpenAPI documentation (#1862)
Remove unused `vip` field from LibrarySearchResult interface.
2026-02-18 17:49:05 +03:00
github-actions[bot] 87109e5e78 chore(release): version packages (#1884)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-02-18 16:34:10 +03:00
Fahreddin Özcan c66950a582 feat(cli): install documentation-lookup skill during ctx7 setup (#1882)
* feat(cli): install documentation-lookup skill during ctx7 setup

The setup command now installs the Context7 documentation-lookup skill
alongside the MCP server and rule for each agent.

Skill paths per agent:
- Claude: .claude/skills/documentation-lookup/SKILL.md
- Cursor: .cursor/skills/documentation-lookup/SKILL.md
- OpenCode: .agents/skills/documentation-lookup/SKILL.md (universal)

* chore: add changeset for skill install in setup
2026-02-18 16:31:28 +03:00
github-actions[bot] 9422500301 chore(release): version packages (#1858)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-02-16 17:18:36 +03:00
Fahreddin Özcan 3d6619128c add ctx7 setup command (#1851)
* add `ctx7 setup` command for configuring MCP and rules

Adds an interactive setup command that configures the Context7 MCP server
and agent rules for Claude Code, Cursor, and OpenCode. Authenticates via
OAuth, generates an API key, and writes per-agent config files.<noreply@anthropic.com>

* revert auth.ts client ID change

* add changeset for setup command

* fix lint: format import line
2026-02-16 17:17:33 +03:00
milosz-l 22057ba0f0 docs: add --scope user to Claude Code install commands (#1812) 2026-02-13 18:08:59 +03:00
Ryan Cavanaugh cafa4f3d4d Remove deprecated downlevelIteration option (#1684) 2026-02-13 18:02:52 +03:00
enesakar de4ae29933 update prompt for better privacy 2026-02-11 06:36:47 +03:00
enesakar b3c7192173 update prompt for better privacy 2026-02-11 06:36:22 +03:00
github-actions[bot] 2be9193ed4 chore(release): version packages (#1774)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-02-10 13:13:40 +03:00
Fahreddin Özcan 4663c15552 feat(cli): adopt .agents/skills as universal install target (#1730)
* feat(cli): adopt .agents/skills as universal install target

Install to .agents/skills/ by default as the shared standard directory.
Universal agents (Amp, Codex, OpenCode, Gemini CLI, GitHub Copilot) all
read from this path natively. Vendor-specific agents (Claude Code, Cursor,
Antigravity) get symlinks pointing back to .agents/skills/.

- Add "universal" as a first-class IDE type across all path maps
- Auto-detect .agents/ and vendor dirs: detected → confirm, nothing
  detected → checkbox picker with Universal pre-checked
- Update list/remove commands to check universal + vendor-specific dirs
- Update DEFAULT_CONFIG.defaultIde from "claude" to "universal"
- Show labeled install summary (Universal, Claude Code, etc.) with paths

* feat(cli): consolidate agent flags into single --universal option

Replace --codex, --opencode, and --amp flags with a single --universal flag that points to .agents/skills/. This simplifies the CLI interface since these agents all share the same installation path.

* refactor(cli): simplify IDE types and remove UNIVERSAL_AGENTS Set

- Simplify IDE type from 7 types to 4 (remove codex, opencode, amp)
- Remove UNIVERSAL_AGENTS Set and replace with direct equality checks
- Update documentation to add --universal flag examples throughout
- Consolidate Supported Clients table to show single Universal row

All universal agents (Amp, Codex, Gemini CLI, GitHub Copilot, OpenCode, etc.)
are now represented by the single "universal" type since they're functionally
identical and use the same .agents/skills/ directory.

* docs(skills): update CLI flags to use --universal

- Replace --codex, --opencode, --amp flags with single --universal flag
- Update all command examples (install, list, remove, suggest, generate)
- Consolidate Supported Clients table with Universal at top
- Reorder tables to prioritize Universal agents
2026-02-10 13:12:40 +03:00
Fahreddin Özcan e49e41819f docs: add telemetry opt-out documentation (#1705)
Document how to disable CLI telemetry using the CTX7_TELEMETRY_DISABLED
environment variable in both the CLI README and skills documentation.
2026-02-05 22:50:40 +03:00
github-actions[bot] 61e7fcdc76 chore(release): version packages (#1671)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-02-03 17:36:58 +03:00
Fahreddin Özcan 098165649f feat(cli): use backend suggest endpoint (#1667)
* discover

* feat(cli): use backend suggest endpoint for skill suggestions

Replace client-side NOTABLE_SET filtering with a single POST request to
/api/v2/skills/suggest. The backend now handles SKIP_SET filtering,
vector search, install count enrichment, and ranking.

- Remove NOTABLE_SET/SKIP_SET from deps.ts
- Add suggestSkills API function
- Add SuggestGroup and SuggestResponse types
- Simplify suggestCommand to use backend response

* feat(cli): send auth token with suggest request

Pass the user's OAuth token (if logged in) when calling the suggest
endpoint so the request counts against their quota.

* chore: add changeset

* refactor: simplify suggest API usage

- Remove ecosystem field from deps detection
- Use flat skills array from backend instead of groups
- Simplify display logic

* fix: use white color for Relevant value in metadata panel

* refactor: rename DiscoverOptions to SuggestOptions
2026-02-03 17:28:29 +03:00
github-actions[bot] d27c85982b chore(release): version packages (#1657)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-02-02 15:49:48 +03:00
Fahreddin Özcan 6328ed154e feat(cli): improve skill search display and revamp generate UX (#1618)
* feat(cli): add trust score column and improve skill search display

Add trust score and installs columns with aligned headers to skill search results.
Trust scores use yellow/red color coding (0-10 scale).

* chore: add changeset for trust score column

* feat(cli): auto-login when generate requires authentication

Extract login flow into reusable `performLogin()` function.
Generate command now triggers OAuth login automatically instead of
showing an error asking the user to run 'ctx7 login' manually.

* feat(cli): show recommended option first in generate questions

Reorder options so the recommended answer is always displayed at
position 1 with cursor starting on it, regardless of original index.

* feat(cli): open generated skill in default editor instead of inline view

Replace inline terminal "View full skill" with "View skill" that opens
the content in the system default editor ($EDITOR or 'open' fallback)
via a temp file.

* feat(cli): revamp generate UX with improved copy and examples

Update skill generation flow:
- Show do/don't examples (✕/✓) for skill descriptions
- Rename "libraries" to "sources" in user-facing text
- Add explanation of what sources are used for
- Update spinner text for questions and generation steps
- Remove unused libraryNames variable

* chore: update changeset to include generate UX changes

* fix(cli): show dash placeholder for missing installs and trust scores

* feat(cli): add external link icon to terminal hyperlinks and show dash for empty fields

* feat(cli): improve view/edit skill with persistent edits and preview cleanup

Save preview files to ~/.context7/previews/ instead of OS temp dir, read
edits back before install, and clean up preview files on exit.

* feat(cli): improve generate UX copy and flow polish

Update skill generation flow with clearer descriptions, better spinner
messages, and improved finalize menu options.

* fix(cli): fix stale editor preview, install count side effect, and editor spawn

- Reset previewFileWritten between regeneration cycles so editor shows fresh content
- Add placeholder param to formatInstallCount to avoid showing "-" in list command
- Replace execFile with spawn for proper $EDITOR support (terminal editors, args)
- Move trustScore to Skill base type and remove redundant installCount from SkillSearchResult
2026-02-02 15:46:34 +03:00
github-actions[bot] 0d64230663 chore(release): version packages (#1609)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-01-29 20:31:39 +03:00
Fahreddin Özcan 85b905ec70 feat(cli): add telemetry tracking for CLI usage metrics (#1608)
* feat(cli): add telemetry tracking for commands, searches, and generation events

* chore: add changeset for CLI telemetry
2026-01-29 20:29:56 +03:00
Fahreddin Özcan 2f7cc42ce3 feat(cli): show exact install counts and sort by installs in install command (#1603)
Display exact install count numbers instead of rounded values (e.g. 41 instead of 40+), sort skills by install count descending in the install command, and show "installs" column header inline with the prompt.
2026-01-29 20:24:24 +03:00
github-actions[bot] c21081c71a chore(release): version packages (#1402)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-01-29 11:49:03 +03:00
Fahreddin Özcan 8ba484cdc8 feat(cli): add interactive skill generation wizard (#1572)
* generate skills

* feat: add generate questions methods

* feat(cli): improve skill generation UX with streaming feedback

- Add real-time query results display during generation
- Collapse answered questions to show summary
- Separate query phase spinner from generation spinner
- Add skill preview with expand option
- Remove legacy generateSkill function
- Clean up redundant comments

* feat(cli): improve skill generation UX with streaming feedback

- Add real-time query results display during generation
- Collapse answered questions to show summary
- Separate query phase spinner from generation spinner
- Add skill preview with expand option
- Remove legacy generateSkill function
- Clean up redundant comments

* feat(cli): optimize feedback regeneration and clean up UI

- Add previousContent to StructuredGenerateInput for efficient feedback
- Remove redundant "Selected X libraries" log message
- Consolidate menu options (remove "Regenerate completely")
- Update feedback prompt with skip hint

* feat(cli): add skill generation with quota and improved display

- Add skill quota checking before generation
- Fix tool result display timing issue
- Show library project IDs in selection to avoid confusion
- Improve generation spinner with query log display

* docs(cli): add 0.2.0 changelog entry

* fix(cli): switch userinfo endpoint from dev to production

* docs(cli): add skill generation and auth sections to README

* fix(sdk): increase timeout for sequential search test

* chore(cli): replace manual changelog with changeset for skill generation
2026-01-29 11:46:45 +03:00
Fahreddin Özcan aacfd3165a feat(cli): add OAuth 2.0 support with login, whoami and logout commands (#1573)
* feat: add oauth 2.0 support with login,whoami and logout commands

* ci: lockfile

* fix: address security and port issues in OAuth flow

- Fix XSS vulnerability by escaping HTML in error page messages
- Change callback port from 9876 to 52417 (high ephemeral range, less likely to conflict)

* refactor: clean up auth code and remove unnecessary comments

- Remove obvious comments that duplicate function names
- Extract duplicate expiration display logic into printTokenExpiration helper
- Simplify logoutCommand (remove async, inline condition)
- Remove unused saved_at field from token storage

* fix: address auth bugs and remove unused code

Bug fixes:
- whoami now shows "Session expired" instead of misleading "Logged in" when token is invalid
- expires_at calculation preserves existing value instead of overwriting
- Login check now allows re-login when tokens are expired with no refresh token

Simplifications:
- Remove unused getAccessToken and refreshAccessToken functions
- Simplify printTokenExpiration (remove unused showExpired parameter)

* refactor: improve whoami output formatting

- Align labels using padEnd for consistent output
- Remove expiration time display from whoami
- Show login status first, then fetch user details

* chore: add changeset for OAuth feature
2026-01-28 14:36:39 +03:00
Fahreddin Özcan 7ca9720ccf Revert "fix: use stateless pattern for HTTP transport to prevent connection leaks (#1471)" (#1495)
This reverts commit 8a2ad1aba4.
2026-01-28 14:32:41 +03:00
Fahreddin Özcan a0bb5a5705 feat: improve skill selection UX with metadata panel and install counts (#1563)
* feat: enumerate search results

* feat: select hovered item on Enter in checkbox prompts

* refactor: improve types in prompts.ts

* feat: improve skill list UI with metadata panel and install counts

* chore: update version and changelog

* feat: add consistent green highlighting to IDE/scope prompts

Apply green highlight theme to all selection prompts in ide.ts
for visual consistency with skill selection prompts.
2026-01-27 15:57:04 +03:00
Fahreddin Özcan 572c3ca98b feat(cli): simplify skills list to show all detected IDEs without prompts (#1551) 2026-01-27 12:53:58 +03:00
Fahreddin Özcan fd27e29340 CTX7-1141: don't loop paginated results (#1538)
* feat: dont loop paginated results

* chore: add changelog.md

* chore: bump version to sync

* chore: add changeset
2026-01-27 12:32:59 +03:00
luo jiyin e412350939 fix: typo in retry count comment (#1540) 2026-01-26 11:50:14 +03:00
Fahreddin Özcan ddf9cdbbc7 feat: prompt injection error (#1536)
* feat: prompt injection error

* revert logs
2026-01-24 14:26:42 -08:00
Fahreddin Özcan 89b8bf5285 feat: ide confirmation (#1525) 2026-01-22 12:54:57 -08:00
Fahreddin Özcan 7b41f39fb7 fix: use get single skill endpoint (#1522)
* fix: use get single skill endpoint

* remove unnecessary type
2026-01-22 23:14:31 +03:00
Fahreddin Özcan 04b7b395db feat: add installation count metric collection (#1523) 2026-01-22 16:54:23 +03:00
Fahreddin Özcan 1fbd3d906c feat: add skills registry CLI for managing AI coding agent skills (#1505)
* feat: add skills cli

* chore: cleanup comments

* feat: update commands with new apis

* chore: remove unnecessary deps

* chore: update aliases and package name

* feat: remove /owner/repo/skill convention

* fix: cleanup, path and param handling

* feat(cli): multi-keyword search and Claude symlink priority

- Support multi-keyword search: `ctx7 skills search react hooks`
- Prioritize Claude to receive original files when installing to multiple IDEs

* refactor(cli): rename project to repository, reorder options

- Rename "project" argument to "repository" in help text
- Reorder options: --all and --global first, then IDE options
- Simplify IDE option descriptions to show client name and path
- Update internal variable names (project → repo)

* refactor(cli): flatten search results display

- Remove grouping by repository in search results
- Remove "Select all from repo" option
- Show each skill on single line with repo name in parentheses
- Simplify selection handling

* docs(cli): improve main help output with detailed examples

- Add section headers for commands and examples
- Include npx prefix in all example commands
- Group examples by use case (search, install, manage)
- Add comments explaining each example group
- Add link to context7.com

* refactor(cli): simplify banner, add examples to --help

Move detailed examples to --help output using addHelpText().
Simplify the no-argument banner to show only quick start examples.

* chore: remove unnecessary package
2026-01-21 12:25:04 -08:00
Enes Gules 8a2ad1aba4 fix: use stateless pattern for HTTP transport to prevent connection leaks (#1471)
* fix: use stateless pattern for HTTP transport to prevent connection leaks

* remove comments

* increase timeout

* changeset

---------

Co-authored-by: Fahreddin Özcan <ozcanfahrettinn@gmail.com>
2026-01-16 20:25:03 +03:00