Skip to main content
Glama
git.ts581 B
import { execSync } from 'child_process' export function generateGitDiff( repoPath: string | undefined, files: string[], baseRef: string = 'HEAD', ): string { try { const repo = repoPath || process.cwd() if (files.length === 0) { throw new Error('No files specified for git diff') } return execSync(`git diff ${baseRef} -- ${files.join(' ')}`, { cwd: repo, encoding: 'utf-8', maxBuffer: 1024 * 1024, }) } catch (error) { return `Error generating git diff: ${error instanceof Error ? error.message : String(error)}` } }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/raine/consult-llm-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server