genkitx-git
v0.0.1
Published
A Genkit plugin for interacting with Git repositories.
Readme
Genkit Git Tools
This Genkit plugin provides a set of tools for interacting with Git repositories. These tools allow Genkit flows to perform Git operations like checking the status of a repository, viewing diffs, and committing changes.
Installation
npm install genkitx-gitUsage
Here is an example of how to use the Git tools in a Genkit flow:
import { genkit, z } from 'genkit';
import { googleAI } from '@genkit-ai/googleai';
import { defineGitTools } from 'genkitx-git';
const ai = genkit({
plugins: [googleAI()],
model: googleAI.model('gemini-2.5-flash'),
});
const gitTools = defineGitTools(ai);
ai.defineFlow(
{
name: 'query',
inputSchema: z
.string()
.default('what are the pending changes in my current directory: ' + process.cwd()),
},
async (prompt) => {
const { text } = await ai.generate({
prompt,
tools: [...gitTools],
});
return text;
}
);This flow takes a natural language prompt and uses the Git tools to answer questions about the state of a Git repository.
Available Tools
This plugin provides the following tools:
git_addgit_addAnnotatedTaggit_addConfiggit_addRemotegit_addTaggit_branchgit_branchLocalgit_checkIgnoregit_checkoutgit_checkoutBranchgit_checkoutLocalBranchgit_clonegit_commitgit_deleteLocalBranchgit_deleteLocalBranchesgit_diffgit_fetchgit_getConfiggit_getRemotesgit_initgit_listConfiggit_listRemotegit_loggit_mergegit_pullgit_pushgit_pushTagsgit_rebasegit_remotegit_removeRemotegit_resetgit_revertgit_showgit_stashgit_stashListgit_statusgit_taggit_tags
MCP Server
You can run genkitx-git as an MCP server (stdio) using the following command:
npx -y genkitx-gitLearn more about Genkit on https://genkit.dev
Get started with Genkit: https://genkit.dev/docs/get-started/
