isaacsight/kernel

GitHub: isaacsight/kernel

一个集成 35 个专家代理和 600 多个工具的开源终端 AI 代理,支持 20 个提供商和完全离线运行,覆盖安全、金融、科研等广泛领域。

Stars: 8 | Forks: 2

kbot
开源终端 AI 代理。35 个代理。600+ 工具。20 个提供商。涵盖科学、金融、安全等领域。

kbot demo

CI npm version npm downloads MIT License kernel.chat Discord

``` npm install -g @kernel.chat/kbot ``` ## 为什么选择 kbot? 大多数终端 AI 代理会将你锁定在一个提供商、一个模型、一种工作方式上。但 kbot 不会。 - **20 个提供商,零锁定** — Claude, GPT, Gemini, Grok, DeepSeek, Groq, Mistral, SambaNova, Cerebras, OpenRouter 等。只需一条命令即可切换。 - **完全离线运行** — 内置 llama.cpp, Ollama, LM Studio 或 Jan。费用 $0,完全隐私。 - **学习你的模式** — 贝叶斯技能评分 + 模式提取。随着时间推移变得更快。 - **35 个专家代理** — 自动将你的请求路由到合适的专家(coder, researcher, writer, guardian, quant 等 30 多个)。 - **600+ 工具** — 文件, bash, git, GitHub, 网页搜索, 部署, 数据库, 游戏开发, VFX, 研究, 科学, 金融, 安全等。 - **编程 SDK** — 在你自己的应用中将 kbot 作为库使用。 - **内置 MCP 服务器** — 将 kbot 作为工具提供者接入 Claude Code, Cursor, VS Code, Zed 或 Neovim。 ### 对比 | | kbot | Claude Code | Codex CLI | Aider | OpenCode | |---|---|---|---|---|---| | AI 提供商 | 20 | 1 | 1 | 6 | 75+ | | 专家代理 | 35 | 0 | 0 | 0 | 0 | | 内置工具 | 600+ | ~20 | ~15 | ~10 | ~15 | | 科学工具 | 114 | 0 | 0 | 0 | 0 | | 学习引擎 | 是 | 否 | 否 | 否 | 否 | | 离线模式 | Embedded + Ollama | 否 | 否 | Ollama | Ollama | | SDK | 是 | 否 | 是 | 否 | 否 | | MCP 服务器 | 是 | N/A | 否 | 否 | 否 | | Web 配套 | kernel.chat | 否 | 否 | 否 | 否 | | 开源协议 | MIT | Source available | Apache 2.0 | Apache 2.0 | MIT | | 成本 | BYOK / $0 local | $20+/mo | BYOK | BYOK | BYOK | ## 快速开始 ``` # 全局安装 npm install -g @kernel.chat/kbot # 或直接运行(无需安装) npx @kernel.chat/kbot # 或使用安装脚本(如有需要会自动安装 Node.js) curl -fsSL https://kernel.chat/install.sh | bash ``` ``` # 交互模式 kbot # 单次执行 kbot "explain this codebase" kbot "fix the auth bug in src/auth.ts" kbot "create a Dockerfile for this project" # 管道模式(用于脚本) kbot -p "generate a migration for user roles" > migration.sql # 使用本地模型(免费,无需 API key) kbot local # 设置你的 API key kbot auth ``` ## 专家代理 kbot 会自动将任务路由到合适的代理。或者使用 `--agent ` 指定一个。 | | 代理 | |---|---| | **核心** | kernel, researcher, coder, writer, analyst | | **扩展** | aesthete, guardian, curator, strategist | | **领域** | infrastructure, quant, investigator, oracle, chronist, sage, communicator, adapter | | **预设** | claude-code, cursor, copilot, creative, developer | ## 600+ 工具 | 类别 | 示例 | |----------|---------| | **文件与代码** | read, write, glob, grep, lint, format, type-check | | **Shell** | bash, parallel execute, background tasks | | **Git 与 GitHub** | commit, diff, PR, issues, code search | | **Web** | search, fetch, browser automation, browser agent | | **研究** | arXiv, Semantic Scholar, HuggingFace, NASA, DOI | | **数据** | CSV read/query/write, transforms, reports, invoices | | **质量** | lint (ESLint/Biome/Clippy), test (Vitest/Jest/pytest), deps audit, formatting | | **部署** | Vercel, Netlify, Cloudflare Workers/Pages, Fly.io, Railway | | **数据库** | Postgres, MySQL, SQLite queries, Prisma, ER diagrams, seed data | | **容器** | Docker build/run/compose, Terraform | | **创意** | p5.js generative art, GLSL shaders, SVG patterns, design variants | | **VFX** | GLSL shaders, FFmpeg, ImageMagick, Blender, procedural textures | | **游戏开发** | 16 tools for Godot, Unity, Unreal, Bevy, Phaser, Three.js, PlayCanvas, Defold | | **训练** | dataset prep, fine-tuning, evaluation, model export | | **社交** | post to X, LinkedIn, Bluesky, Mastodon — single posts and threads | | **沙箱** | Docker sandboxes, E2B cloud sandboxes, isolated code execution | | **Notebooks** | Jupyter read/edit/insert/delete cells | | **构建矩阵** | cross-platform builds — mobile, desktop, WASM, embedded, server | | **LSP** | goto definition, find references, hover, rename, diagnostics | | **记忆** | persistent memory save/search/update across sessions | | **MCP** | marketplace search/install, 20 bundled servers | | **IDE** | MCP server, ACP server, LSP bridge | | **Forge** | create tools at runtime, publish to registry, install from registry | | **元工具** | subagents, worktrees, planner, sessions, checkpoints, self-eval | | **科学与数学** | symbolic compute, matrix ops, FFT, ODEs, probability, optimization, graph theory, OEIS | | **物理** | orbital mechanics, circuits, signal processing, particles (PDG), relativity, quantum simulator, beam analysis, fluid dynamics | | **化学** | PubChem compounds, reactions, periodic table (118 elements), spectroscopy, stoichiometry, thermodynamics | | **生物学** | PubMed, gene lookup, protein/PDB, BLAST, drug/ChEMBL, pathways, taxonomy, clinical trials | | **地球与气候** | earthquakes/USGS, climate/NOAA, satellite imagery, geology, ocean, air quality, volcanoes, water resources | | **神经科学** | brain atlas, EEG analysis, cognitive models, neural simulation, connectome, psychophysics | | **社会科学** | psychometrics, game theory, econometrics, social network analysis, survey design, voting systems | | **人文** | corpus analysis, formal logic, argument mapping, ethics frameworks, historical timelines, stylometry | | **健康与流行病学** | SIR/SEIR models, epidemiology calculations, disease surveillance, nutrition, vaccination modeling | | **金融** | market data, technical analysis, paper trading, DeFi yields, wallet & swaps, stock screener, sentiment | | **网络安全** | dep_audit, secret_scan, ssl_check, headers_check, cve_lookup, port_scan, owasp_check | | **自我防御** | memory HMAC, prompt injection detection, knowledge sanitization, forge verification, anomaly detection | ## 20 个提供商 | 提供商 | 成本 | 本地? | |----------|------|--------| | **Embedded (llama.cpp)** | **Free** | 是 | | **Ollama** | **Free** | 是 | | **LM Studio** | **Free** | 是 | | **Jan** | **Free** | 是 | | DeepSeek | $0.27/M in | 云端 | | SambaNova | $0.50/M in | 云端 | | Cerebras | $0.60/M in | 云端 | | Groq | $0.59/M in | 云端 | | NVIDIA NIM | $0.80/M in | 云端 | | Together AI | $0.88/M in | 云端 | | Fireworks AI | $0.90/M in | 云端 | | Google (Gemini) | $1.25/M in | 云端 | | Mistral | $2.00/M in | 云端 | | OpenAI (GPT) | $2.00/M in | 云端 | | Cohere | $2.50/M in | 云端 | | Anthropic (Claude) | $3.00/M in | 云端 | | xAI (Grok) | $3.00/M in | 云端 | | Perplexity | $3.00/M in | 云端 | | OpenRouter | varies | 云端 | | kbot local | **Free** | 是 | 设置任意提供商的环境变量,kbot 即可自动检测。或运行 `kbot auth` 进行交互式设置。 ## SDK ``` import { agent, tools, providers } from '@kernel.chat/kbot' const result = await agent.run("fix the auth bug", { agent: 'coder' }) console.log(result.content) for await (const event of agent.stream("explain this code")) { if (event.type === 'content_delta') process.stdout.write(event.text) } ``` ## 架构 ``` graph TD A[User Message] --> B{Local-first check} B -->|file, git, grep| C[Instant response — $0] B -->|Needs AI| D{Complexity detection} D -->|Simple| E[Bayesian Router → Specialist] D -->|Multi-step| F[Autonomous Planner] E --> G[Provider API + Tool Loop] F --> G G --> H{600+ Tools} H --> I[File ops, bash, git, GitHub, search, deploy, DB, game dev...] G --> J[Learning Engine] J --> K[Patterns + Solutions + User Profile] G --> L[Checkpointing] L --> M[Resume from last tool call] ``` ## MCP 服务器 在任何兼容 MCP 的 IDE 中将 kbot 作为工具提供者使用: ``` { "mcp": { "servers": { "kbot": { "command": "kbot", "args": ["ide", "mcp"] } } } } ``` 支持 Claude Code, Cursor, VS Code, Windsurf, Zed, Neovim。 ## 命令 | 命令 | 功能 | |---------|-------------| | `kbot` | 交互式 REPL | | `kbot "prompt"` | 一次性执行 | | `kbot auth` | 配置 API 密钥 | | `kbot local` | 使用本地 AI (Ollama, embedded, LM Studio, Jan) | | `kbot serve` | 启动 HTTP REST + SSE 流服务器 | | `kbot audit ` | 对任意 GitHub 仓库进行安全与质量审计 | | `kbot contribute ` | 寻找 good-first-issues 和快速贡献点 | | `kbot share` | 将对话分享为 GitHub Gist | | `kbot pair` | 带有自动分析的文件监视器 | | `kbot team` | 多代理 TCP 协作 | | `kbot record` | 终端会话录制 (SVG, GIF, asciicast) | | `kbot voice` | 文本转语音输出模式 | | `kbot watch` | 实时文件更改分析 | | `kbot bootstrap` | 外部循环项目优化器 (可见度评分) | | `kbot plugins` | 搜索、安装、更新社区插件 | | `kbot models` | 列出、拉取、移除、目录本地模型 | | `kbot changelog` | 从 git 历史生成更新日志 | | `kbot completions` | Shell 补全 (bash, zsh, fish) | | `kbot cloud` | 将学习数据同步至 kernel.chat | | `kbot ide mcp` | 为 IDE 启动 MCP 服务器 | | `kbot doctor` | 10 项健康检查 | ### 高级用户标志 ``` kbot --architect "design the auth system" # Architecture mode — plan before code kbot --thinking "solve this hard problem" # Extended reasoning with thinking budget kbot --self-eval "write a parser" # Self-evaluation loop — scores and retries kbot --computer-use "fill out this form" # Computer use — controls mouse and keyboard kbot -p "query" > output.txt # Pipe mode — clean output for scripting ``` ## 安全性 - API 密钥静态加密 (AES-256-CBC) - 破坏性操作需确认 - Shell 命令通过黑名单进行沙箱化 - 工具执行超时 (5 分钟) 及中间件管道 - 配置文件仅限所有者访问 (chmod 600) - 0 个 P0/P1 安全问题 (2026 年 3 月审计) ## 开发 ``` cd packages/kbot npm install npm run dev # Run in dev mode npm run build # Compile TypeScript npm run test # Run tests (vitest) ``` ## Web 配套 — kernel.chat kbot 在 [kernel.chat](https://kernel.chat) 上有一个 Web 配套应用——提供相同的代理、持久化记忆和可视化界面。免费使用 (20 条消息/天)。 ## 社区 - **Web**: [kernel.chat](https://kernel.chat) - **npm**: [@kernel.chat/kbot](https://www.npmjs.com/package/@kernel.chat/kbot) - **Discord**: [discord.gg/kdMauM9abG](https://discord.gg/kdMauM9abG) - **GitHub**: [isaacsight/kernel](https://github.com/isaacsight/kernel) - **Issues**: [报告 Bug](https://github.com/isaacsight/kernel/issues) ## 许可证 [MIT](LICENSE) — [kernel.chat group](https://kernel.chat)
标签:AI智能体, AI编程, AI风险缓解, CTF平台, DevSecOps, IP 地址批量处理, JSON 请求, llama.cpp, LLM评估, MITM代理, NodeJS, npm包, Ollama, 上游代理, 多平台支持, 多智能体协同, 大模型本地部署, 威胁情报, 安全防御系统, 开发者工具, 开源终端工具, 数字取证, 离线运行, 网络信息收集, 网络安全, 网络安全, 自动化攻击, 自动化脚本, 请求拦截, 量化金融, 金融科技, 隐私保护, 隐私保护