npm package: @podut/cwescan-cli
Description: CWEScan CLI - Manage AI coding skills and documentation context
Author: Podut
Latest version: 0.3.5

# cwescan

CLI for [cwescan](https://cwescan.com) - query up-to-date library documentation and manage AI coding skills.

Skills are reusable prompt instructions that enhance your AI coding assistant with specialized capabilities like working with specific frameworks, libraries, or coding patterns.

## Installation

```bash
# Run directly with npx (no install needed)
npx cwescan

# Or install globally
npm install -g cwescan
```

## Quick Start

```bash
# Set up cwescan MCP for your coding agents
cwescan setup

# Target a specific agent
cwescan setup --cursor
cwescan setup --claude
cwescan setup --opencode
```

### Library Documentation

```bash
# Find a library
cwescan library react
cwescan library nextjs "app router"

# Get documentation
cwescan docs /facebook/react "useEffect cleanup"
cwescan docs /vercel/next.js "middleware"
```

### Skills

```bash
# Search for skills
cwescan skills search pdf

# Install a skill
cwescan skills install /anthropics/skills pdf

# Generate a custom skill with AI
cwescan skills generate

# List installed skills
cwescan skills list --claude
```

## Usage

### Find a library

Resolve a library name to a cwescan library ID.

```bash
cwescan library react
cwescan library nextjs "app router setup"
cwescan library prisma "database relations"

# Output as JSON
cwescan library react --json
```

### Query documentation

Fetch documentation for a specific library using its cwescan ID.

```bash
cwescan docs /facebook/react "useEffect cleanup"
cwescan docs /vercel/next.js "middleware authentication"
cwescan docs /prisma/prisma "one-to-many relations"

# Output as JSON
cwescan docs /facebook/react "hooks" --json
```

### Setup

Configure cwescan MCP and a rule for your AI coding agents. Authenticates via OAuth, generates an API key, and writes the config.

```bash
# Interactive (prompts for agent selection)
cwescan setup

# Target specific agents
cwescan setup --cursor
cwescan setup --claude
cwescan setup --opencode

# Use an existing API key instead of OAuth
cwescan setup --api-key YOUR_API_KEY

# Use OAuth endpoint (IDE handles auth flow)
cwescan setup --oauth

# Configure for current project only (default is global)
cwescan setup --project

# Skip prompts
cwescan setup --yes
```

### Generate skills

Generate custom skills tailored to your use case using AI. Requires authentication.

```bash
# Log in first
cwescan login

# Generate a skill (interactive)
cwescan skills generate

# Short aliases
cwescan skills gen
cwescan skills g

# Generate and install to a specific client
cwescan skills generate --cursor
cwescan skills generate --claude
cwescan skills generate --universal

# Generate globally
cwescan skills generate --global
```

The generate flow:

1. Describe the expertise you want (e.g., "OAuth authentication with NextAuth.js")
2. Select relevant libraries from search results
3. Answer 3 clarifying questions to focus the skill
4. Review the generated skill, request changes if needed, then install

Weekly generation limits apply: free accounts get 6 generations/week, Pro accounts get 10.

### Authentication

Log in to access skill generation and other authenticated features.

```bash
# Log in (opens browser for OAuth)
cwescan login

# Check login status
cwescan whoami

# Log out
cwescan logout
```

### Install skills

Install skills from a project repository to your AI coding assistant's skills directory.

```bash
# Install all skills from a project (interactive selection)
cwescan skills install /anthropics/skills

# Install a specific skill
cwescan skills install /anthropics/skills pdf

# Install multiple skills at once
cwescan skills install /anthropics/skills pdf commit

# Install to a specific client
cwescan skills install /anthropics/skills pdf --cursor
cwescan skills install /anthropics/skills pdf --claude
cwescan skills install /anthropics/skills pdf --universal

# Install globally (home directory instead of current project)
cwescan skills install /anthropics/skills pdf --global
```

### Search for skills

Find skills across all indexed projects in the registry.

```bash
cwescan skills search pdf
cwescan skills search typescript
cwescan skills search react testing
```

### List installed skills

View skills installed in your project or globally.

```bash
cwescan skills list
cwescan skills list --claude
cwescan skills list --cursor
cwescan skills list --universal
cwescan skills list --global
```

### Show skill information

Get details about available skills in a project.

```bash
cwescan skills info /anthropics/skills
```

### Remove a skill

Uninstall a skill from your project.

```bash
cwescan skills remove pdf
cwescan skills remove pdf --claude
cwescan skills remove pdf --universal
cwescan skills remove pdf --global
```

## Supported Clients

The CLI automatically detects which AI coding assistants you have installed and offers to install skills for them:

| Client | Skills Directory |
|--------|-----------------|
| Universal (Amp, Codex, Gemini CLI, GitHub Copilot, OpenCode + more) | `.agents/skills/` |
| Claude Code | `.claude/skills/` |
| Cursor | `.cursor/skills/` |
| Antigravity | `.agent/skills/` |

## Shortcuts

For faster usage, the CLI provides short aliases:

```bash
cwescan si /anthropics/skills pdf   # skills install
cwescan ss pdf                       # skills search
cwescan skills gen                   # skills generate
cwescan skills g                     # skills generate
```

## Disabling Telemetry

The CLI collects anonymous usage data to help improve the product. To disable telemetry, set the `cwescan_TELEMETRY_DISABLED` environment variable:

```bash
# For a single command
cwescan_TELEMETRY_DISABLED=1 cwescan skills search pdf

# Or export in your shell profile (~/.bashrc, ~/.zshrc, etc.)
export cwescan_TELEMETRY_DISABLED=1
```

## Learn More

Visit [cwescan.com](https://cwescan.com) to browse the skills registry and discover available skills.