Skip to content

jeric-n/context7-skill

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Context7-Skill

A multi-platform agent SKILL.md for fetching up-to-date library documentation via the Context7 API.

Works with OpenCode, Antigravity, and Gemini CLI (personal testing). It should also work with other clients that support the same standard.

Setup

  1. Get an API key from context7.com/dashboard

  2. Set the environment variable:

    export CONTEXT7_API_KEY=your-api-key
  3. Install dependencies and build (this creates a self-contained skill with bundled script):

    bun install
    bun run build

    The build step compiles the TypeScript code and copies the built script into skills/context7-skill/scripts/, creating a self-contained skill directory.

  4. Install the skill to your preferred platform:

    Option A: Project-wide (workspace-specific)

    Install in your project's workspace to share with your team (committed to version control):

    # OpenCode
    ln -s $(pwd)/skills/context7-skill /path/to/your/project/.opencode/skills/context7-skill
    
    # Antigravity & Gemini CLI
    ln -s $(pwd)/skills/context7-skill /path/to/your/project/.gemini/skills/context7-skill

    Option B: Global (user-wide)

    Install globally to use across all your workspaces:

    # OpenCode
    ln -s $(pwd)/skills/context7-skill ~/.config/opencode/skills/context7-skill
    
    # Antigravity & Gemini CLI
    ln -s $(pwd)/skills/context7-skill ~/.gemini/skills/context7-skill

    Note: If a skill exists in both locations, the project-wide skill takes precedence.

    After installation, the agent can run the skill script directly from the installed location.

Usage

The CLI has two primary commands: search and context.

Search for a Library

Search for libraries by name. You can optionally provide a query to refine the search.

# Basic search (listing libraries)
node dist/index.js search react

# Search with a specific query (better for finding relevant libraries for a task)
node dist/index.js search react "hooks"

Get Documentation Context

Once you have a library ID (e.g., /facebook/react), fetch relevant documentation context.

# Get context for a specific topic
node dist/index.js context /facebook/react "how to use useState"

Help

To see all available commands and options:

node dist/index.js --help

Development

# Run tests
bun test

# Build for Node.js
bun run build

License

MIT

About

context7 as a SKILL.md instead of an MCP

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published