UNPKG

scai

Version:

> AI-powered CLI tool for commit messages **and** pull request reviews — using local models.

23 lines (21 loc) 734 B
import { generate } from '../../lib/generate.js'; import { Config } from '../../config.js'; export const reviewModule = { name: 'review', description: 'Reviews code diff or PR content and provides feedback', async run({ content, filepath }) { const model = Config.getModel(); const prompt = ` You are a senior software engineer reviewing a pull request. Give clear and very short constructive feedback based on the code changes below. Only mention issues of greater concern. Less is more. Changes: ${content} `.trim(); const response = await generate({ content: prompt, filepath }, model); return { content: response.content, filepath, }; } };