coquibot/coqui-toolkit-git
Composer 安装命令:
composer require coquibot/coqui-toolkit-git
包简介
Git repository management and repository triage toolkit for Coqui — status, staging, commits, branches, tags, remotes, push/pull, merge, diff, log, and audit analytics
README 文档
README
Git repository management toolkit for Coqui. Provides full Git CLI access plus repository triage analytics — status, staging, commits, branches, tags, remotes, push/pull, merge, diff, log, and pre-code-reading audit workflows — all sandboxed through typed tools with proper argument escaping.
Requirements
- PHP 8.4+
- Git CLI installed and on PATH
- Coqui (auto-discovered via Composer)
Installation
composer require coquibot/coqui-toolkit-git
When installed alongside Coqui, the toolkit is auto-discovered via Composer's extra.php-agents.toolkits — no manual registration needed.
The toolkit also bundles a reusable skill, git-repository-audit, so Coqui can apply the discovery workflow automatically when the user asks to assess a repository before reading code.
All repository analysis tools return compact JSON strings rather than prose-heavy summaries. That keeps token usage down and lets the bot decide whether to summarize, tabulate, compare, or feed the data into a larger workflow.
Tools Provided
git_init
Initialize a new Git repository.
| Parameter | Type | Required | Description |
|---|---|---|---|
path |
string | No | Directory to initialize (defaults to cwd) |
branch |
string | No | Name for the initial branch |
git_status
Show the working tree status — modified, staged, and untracked files.
| Parameter | Type | Required | Description |
|---|---|---|---|
path |
string | No | Repository path |
short |
bool | No | Use short format output |
git_stage
Stage, unstage, or reset files in the Git index.
| Parameter | Type | Required | Description |
|---|---|---|---|
action |
enum | Yes | add, add_all, or reset |
files |
string | No | Space-separated file paths (required for add and reset) |
path |
string | No | Repository path |
git_commit
Create a new commit with a message.
| Parameter | Type | Required | Description |
|---|---|---|---|
message |
string | Yes | Commit message |
all |
bool | No | Auto-stage all modified tracked files (-a) |
amend |
bool | No | Amend the previous commit |
path |
string | No | Repository path |
git_diff
Show differences between working tree, staged changes, or between commits.
| Parameter | Type | Required | Description |
|---|---|---|---|
scope |
enum | Yes | working, staged, or commits |
ref1 |
string | No | First commit/branch ref (required for commits) |
ref2 |
string | No | Second ref (defaults to HEAD) |
file |
string | No | Limit diff to a specific file |
stat_only |
bool | No | Show only diffstat summary |
path |
string | No | Repository path |
git_log
View commit history with optional filters.
| Parameter | Type | Required | Description |
|---|---|---|---|
count |
int | No | Max commits to show (default: 10, max: 100) |
oneline |
bool | No | Compact one-line format |
author |
string | No | Filter by author |
since |
string | No | Show commits after this date |
until |
string | No | Show commits before this date |
grep |
string | No | Filter by commit message |
file |
string | No | Show only commits touching this file |
ref |
string | No | Branch or commit to start from |
path |
string | No | Repository path |
git_branch
Manage Git branches — list, create, delete, rename.
| Parameter | Type | Required | Description |
|---|---|---|---|
action |
enum | Yes | list, create, delete, rename, or current |
name |
string | No | Branch name (required for create/delete/rename) |
new_name |
string | No | New name when renaming |
from |
string | No | Start point for new branch |
force |
bool | No | Force delete (-D) |
all |
bool | No | List remote-tracking branches too |
path |
string | No | Repository path |
git_checkout
Switch branches, create+switch, or restore files.
| Parameter | Type | Required | Description |
|---|---|---|---|
target |
string | Yes | Branch, tag, or commit hash |
create |
bool | No | Create and switch (-b) |
files |
string | No | Space-separated files to restore |
path |
string | No | Repository path |
git_tag
Manage Git tags — list, create, delete.
| Parameter | Type | Required | Description |
|---|---|---|---|
action |
enum | Yes | list, create, or delete |
name |
string | No | Tag name (required for create/delete) |
message |
string | No | Annotation message (creates annotated tag) |
ref |
string | No | Commit to tag (defaults to HEAD) |
pattern |
string | No | Glob filter for listing (e.g. "v1.*") |
path |
string | No | Repository path |
git_remote
Manage Git remotes — list, add, remove, show.
| Parameter | Type | Required | Description |
|---|---|---|---|
action |
enum | Yes | list, add, remove, or show |
name |
string | No | Remote name (required for add/remove/show) |
url |
string | No | Remote URL (required for add) |
path |
string | No | Repository path |
git_push
Push local commits to a remote repository.
| Parameter | Type | Required | Description |
|---|---|---|---|
remote |
string | No | Remote name (default: "origin") |
branch |
string | No | Branch to push (defaults to current) |
force |
bool | No | Force push |
tags |
bool | No | Push all tags |
set_upstream |
bool | No | Set upstream tracking (-u) |
path |
string | No | Repository path |
git_pull
Fetch and integrate changes from a remote repository.
| Parameter | Type | Required | Description |
|---|---|---|---|
remote |
string | No | Remote name (default: "origin") |
branch |
string | No | Remote branch to pull |
rebase |
bool | No | Rebase instead of merge |
path |
string | No | Repository path |
git_merge
Merge a branch into the current branch.
| Parameter | Type | Required | Description |
|---|---|---|---|
branch |
string | No | Branch to merge (required unless aborting) |
no_ff |
bool | No | Create merge commit even if fast-forward possible |
message |
string | No | Custom merge commit message |
abort |
bool | No | Abort an in-progress merge |
path |
string | No | Repository path |
Repository Analysis Tools
git_churn_hotspots
Rank the files that change most often in a selected time window.
| Parameter | Type | Required | Description |
|---|---|---|---|
period |
enum | No | 1-month, 3-months, 6-months, 1-year, or all-time |
limit |
int | No | Max files to show (default: 20, max: 50) |
path |
string | No | Repository path |
git_contributor_ranking
Rank contributors by commit count and flag bus-factor or maintainer drift.
| Parameter | Type | Required | Description |
|---|---|---|---|
period |
enum | No | all-time, 1-year, 6-months, or 3-months |
merge_strategy |
enum | No | ignore-merges or count-merges |
limit |
int | No | Max contributors to show (default: 20, max: 50) |
path |
string | No | Repository path |
git_bug_hotspots
Find files that repeatedly appear in bug-fix commits and cross-check them with churn hotspots.
| Parameter | Type | Required | Description |
|---|---|---|---|
period |
enum | No | 1-month, 3-months, 6-months, 1-year, or all-time |
keywords |
string | No | Regex used to match fix-heavy commit messages (default: `fix |
limit |
int | No | Max files to show (default: 20, max: 50) |
path |
string | No | Repository path |
git_velocity_trend
Summarize commit activity over time.
| Parameter | Type | Required | Description |
|---|---|---|---|
period |
enum | No | 1-year, 2-years, or all-time |
granularity |
enum | No | month, quarter, or year |
path |
string | No | Repository path |
git_crisis_detection
Detect revert, hotfix, rollback, or emergency commit patterns that suggest firefighting.
| Parameter | Type | Required | Description |
|---|---|---|---|
period |
enum | No | 1-month, 3-months, 6-months, or 1-year |
keywords |
string | No | Regex used to match crisis-oriented commit messages (default: `revert |
path |
string | No | Repository path |
git_repo_triage
Run the full audit workflow and return one machine-readable report containing churn, bug hotspots, contributor ranking, velocity, crisis detection, and derived priority signals.
| Parameter | Type | Required | Description |
|---|---|---|---|
hotspot_period |
enum | No | 1-month, 3-months, 6-months, 1-year, or all-time |
contributor_period |
enum | No | all-time, 1-year, 6-months, or 3-months |
velocity_period |
enum | No | 1-year, 2-years, or all-time |
velocity_granularity |
enum | No | month, quarter, or year |
crisis_period |
enum | No | 1-month, 3-months, 6-months, or 1-year |
limit |
int | No | Max rows to include in each section (default: 20, max: 50) |
bug_keywords |
string | No | Regex used to match bug-fix commits |
crisis_keywords |
string | No | Regex used to match crisis-oriented commits |
path |
string | No | Repository path |
Usage Examples
Feature Branch Workflow
git_branch(action: "create", name: "feature/new-api")
git_checkout(target: "feature/new-api")
# ... make changes ...
git_stage(action: "add_all")
git_commit(message: "feat: implement new API endpoint")
git_push(branch: "feature/new-api", set_upstream: true)
Quick Commit
git_status(short: true)
git_diff(scope: "working")
git_stage(action: "add", files: "src/Handler.php src/Router.php")
git_commit(message: "fix: handle null response in router")
Reviewing History
git_log(count: 10, oneline: true)
git_diff(scope: "commits", ref1: "HEAD~5")
git_diff(scope: "commits", ref1: "main", ref2: "feature/x", stat_only: true)
Repository Triage Before Reading Code
git_repo_triage()
Use this when you want one compact JSON report. If you want to inspect a single signal in more detail, call the individual analysis tools instead.
Tagging a Release
git_tag(action: "create", name: "v1.2.0", message: "Release 1.2.0")
git_push(tags: true)
Architecture
src/
├── Analysis/
│ └── GitAnalysisService.php # Shared parsing + formatting for repository triage tools
├── GitToolkit.php # ToolkitInterface — registers all tools + guidelines
├── Runtime/
│ ├── GitRunner.php # proc_open wrapper with timeout + output truncation
│ └── GitResult.php # Typed result VO (exitCode, stdout, stderr)
└── Tool/
├── GitInitTool.php
├── GitStatusTool.php
├── GitStageTool.php
├── GitCommitTool.php
├── GitDiffTool.php
├── GitLogTool.php
├── GitBranchTool.php
├── GitCheckoutTool.php
├── GitTagTool.php
├── GitRemoteTool.php
├── GitPushTool.php
├── GitPullTool.php
└── GitMergeTool.php
├── GitChurnHotspotsTool.php
├── GitContributorRankingTool.php
├── GitBugHotspotsTool.php
├── GitVelocityTrendTool.php
└── GitCrisisDetectionTool.php
└── GitRepoTriageTool.php
skills/
└── git-repository-audit/
└── SKILL.md # Bundled repo-triage workflow guidance
Development
# Install dependencies composer install # Run tests composer test # Static analysis composer analyse
License
MIT
coquibot/coqui-toolkit-git 适用场景与选型建议
coquibot/coqui-toolkit-git 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 18 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 03 月 17 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「toolkit」 「git」 「version-control」 「php-agents」 「coqui」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 coquibot/coqui-toolkit-git 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 coquibot/coqui-toolkit-git 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 coquibot/coqui-toolkit-git 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Easily manage git hooks in your composer config
MediaWiki extension that allows embedding external content, specified by URL, into your wiki pages
Nagios plugin to verify a git repository.
Symfony2 Bundle that adds basic user account entity and city/state/country setup as well
A powerful, Laravel-first GitHub API client with auto-pagination, strong typing, and comprehensive GitHub integration for repositories, pull requests, issues, and more.
GitHub Webhook Listener with plugin-based API for creating your own triggerered actions
统计信息
- 总下载量: 18
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 48
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-03-17