</>DEVELOPERS为工程师构建,
为工程师构建,
向 Agent 开放。
同一套事务化领域服务,暴露为 CLI、JSON-RPC、SSE、MCP 与 ACP。你在界面里点的每一个按钮,都能用代码完成——也能交给另一个 Agent 完成。
01QUICKSTART
四步,从零到一家公司。
- 01
安装
一条命令获取单二进制。
curl -fsSL https://kernuq.com/install.sh | shcurl -fsSL https://kernuq.com/install.sh | shirm https://kernuq.com/install.ps1 | iex - 02
自检
确认宿主环境、存储与内核版本。
zsh$ kernuq probe --json - 03
预演与导入
先 --dry-run 校验,再写入 SQLite 唯一真源。
zsh$ kernuq validate --config kernuq.yaml --dry-run --json $ kernuq import --config kernuq.yaml --db ~/.kernuq/data/kernuq.db - 04
启动
守护进程 + 内嵌控制台,默认仅绑定回环地址。
zsh$ kernuq serve --config kernuq.yaml --ui # → http://127.0.0.1:7680
03CLI
Agent-First 命令行。
全部命令支持 --json 机器输出;所有写操作支持 --dry-run 预演差异。
| 命令 | 作用 |
|---|---|
kernuq manual [topic] | 渐进式 Agent-First 手册 |
kernuq schema <kind> | 输出正式 JSON Schema |
kernuq skill-export [--dir] | 导出 Agent Skills SKILL.md |
kernuq probe [--json] | 宿主与内核探针 |
kernuq validate --config <f> --dry-run | 预演校验配置 |
kernuq import --config <f> --db <db> | 导入种子至 SQLite 真源 |
kernuq export --db <db> --dir <out> | 导出 GitOps 配置包 |
kernuq serve --config <f> --ui | 启动守护进程与控制台 :7680 |
kernuq mcp-serve --profile builder | 作为 MCP Server 运行 |
kernuq agent-host --wrap claude | 将本地 CLI Agent 桥接为 ACP 节点 |
04SCHEMAS
正式 JSON Schema。
语言无关的 KSP v1.0 契约。可在本地 kernuq schema <kind> 输出,也可从边缘 API 直接获取。
harness.schema.jsonkernuq schema harnessformation.schema.jsonkernuq schema formationcompute.schema.jsonkernuq schema computeresource-catalog.schema.jsonkernuq schema resource-catalogevent.schema.jsonkernuq schema eventhypertext-input.schema.jsonkernuq schema hypertext-inputsdui.schema.jsonkernuq schema sduiui-widget.schema.jsonkernuq schema ui-widget
05CLIENTS
任何语言,几行代码。
client.ts
// TypeScript · Node 18+ / Deno / Bun / 浏览器
const rpc = async <T>(method: string, params: object = {}): Promise<T> => {
const res = await fetch('http://127.0.0.1:7680/rpc', {
method: 'POST',
headers: {
'content-type': 'application/json',
authorization: `Bearer ${process.env.KERNUQ_TOKEN}`,
},
body: JSON.stringify({ jsonrpc: '2.0', id: crypto.randomUUID(), method, params }),
})
const { result, error } = await res.json()
if (error) throw new Error(`[${error.code}] ${error.message}`)
return result as T
}
const probe = await rpc('system.probe')
const events = new EventSource('http://127.0.0.1:7680/events/sse')
events.addEventListener('kiep', (e) => console.log(JSON.parse(e.data)))main.go
// Go 1.22+
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
"os"
)
func main() {
body, _ := json.Marshal(map[string]any{
"jsonrpc": "2.0", "id": 1, "method": "harness.list",
"params": map[string]any{"owner_unit_uri": "org://unit/group_hq"},
})
req, _ := http.NewRequest("POST", "http://127.0.0.1:7680/rpc", bytes.NewReader(body))
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer "+os.Getenv("KERNUQ_TOKEN"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
var out struct {
Result json.RawMessage `json:"result"`
Error *struct{ Code int; Message string } `json:"error"`
}
_ = json.NewDecoder(res.Body).Decode(&out)
fmt.Println(string(out.Result))
}client.py
# Python 3.9+
import os, json, urllib.request
def rpc(method, **params):
req = urllib.request.Request(
"http://127.0.0.1:7680/rpc",
data=json.dumps({"jsonrpc": "2.0", "id": 1, "method": method, "params": params}).encode(),
headers={
"Content-Type": "application/json",
"Authorization": f"Bearer {os.environ['KERNUQ_TOKEN']}",
},
)
body = json.load(urllib.request.urlopen(req))
if "error" in body:
raise RuntimeError(body["error"])
return body["result"]
print(rpc("agent.spawn_and_run",
harness_uri="harness://ops/log-analyzer",
input="Summarize 5xx errors in the last 24h"))让第一枚转子
开始旋转。
一条命令安装。零依赖,单文件,本机即刻拥有一家由人与 MicroAgent 混编的公司。
curl -fsSL https://kernuq.com/install.sh | sh
curl -fsSL https://kernuq.com/install.sh | sh
irm https://kernuq.com/install.ps1 | iex