经 AI Skill Hub 精选评估,开源AI工作流 获评「推荐使用」。这款Agent工作流在功能完整性、社区活跃度和易用性方面表现出色,AI 评分 7.5 分,适合有一定技术背景的用户使用。
A universal git-native AI agent framework,内置git repo,提高开发效率和协作能力。
开源AI工作流 是一套完整的 AI Agent 自动化工作流方案。通过可视化的节点编排,将复杂的多步骤任务拆解为清晰的自动化流程,实现全程无人值守的智能处理。支持与数百种外部服务和 API 无缝集成,适合构建数据处理管线、业务自动化和 AI 辅助决策系统。
A universal git-native AI agent framework,内置git repo,提高开发效率和协作能力。
开源AI工作流 是一套完整的 AI Agent 自动化工作流方案。通过可视化的节点编排,将复杂的多步骤任务拆解为清晰的自动化流程,实现全程无人值守的智能处理。支持与数百种外部服务和 API 无缝集成,适合构建数据处理管线、业务自动化和 AI 辅助决策系统。
# 方式一:npm 全局安装 npm install -g gitagent # 方式二:npx 直接运行(无需安装) npx gitagent --help # 方式三:项目依赖安装 npm install gitagent # 方式四:从源码运行 git clone https://github.com/open-gitagent/gitagent cd gitagent npm install npm start
# 命令行使用
gitagent --help
# 基本用法
gitagent [options] <input>
# Node.js 代码中使用
const gitagent = require('gitagent');
const result = await gitagent.run(options);
console.log(result);
# gitagent 配置说明 # 查看配置选项 gitagent --config-example > config.yml # 常见配置项 # output_dir: ./output # log_level: info # workers: 4 # 环境变量(覆盖配置文件) export GITAGENT_CONFIG="/path/to/config.yml"
<p align="center"> <img src="./gitagent-logo.png" alt="GitAgent Logo" width="200" /> </p>
<p align="center"> <img src="https://img.shields.io/npm/v/gitagent?style=flat-square&color=blue" alt="npm version" /> <img src="https://img.shields.io/badge/node-%3E%3D20-brightgreen?style=flat-square" alt="node version" /> <img src="https://img.shields.io/github/license/open-gitagent/gitagent?style=flat-square" alt="license" /> <img src="https://img.shields.io/badge/TypeScript-5.7-blue?style=flat-square&logo=typescript&logoColor=white" alt="typescript" /> </p>
<p align="center"> <strong>A universal git-native multimodal always learning AI Agent (TinyHuman)</strong><br/> Your agent lives inside a git repo — identity, rules, memory, tools, and skills are all version-controlled files. </p>
<p align="center"> <a href="#one-command-install">Install</a> • <a href="#quick-start">Quick Start</a> • <a href="#sdk">SDK</a> • <a href="#architecture">Architecture</a> • <a href="#tools">Tools</a> • <a href="#hooks">Hooks</a> • <a href="#skills">Skills</a> • <a href="#plugins">Plugins</a> </p>
---
Define custom tools the agent can call:
import { query, tool } from "gitagent";
const search = tool(
"search_docs",
"Search the documentation",
{
properties: {
query: { type: "string", description: "Search query" },
limit: { type: "number", description: "Max results" },
},
required: ["query"],
},
async (args) => {
const results = await mySearchEngine(args.query, args.limit ?? 10);
return { text: JSON.stringify(results), details: { count: results.length } };
},
);
for await (const msg of query({
prompt: "Find docs about authentication",
tools: [search],
})) {
// agent can now call search_docs
}
dependencies: - name: shared-tools source: "https://github.com/org/shared-tools.git" version: main mount: tools
Copy, paste, run. That's it — no cloning, no manual setup. The installer handles everything:
bash <(curl -fsSL "https://raw.githubusercontent.com/open-gitagent/gitagent/main/install.sh?$(date +%s)")
This will: - Install gitagent globally via npm - Walk you through API key setup (Quick or Advanced mode) - Launch the voice UI in your browser at http://localhost:3333
Requirements: Node.js 18+, npm, git
npm install -g @open-gitagent/gitagent
gitagent plugin install https://github.com/org/my-plugin.git
gitagent plugin install ./path/to/plugin
gitagent plugin install <source> --name custom-name --force --no-enable
What are the requirements? Node.js 18+ (or 20+ recommended), npm, and git. Install globally with npm install -g @open-gitagent/gitagent.
How do I set up API keys? Run the installer for guided setup:
bash <(curl -fsSL "https://raw.githubusercontent.com/open-gitagent/gitagent/main/install.sh") Or set manually: export OPENAI_API_KEY="sk-..."
Which LLM providers are supported? - OpenAI (GPT-4o, GPT-4o-mini, etc.) - Anthropic (Claude models via native SDK) - Any OpenAI-compatible provider
Use --model flag to override: gitagent --model anthropic:claude-sonnet-4-5-20250929
Run your first agent in one line:
export OPENAI_API_KEY="sk-..."
gitagent --dir ~/my-project "Explain this project and suggest improvements"
That's it. Gitagent auto-scaffolds everything on first run — agent.yaml, SOUL.md, memory/ — and drops you into the agent.
Just set the endpoint — no --import flag, no extra install steps:
OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318 gitagent -p "your prompt"
Telemetry is enabled automatically when the endpoint is set and disabled when it is not. To force-disable even when the endpoint is set, pass GITAGENT_OTEL_ENABLED=false.
For programmatic embedders, call initTelemetry explicitly — you control when initialisation happens:
import { initTelemetry, shutdownTelemetry, query } from "gitagent";
await initTelemetry({ serviceName: "my-app" });
for await (const msg of query({ prompt: "hello", model: "anthropic:claude-4-6-sonnet-latest" })) {
// …
}
await shutdownTelemetry();
OTEL_EXPORTER_OTLP_ENDPOINT and OTEL_EXPORTER_OTLP_HEADERS are read automatically by the OTLP exporter when not supplied programmatically. Pass exporterEndpoint / headers only when you need to override env-based config in code.
Print spans directly to stdout — useful for local debugging:
OTEL_TRACES_EXPORTER=console gitagent -p "test"
```bash docker run --rm -p 16686:16686 -p 4318:4318 jaegertracing/all-in-one:latest
OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318 gitagent -p "test"
| Flag | Short | Description |
|---|---|---|
--dir <path> | -d | Agent directory (default: cwd) |
--repo <url> | -r | GitHub repo URL to clone and work on |
--pat <token> | GitHub PAT (or set GITHUB_TOKEN / GIT_TOKEN) | |
--session <branch> | Resume an existing session branch | |
--model <provider:model> | -m | Override model (e.g. anthropic:claude-sonnet-4-5-20250929) |
--sandbox | -s | Run in sandbox VM |
--prompt <text> | -p | Single-shot prompt (skip REPL) |
--env <name> | -e | Environment config |
Returns an AsyncGenerator<GCMessage> that streams agent events.
import { query } from "gitagent";
for await (const msg of query({
prompt: "Refactor the auth module",
dir: "/path/to/agent",
model: "anthropic:claude-sonnet-4-5-20250929",
})) {
switch (msg.type) {
case "delta": // streaming text chunk
process.stdout.write(msg.content);
break;
case "assistant": // complete response
console.log(`\nTokens: ${msg.usage?.totalTokens}`);
break;
case "tool_use": // tool invocation
console.log(`Tool: ${msg.toolName}(${JSON.stringify(msg.args)})`);
break;
case "tool_result": // tool output
console.log(`Result: ${msg.content}`);
break;
case "system": // lifecycle events & errors
console.log(`[${msg.subtype}] ${msg.content}`);
break;
}
}
| Option | Type | Description |
|---|---|---|
prompt | string \| AsyncIterable | User prompt or multi-turn stream |
dir | string | Agent directory (default: cwd) |
model | string | "provider:model-id" |
env | string | Environment config (config/<env>.yaml) |
systemPrompt | string | Override discovered system prompt |
systemPromptSuffix | string | Append to discovered system prompt |
tools | GCToolDefinition[] | Additional tools |
replaceBuiltinTools | boolean | Skip cli/read/write/memory |
allowedTools | string[] | Tool name allowlist |
disallowedTools | string[] | Tool name denylist |
repo | LocalRepoOptions | Clone a GitHub repo and work on a session branch |
sandbox | SandboxOptions \| boolean | Run in sandbox VM (mutually exclusive with repo) |
hooks | GCHooks | Programmatic lifecycle hooks |
maxTurns | number | Max agent turns |
abortController | AbortController | Cancellation signal |
constraints | object | temperature, maxTokens, topP, topK |
extends: "https://github.com/org/base-agent.git" skills: [code-review, deploy] delegation: mode: auto compliance: risk_level: medium human_in_the_loop: true ```
plugins:
my-plugin:
enabled: true
source: https://github.com/org/my-plugin.git # Auto-install on load
version: main # Git branch/tag
config:
api_key: "${MY_API_KEY}" # Supports env interpolation
timeout: 60
Config resolution priority: agent.yaml config > env var > manifest default.
| Variable | Description | Default |
|---|---|---|
OTEL_EXPORTER_OTLP_ENDPOINT | OTLP/HTTP collector base URL (e.g. http://localhost:4318). When set, telemetry is auto-enabled. | (unset → telemetry off) |
GITAGENT_OTEL_ENABLED | Set to false to disable telemetry even when the endpoint is set | (unset = auto) |
OTEL_SERVICE_NAME | Resource service.name | gitagent |
OTEL_SERVICE_VERSION | Resource service.version | (unset) |
OTEL_EXPORTER_OTLP_HEADERS | Comma-separated key=value pairs, no quotes (e.g. Authorization=Bearer xyz,x-tenant=abc) | (unset) |
OTEL_TRACES_EXPORTER | Set to console to print spans to stdout — no collector needed | (unset) |
npm install gitagent
import { query } from "gitagent";
// Simple query
for await (const msg of query({
prompt: "List all TypeScript files and summarize them",
dir: "./my-agent",
model: "openai:gpt-4o-mini",
})) {
if (msg.type === "delta") process.stdout.write(msg.content);
if (msg.type === "assistant") console.log("\n\nDone.");
}
// Local repo mode via SDK
for await (const msg of query({
prompt: "Fix the login bug",
model: "openai:gpt-4o-mini",
repo: {
url: "https://github.com/org/repo",
token: process.env.GITHUB_TOKEN!,
},
})) {
if (msg.type === "delta") process.stdout.write(msg.content);
}
The SDK provides a programmatic interface to Gitagent agents. It mirrors the Claude Agent SDK pattern but runs in-process — no subprocesses, no IPC.
```bash
Plugins are reusable extensions that can provide tools, hooks, skills, prompts, and memory layers. They follow the same git-native philosophy — a plugin is a directory with a plugin.yaml manifest.
gitagent plugin list
gitagent plugin init my-plugin ```
| Flag | Description |
|---|---|
--name <name> | Custom plugin name (default: derived from source) |
--force | Reinstall even if already present |
--no-enable | Install without auto-enabling |
id: my-plugin # Required, kebab-case
name: My Plugin
version: 0.1.0
description: What this plugin does
author: Your Name
license: MIT
engine: ">=0.3.0" # Min gitagent version
provides:
tools: true # Load tools from tools/*.yaml
skills: true # Load skills from skills/
prompt: prompt.md # Inject into system prompt
hooks:
pre_tool_use:
- script: hooks/audit.sh
description: Audit tool calls
config:
properties:
api_key:
type: string
description: API key
env: MY_API_KEY # Env var fallback
timeout:
type: number
default: 30
required: [api_key]
entry: index.ts # Optional programmatic entry point
Plugins with an entry field in their manifest get a full API:
// index.ts
import type { GitagentPluginApi } from "gitagent";
export async function register(api: GitagentPluginApi) {
// Register a tool
api.registerTool({
name: "search_docs",
description: "Search documentation",
inputSchema: {
properties: { query: { type: "string" } },
required: ["query"],
},
handler: async (args) => {
const results = await search(args.query);
return { text: JSON.stringify(results) };
},
});
// Register a lifecycle hook
api.registerHook("pre_tool_use", async (ctx) => {
api.logger.info(`Tool called: ${ctx.tool}`);
return { action: "allow" };
});
// Add to system prompt
api.addPrompt("Always check docs before answering questions.");
// Register a memory layer
api.registerMemoryLayer({
name: "docs-cache",
path: "memory/docs-cache.md",
description: "Cached documentation lookups",
});
}
Available API methods:
| Method | Description |
|---|---|
registerTool(def) | Register a tool the agent can call |
registerHook(event, handler) | Register a lifecycle hook (on_session_start, pre_tool_use, post_response, on_error) |
addPrompt(text) | Append text to the system prompt |
registerMemoryLayer(layer) | Register a memory layer |
logger.info/warn/error(msg) | Prefixed logging ([plugin:id]) |
pluginId | Plugin identifier |
pluginDir | Absolute path to plugin directory |
config | Resolved config values |
my-plugin/
├── plugin.yaml # Manifest (required)
├── tools/ # Declarative tool definitions
│ └── *.yaml
├── hooks/ # Hook scripts
├── skills/ # Skill modules
├── prompt.md # System prompt addition
└── index.ts # Programmatic entry point
Why is my agent not responding? - Check API key is set (OPENAI_API_KEY or equivalent) - Verify network connectivity to LLM provider - Use --verbose flag for detailed logs - Check agent.yaml model configuration
How do I debug agent behavior? - Use console exporter: OTEL_TRACES_EXPORTER=console gitagent -p "test" - Check spans in Jaeger: docker run -p 16686:16686 -p 4318:4318 jaegertracing/all-in-one - Inspect memory/ directory for agent state
Where can I get help? - GitHub Issues: https://github.com/open-gitagent/gitagent/issues - Examples: See README SDK section and CLI options - Contributing: See CONTRIBUTING.md for guidelines
gitagent是一个开源的AI工作流框架,内置git repo,提高开发效率和协作能力,值得关注。
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ MIT 协议 — 最宽松的开源协议之一,可自由商用、修改、分发,仅需保留版权声明。
AI Skill Hub 点评:开源AI工作流 的核心功能完整,质量良好。对于自动化工程师和运维人员来说,这是一个值得纳入个人工具库的选择。建议先在非生产环境试用,再逐步推广。
| 原始名称 | gitagent |
| Topics | workflowai-agentsanthropicassistantllmopenclawtypescript |
| GitHub | https://github.com/open-gitagent/gitagent |
| License | MIT |
| 语言 | TypeScript |
收录时间:2026-05-24 · 更新时间:2026-05-24 · License:MIT · AI Skill Hub 不对第三方内容的准确性作法律背书。
选择 Agent 类型,复制安装指令后粘贴到对应客户端