Skip to main content

Why Add Context?

Cursor works best when it knows what tools are available. By adding the Paragon CLI reference to your project’s .cursorrules file, Cursor can:
  • Automatically use paragon run for code analysis
  • Pipe diffs and code through Paragon for review
  • Use semantic search with paragon context
  • Manage branches and stacks efficiently

Setup

  1. Open or create .cursorrules in your project root
  2. Copy the CLI reference below and paste it into the file
  3. Cursor will now use Paragon commands for code analysis

CLI Reference

Copy the content below into your .cursorrules file.
.cursorrules
# Paragon CLI Commands

> Use Paragon CLI for enhanced code analysis, reviews, and git workflows.

## Quick Start

paragon run -q "Review this code for security issues"    # Analyze code with a prompt
git diff | paragon run -q "Review these changes"         # Pipe code for analysis

## Code Analysis Commands

### paragon run

Run a prompt in non-interactive mode. Accepts input via arguments or stdin.

paragon run "Explain the authentication flow in this codebase"
paragon run -q "Find potential bugs in the error handling"           # Quiet mode (hide spinner)
paragon run --feature "Add input validation to the API endpoints"    # Feature implementation mode
paragon run --json "List all security issues"                        # JSON output for structured parsing
cat src/auth.go | paragon run "Explain this code"                    # Pipe stdin
git diff HEAD~3 | paragon run -q "Review these changes"
paragon run -m paragon-max "Complex architectural analysis"          # Select model

Flags:
  -q, --quiet     Hide spinner/progress output
  --feature       Use feature implementation mode (vs code review)
  --json          Output structured JSON findings
  --concise       Results-only, no reasoning
  -m, --model     Model selection (paragon-max, paragon-high, paragon-fast)

### paragon context

Specialized context-aware queries using semantic search and AI analysis.

paragon context issue "Database updates not persisting"      # Diagnose and find root causes
paragon context search "authentication logic"                # Semantic code search
paragon context knowledge "How does the caching layer work?" # Query project architecture

## Git Workflow Commands

### paragon submit

Push branch and create/update GitHub PR with AI-generated description.

paragon submit --ai                               # AI-generated title and description
paragon submit --title "Add user authentication"  # With custom title
paragon submit --draft --ai                       # As draft PR

### paragon branch create

Create a new stacked branch with optional AI naming.

paragon branch create --ai         # AI-generated branch name based on changes
paragon branch create feature/auth # Explicit name

### Stack Navigation

paragon stack      # Show branch stack tree
paragon sync       # Rebase current branch on parent
paragon next       # Move to child branch
paragon prev       # Move to parent branch
paragon top        # Jump to top of stack
paragon bottom     # Jump to bottom of stack

## Global Flags

Available on all commands:
  -q, --quiet    Hide spinners and progress output
  -y, --yolo     Auto-approve all permission requests (dangerous)
  -d, --debug    Enable debug logging
  -c, --cwd      Set working directory

## Integration Examples

git diff main | paragon run -q "Review for bugs and security issues"     # Code Review on Diff
gh pr diff 123 | paragon run -q --json "Comprehensive code review"       # Automated PR Review
paragon context issue "Tests failing after recent merge"                 # Find Root Cause
git diff --staged | paragon run -q "Check for issues before commit"      # Pre-commit Analysis
cat src/complex-algorithm.go | paragon run "Explain this step by step"   # Explain Complex Code

## Tips

1. Use -q flag for cleaner output in scripts
2. Pipe code via stdin for targeted analysis
3. Use --json when parsing results programmatically
4. Use context issue for debugging problems
5. Use context search to find code patterns