UNPKG

@nanocollective/nanocoder

Version:

A local-first CLI coding agent that brings the power of agentic coding tools like Claude Code and Gemini CLI to local models or controlled APIs like OpenRouter

47 lines 1.45 kB
/** * Git Tools * * Provides git operations for the coding agent. * Tools are conditionally registered based on git/gh availability. */ import { gitAddTool } from './git-add.js'; import { gitBranchTool } from './git-branch.js'; import { gitCommitTool } from './git-commit.js'; import { gitDiffTool } from './git-diff.js'; import { gitLogTool } from './git-log.js'; import { gitPrTool } from './git-pr.js'; import { gitPullTool } from './git-pull.js'; import { gitPushTool } from './git-push.js'; import { gitResetTool } from './git-reset.js'; import { gitStashTool } from './git-stash.js'; import { gitStatusTool } from './git-status.js'; import { isGhAvailable, isGitAvailable, isInsideGitRepo } from './utils.js'; /** * Get all available git tools based on system capabilities. * Returns empty array if git is not installed. */ export function getGitTools() { // No git or not in a git repo, no git tools if (!isGitAvailable() || !isInsideGitRepo()) { return []; } // Core git tools (always available if git is installed) const tools = [ gitStatusTool, gitDiffTool, gitLogTool, gitAddTool, gitCommitTool, gitPushTool, gitPullTool, gitBranchTool, gitStashTool, gitResetTool, ]; // PR tool requires gh CLI if (isGhAvailable()) { tools.push(gitPrTool); } return tools; } //# sourceMappingURL=index.js.map