Skip to main content
Integrate CodeAnt AI into Cursor to run AI-powered code reviews, auto-fix PR comments, explore pull requests, and detect issues — all driven by Cursor’s AI agent.

What You Get

A Cursor rule that teaches the AI agent how to use the full CodeAnt CLI. Once installed, you can ask Cursor to:
  • Review your code changes for bugs, security issues, and code quality
  • Fetch unaddressed PR review comments and fix them automatically
  • List and explore pull requests in the repository
  • Search across review comments
  • Scan for exposed secrets before committing
  • Run security and static analysis
  • Fix issues found by CodeAnt automatically

Prerequisites

  1. Cursor installed (download)
  2. CodeAnt CLI installed and authenticated:
npm install -g codeant-cli
codeant login
  1. SCM token configured (required for PR features):
codeant set-token github <your-token>
# or: gitlab, bitbucket, azure

Installation

mkdir -p .cursor/rules
git clone https://github.com/CodeAnt-AI/skills.git /tmp/codeant-skills
cp /tmp/codeant-skills/cursor/codeant.mdc .cursor/rules/
rm -rf /tmp/codeant-skills
Commit to share with your team:
git add .cursor/rules/codeant.mdc
git commit -m "Add CodeAnt AI Cursor rule"

Option 2: Create Manually

Create .cursor/rules/codeant.mdc — see the full rule content in the skills repository.

Usage

Review Code Changes

Ask Cursor to review your work after implementing a feature:
Implement the user authentication endpoint, then run a CodeAnt review
on the changes and fix any issues found.
Cursor will:
  1. Implement the feature
  2. Run codeant review --uncommitted
  3. Parse the findings
  4. Fix each issue
  5. Re-run the review to verify

Auto-Fix PR Comments

The most powerful workflow — fix all unaddressed review comments on a PR:
Fix all unaddressed CodeAnt comments on PR #42
Cursor will:
  1. Run codeant pr comments --pr-number 42 --codeant-generated true --addressed false
  2. Parse the JSON to get file paths, line ranges, descriptions, and suggested fixes
  3. Apply suggested fixes where available
  4. Implement fixes for issues without suggestions
  5. Run codeant review --uncommitted to verify
You can also let it auto-detect the PR:
Fix all unaddressed CodeAnt review comments on the current branch's PR

Explore Pull Requests

List my open pull requests
Show me the details of PR #42 including changed files
What CodeAnt comments are on PR #42?

Search Review Comments

Search CodeAnt comments for "SQL injection"
Find all unaddressed comments about authentication

Scan for Secrets

Run a CodeAnt secrets scan on my staged files

Security Analysis

Run a CodeAnt security analysis on my uncommitted changes

Static Analysis with Auto-Fix

Run CodeAnt static analysis with auto-fix on my changes

Example Workflows

Full PR Auto-Fix Loop

1. "Fix all unaddressed CodeAnt comments on my current PR"
   → Cursor fetches 5 unaddressed comments
   → Applies 3 suggested fixes directly
   → Implements 2 manual fixes
   → Runs verification review
   → Reports: all issues resolved

2. "Commit the fixes"
   → Cursor commits with a descriptive message
   → On push, CodeAnt marks comments as addressed

Implement → Review → Fix → Ship

1. "Implement rate limiting middleware for Express routes"
   → Cursor implements the feature

2. "Review with CodeAnt and fix any issues"
   → Cursor runs: codeant review --uncommitted
   → Finds: 1 CRITICAL (missing input validation), 2 MINOR (naming)
   → Fixes all issues
   → Re-runs review: all clear

3. "Scan for secrets before I commit"
   → Cursor runs: codeant secrets --staged
   → No secrets found

4. "Commit and push"

Explore → Investigate → Fix

1. "List my open PRs"
   → Shows PR #42: "Add payment processing"

2. "What CodeAnt comments are on PR #42?"
   → Shows 3 unaddressed comments with severity

3. "Fix all of them"
   → Applies fixes, verifies, reports results

How It Works

The .cursor/rules/codeant.mdc file is a Cursor Rule that is automatically loaded into every AI conversation in your project. It teaches the Cursor agent:
  • All available CodeAnt CLI commands (review, PR management, scanning)
  • The auto-fix workflow for PR comments
  • When to use each command
  • How to parse JSON and terminal output
  • How to handle the review-fix-verify cycle
The rule has alwaysApply: true, so the agent always knows about CodeAnt — you don’t need to explicitly reference it.

Troubleshooting

“codeant: command not found” Ensure the CLI is installed globally and accessible from Cursor’s terminal:
npm install -g codeant-cli
codeant --version
If using nvm, ensure the correct Node version is active in Cursor’s integrated terminal. “Not authenticated” or “Could not detect remote”
codeant login                           # CodeAnt API auth
codeant set-token github <your-token>   # SCM auth for PR features
Agent doesn’t use CodeAnt
  • Verify .cursor/rules/codeant.mdc exists and has alwaysApply: true in frontmatter
  • Restart Cursor after adding the rule
  • Be explicit: “Use CodeAnt to review my changes”
Reviews take too long Narrow the review scope:
Review only the staged files with CodeAnt
Review only src/auth.ts with CodeAnt