AI Skill Hub 推荐使用:Pure-bash LLM 代理内核 是一款优质的Agent工作流。AI 综合评分 7.5 分,在同类工具中表现稳健。如果你正在寻找可靠的Agent工作流解决方案,这是一个值得深入了解的选择。
Pure-bash LLM 代理内核 是一套完整的 AI Agent 自动化工作流方案。通过可视化的节点编排,将复杂的多步骤任务拆解为清晰的自动化流程,实现全程无人值守的智能处理。支持与数百种外部服务和 API 无缝集成,适合构建数据处理管线、业务自动化和 AI 辅助决策系统。
Pure-bash LLM 代理内核 是一套完整的 AI Agent 自动化工作流方案。通过可视化的节点编排,将复杂的多步骤任务拆解为清晰的自动化流程,实现全程无人值守的智能处理。支持与数百种外部服务和 API 无缝集成,适合构建数据处理管线、业务自动化和 AI 辅助决策系统。
# 克隆仓库 git clone https://github.com/zhihumomo/bashagt cd bashagt # 查看安装说明 cat README.md # 按 README 完成环境依赖安装后即可使用
# 查看帮助 bashagt --help # 基本运行 bashagt [options] <input> # 详细使用说明请查阅文档 # https://github.com/zhihumomo/bashagt
# bashagt 配置说明 # 查看配置选项 bashagt --config-example > config.yml # 常见配置项 # output_dir: ./output # log_level: info # workers: 4 # 环境变量(覆盖配置文件) export BASHAGT_CONFIG="/path/to/config.yml"
English | 中文
A pure-bash LLM agent kernel — zero runtime dependencies, runs anywhere bash does.
---
┌─────────────────────────────────────────────────────┐
│ main() │
│ (CLI parsing → init → mode dispatch) │
├─────────────────────────────────────────────────────┤
│ • --install Initialize system directories │
│ • --run Start HTTP daemon │
│ • --oneshot Single-shot pipe mode │
│ • (default) Interactive REPL │
└────────────────────┬────────────────────────────────┘
│
┌───────────────▼──────────────────────┐
│ agent_loop() │
│ Interactive REPL or oneshot entry │
└───────────────┬──────────────────────┘
│
┌───────────────▼──────────────────────┐
│ run_turn() │
│ User input → API call → response │
│ ↓ stop_reason? │
│ end_turn ← return to user │
│ tool_use → dispatch_tool → loop │
└───────────────┬──────────────────────┘
│
┌───────────────▼──────────────────────┐
│ dispatch_tool() │
│ 24 tools: read_file, write_file, │
│ edit_file, bash, agent, web_search, │
│ make_todos, skill, request... │
└──────────────────────────────────────┘
━━━━━━━━━━━━ Subsystems ━━━━━━━━━━━━
Memory Network Sub-Agent System Hook System
┌──────────┐ ┌────────────┐ ┌──────────┐
│16 engrams│ │11 sys agents│ │ 8 points │
│×200 slots│ │ N proj agents│ │ 6 types │
│sem search │ │ parallel │ │ lifecycle │
│sleep compr│ │ async sched │ │ hot-reload│
└──────────┘ └────────────┘ └──────────┘
---
This may be Bashagt's most distinctive capability — because it is itself a plain-text bash script, and it has tools to read, edit, and execute files, Bashagt can modify its own source code.
You say a sentence. It adds a feature.
---
Bashagt has only three dependencies — installable with a single package manager command on any mainstream platform:
| Dependency | Minimum | Purpose |
|---|---|---|
| **bash** | 4.0+ | Script runtime. Built into virtually all modern systems. |
| **jq** | Any | JSON processing for API communication and config file handling. |
| **curl** | Any | HTTP client for communicating with LLM API endpoints. |
Additionally, Termux (Android) requires the coreutils package (for realpath/nl and other GNU tools). See platform-specific instructions below.
---
brew install bash jq curl
Homebrew-installed bash lives at `/opt/homebrew/bin/bash` (Apple Silicon) or `/usr/local/bin/bash` (Intel). Bashagt uses `#!/usr/bin/env bash`, so as long as the Homebrew path appears before `/bin` in `/etc/paths`, the new version will be used automatically.
bash
pkg install bash jq curl git coreutils
Installation is uniform across all platforms — three steps:
1. Get the script → 2. Install dependencies → 3. ./bashagt --install
--install automatically: creates the ~/.bashagt/ directory tree, generates a default config file, registers bash/zsh hotkeys, and adds bashagt to your PATH.
---
Applies to all mainstream Linux distributions (Debian/Ubuntu, RHEL/CentOS, Arch, Alpine, openSUSE, etc.) and traditional Unix.
Step 1: Install dependencies
```bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
bash --version
| Extra package | Purpose |
|--------------|---------|
| `coreutils` | Provides `realpath`, `nl`, and other GNU tools that Bashagt depends on. **Required.** |
| `termux-api` | Android API bridge (optional). Enables Bashagt to control phone hardware via Termux-API tools — see "Termux-API Integration" below. |
**Step 3: Install Bashagt**
bash git clone https://github.com/zhihumomo/bashagt.git cd bashagt ./bashagt --install
> **Storage access**: Termux can only access the shared internal storage directory `~/storage/shared/` by default. To access external SD cards or other locations, run `termux-setup-storage` to grant storage permissions.
---
##### 🔧 Mounting External Storage
To work with external SD cards or USB storage devices in Termux:
bash
---
Say you want Bashagt to show token usage stats for the current session. You just say:
bashagt> Add a /stats slash command that shows token usage and API call count for this session
Bashagt will navigate its own source to find where slash commands are registered (_slash_dispatch), locate the statistics variables (TURN_TOKENS_IN, TURN_TOKENS_OUT…), and insert the new command implementation. It'll even run bash -n for a syntax check when done.
---
After installation, edit ~/.bashagt/settings.json with your API details:
{
"api_url": "https://api.deepseek.com/anthropic",
"api_key": "sk-your-api-key-here",
"model": "deepseek-chat",
"max_tokens": 8192,
"thinking_budget": 16384
}
Compatible backends: Bashagt uses the Anthropic Messages API protocol. The default points to DeepSeek. You can also switch to: - Anthropic official:"api_url": "https://api.anthropic.com","model": "claude-sonnet-4-20250514"- Other OpenAI-compatible endpoints: such as Ollama, vLLM, LiteLLM, or other locally-deployed models
Recommended — secure approach: Use environment variables instead of storing the API key in a config file:
export BASHAGT_API_KEY="sk-your-api-key-here"
Environment variables take priority over config files (4-tier config: defaults → settings.json → project settings.json → environment variables).
---
The most extreme scenario: a machine physically isolated from the internet, but with an internal LLM API available (e.g., Ollama or vLLM):
```bash
export BASHAGT_API_URL="http://192.168.1.100:11434/api/chat" export BASHAGT_API_KEY="ollama"
cat schema.json | bashagt --oneshot --stream ```
Bashagt uses a 4-tier configuration priority (later overrides earlier):
Defaults → ~/.bashagt/settings.json → Project .bashagt/settings.json → Environment variables
| Setting | Env Variable | Default | Description |
|---|---|---|---|
api_url | BASHAGT_API_URL | DeepSeek Anthropic endpoint | API address |
api_key | BASHAGT_API_KEY | — | API key |
model | BASHAGT_MODEL | deepseek-chat | Model name |
max_tokens | BASHAGT_MAX_TOKENS | 8192 | Max output tokens |
thinking_budget | BASHAGT_THINKING_BUDGET | 16384 | Thinking budget |
proxy_url | BASHAGT_PROXY_URL | — | Proxy URL (http/socks4/socks5) |
context_window | BASHAGT_CONTEXT_WINDOW | 128000 | Context window size |
---
You want to embed LLM conversation capabilities in your app, without pulling in a massive Python/Node dependency chain:
```bash
```bash
apk update apk add bash jq curl git coreutils
A sudden 502 in production. You SSH in, facing gigabytes of logs and config files changed who-knows-when:
$ ssh production-server
$ cd /var/log/app
$ bashagt
bashagt> What are the top 5 errors in the nginx error log from the last hour?
bashagt> Check /etc/nginx/nginx.conf for anything that could cause a 502
bashagt> Compare the three configs under /etc/nginx/sites-enabled/ — find the inconsistencies
No special tools needed — the server already has bash. The entire investigation happens in one terminal session.
---
Bashagt — Agents Everywhere,一个纯bash的LLM代理内核 ——零运行时依赖,运行任何bash都可以。
✨功能特点 - **纯bash** — 15,974 行,446 个函数,零 Node/Python 运行时依赖 - ⚡ **零分叉热路径** — 增量消息组装,哈希驱动的上下文/技能缓存,纯bash请求体构造;减少子shell开销 - ️ **跨平台** — Linux(GNU),macOS(BSD),WSL,Termux(Android),iSH(iPhone/iPad) - **24个内置工具** — 文件读写等
环境依赖与系统要求 Bashagt只有三个依赖 — 可以用一个包管理器命令在任何主流平台上安装: | 依赖 | 最小版本 | 目的 | |-----------|---------|---------| | **bash** | 4.0+ | 脚本运行时。几乎所有主流平台都内置了bash。 | **jq** | | JSON 处理 | **curl** | | HTTP 请求
安装步骤 安装是所有平台上统一的 — 三步: 1. 获取脚本 → 2. 安装依赖 → 3. ./bashagt --install `--install`自动: - 创建 `~/.bashagt/` 目录树 - 生成默认配置文件 - 注册bash/zsh快捷键 - 将 `bashagt` 添加到 PATH 中
配置说明 配置文件位于 `~/.bashagt/settings.json`,内容如下: ```json { "api_url": "https://api.deepseek.com/anthropic", "api_key": "sk-your-api-key-here", "model": "deepseek-chat", "max_tokens": 8192, "thinking_budget": 16384 } ``` > **兼容后端**:Bashagt使用Anthropic Messages API协议。默认指向DeepSeek Chat API。
API/接口说明
工作流 / 模块说明
该项目提供了一种创新且高效的 AI 工作流解决方案,基于 bash 内核,零依赖,易于使用。
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ Apache 2.0 — 宽松开源协议,可商用,需保留版权声明和 NOTICE 文件,含专利授权条款。
总体来看,Pure-bash LLM 代理内核 是一款质量良好的Agent工作流,在同类工具中具备一定竞争力。AI Skill Hub 将持续追踪其更新动态,建议收藏备用,结合自身场景选择合适时机引入使用。
| 原始名称 | bashagt |
| 原始描述 | 开源AI工作流:Pure-bash LLM agent kernel — zero runtime dependencies, runs anywhere bash does.。⭐43 · Shell |
| Topics | workflowshell |
| GitHub | https://github.com/zhihumomo/bashagt |
| License | Apache-2.0 |
| 语言 | Shell |
收录时间:2026-06-05 · 更新时间:2026-06-06 · License:Apache-2.0 · AI Skill Hub 不对第三方内容的准确性作法律背书。
选择 Agent 类型,复制安装指令后粘贴到对应客户端