ts-code-review
v1.0.1
Published
AI-powered code review CLI tool using git diff and LLM analysis
Maintainers
Readme
ts-code-review
AI-powered Code Review CLI tool. Analyzes your staged git changes using LLM (xAI Grok) and outputs a structured review report with severity levels.
Requirements
- XAI_API_KEY: Get your API key from x.ai
- Node.js >= 18 or Bun
- A git repository with staged changes (
git add ...)
Usage
Run directly with npx (no installation needed):
XAI_API_KEY=your_api_key npx ts-code-reviewOr install globally:
npm install -g ts-code-review
XAI_API_KEY=your_api_key ts-code-reviewSkills
The tool auto-selects the best review skill based on your code changes:
- frontend-code-review — React/Vue, CSS, Web performance, a11y
- backend-code-review — API design, database, security, concurrency
Workflow
- Stage your changes:
git add <files> - Run
ts-code-review - AI reads the diff, selects a skill, and outputs a structured report
Report Format
Issues are categorized by severity:
- 🔴 P0 严重 — Security vulnerabilities, crashes
- 🟠 P1 重要 — Logic errors, performance issues
- 🟡 P2 建议 — Code quality improvements
- ⚪ P3 可选 — Style, optional optimizations
Development
# Install dependencies
bun install
# Run in development
bun run dev
# Build for production
bun run buildLicense
MIT
