{
  "id": "ctx7",
  "name": "Context7 CLI",
  "homepage": "https://context7.com/docs/clients/cli",
  "description": "A CLI for fetching current library documentation",
  "executables": [
    "ctx7"
  ],
  "dotfiles": {
    "paths": [
      "[configHome]/context7/credentials.json",
      "~/.context7/credentials.json"
    ],
    "secret": [],
    "secret_paths": [
      {
        "file": [
          "[configHome]/context7/credentials.json",
          "~/.context7/credentials.json"
        ],
        "format": "json",
        "match": {
          "key_path": [
            "access_token",
            "refresh_token"
          ]
        }
      }
    ]
  },
  "commands": {
    "format": 1,
    "label": "Search library documentation",
    "description": "Search Context7 documentation, resolve a library ID, or fetch docs by ID. Setup, remove and login commands are left out.",
    "quality": "ai-draft",
    "parser": {
      "end_of_options": "--",
      "interleave": "permute",
      "long_equals": true,
      "short_attached": false,
      "short_bundles": false
    },
    "subcommand": [
      {
        "path": [
          "search"
        ],
        "label": "Search documentation",
        "source": [
          {
            "id": "readme",
            "kind": "manual",
            "url": "https://github.com/upstash/context7/blob/master/packages/cli/README.md",
            "revision": "2026-10-27",
            "evidence": "ctx7 search \"how do I validate a request body with a schema?\"\nctx7 search \"how do I stream a response?\" --library Next.js --library /openai/openai-node\nctx7 search \"how do I cache a server function?\" --library Next.js --library-version 15.4.0\nctx7 search \"how do I send an SMS?\" --library Twilio --language Ruby\nctx7 search \"how do I use hooks?\" --library React --json\n"
          }
        ],
        "field": [
          {
            "id": "query",
            "label": "Question",
            "type": "string",
            "position": 0,
            "min": 1,
            "sources": [
              "readme"
            ]
          },
          {
            "id": "library",
            "label": "Library",
            "description": "A name or library ID; repeat for up to four.",
            "type": "string",
            "option": [
              "--library"
            ],
            "multiple": true,
            "sources": [
              "readme"
            ]
          },
          {
            "id": "library_version",
            "label": "Library version",
            "type": "string",
            "option": [
              "--library-version"
            ],
            "sources": [
              "readme"
            ]
          },
          {
            "id": "language",
            "label": "Preferred language",
            "type": "string",
            "option": [
              "--language"
            ],
            "sources": [
              "readme"
            ]
          },
          {
            "id": "json",
            "label": "JSON output",
            "type": "boolean",
            "option": [
              "--json"
            ],
            "sources": [
              "readme"
            ]
          }
        ],
        "task": [
          {
            "id": "search",
            "label": "Search docs",
            "fields": [
              "query",
              "library",
              "library_version",
              "language",
              "json"
            ],
            "required": [
              "query"
            ]
          }
        ],
        "group": [
          {
            "id": "basic",
            "label": "Basic",
            "fields": [
              "query",
              "library",
              "library_version"
            ]
          },
          {
            "id": "advanced",
            "label": "Advanced",
            "fields": [
              "language",
              "json"
            ]
          }
        ]
      },
      {
        "path": [
          "docs"
        ],
        "label": "Fetch documentation by library ID",
        "source": [
          {
            "id": "readme",
            "kind": "manual",
            "url": "https://github.com/upstash/context7/blob/master/packages/cli/README.md",
            "revision": "2026-10-27",
            "evidence": "ctx7 docs /facebook/react \"useEffect cleanup\"\nctx7 docs /facebook/react \"hooks\" --json\n"
          }
        ],
        "field": [
          {
            "id": "library_id",
            "label": "Library ID",
            "description": "For example /facebook/react.",
            "type": "string",
            "position": 0,
            "min": 1,
            "sources": [
              "readme"
            ]
          },
          {
            "id": "query",
            "label": "Question",
            "type": "string",
            "position": 1,
            "min": 1,
            "sources": [
              "readme"
            ]
          },
          {
            "id": "json",
            "label": "JSON output",
            "type": "boolean",
            "option": [
              "--json"
            ],
            "sources": [
              "readme"
            ]
          }
        ],
        "task": [
          {
            "id": "docs",
            "label": "Fetch docs",
            "fields": [
              "library_id",
              "query",
              "json"
            ],
            "required": [
              "library_id",
              "query"
            ]
          }
        ],
        "group": [
          {
            "id": "basic",
            "label": "Basic",
            "fields": [
              "library_id",
              "query",
              "json"
            ]
          }
        ]
      }
    ]
  }
}
