Skip to content

eLeanwang/aun-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AUN CLI & Daemon

AUN 协议的客户端:交互式 CLI + 给 GUI 前端用的无头 daemon。

组成

程序 入口 用途
aun aun_cli.py 交互式 REPL(基于 prompt_toolkit / rich)
aun-daemon aun_daemon.py stdin/stdout NDJSON daemon,供 GUI 前端调用(协议见 protocol.md

SDK 依赖 fastaun(导入名仍为 aun_core)。启动时会自动检查 PyPI 上的新版本并升级。

安装

# 建议用 venv
python3 -m venv .venv
.venv/bin/pip install -e .

装好后同时提供两个命令:aunaun-daemon

CLI 使用

# 交互式 REPL
aun -t evolclaw-ai.agentid.pub

# 单条消息(发完等回复)
aun -t evolclaw-ai.agentid.pub -s "你好"

# 指定 AID
aun -a test-user.agentid.pub -t evolclaw-ai.agentid.pub

不同 AID 天然隔离(SDK 的 AIDs/ 目录按 AID 分子目录),直接开多个终端即可多实例运行。

REPL 命令

  • / — 命令菜单
  • // — 远端命令菜单
  • /target <aid> — 设置目标 AID(持久化)
  • /plain — 切换明文/E2EE 模式(持久化)
  • /debug — 切换调试模式(持久化)
  • /help — 帮助
  • /quit — 退出
  • Ctrl+J — 换行(多行输入)
  • Ctrl+L — 清屏
  • Ctrl+C — 中断任务 / 清空输入 / 双击退出

Daemon 使用

aun-daemon            # 走默认数据目录
aun-daemon --data-dir ~/.aun

# 环境变量
AUN_CLI_DATA=/custom/path aun-daemon      # 同 --data-dir
AUN_SKIP_UPDATE_CHECK=1 aun-daemon        # 跳过启动时的 SDK 更新检查
AUN_DAEMON_LOG=DEBUG aun-daemon           # 日志级别 (stderr)

通过 stdin 发 NDJSON 请求、stdout 读响应 + 事件。协议详见 protocol.md

快速冒烟:

(echo '{"id":1,"method":"initialize"}'; sleep 3; echo '{"id":2,"method":"shutdown"}') \
  | aun-daemon

数据目录

~/.aun/                         # AUN_CLI_DATA 可覆盖
├── aun-cli/
│   ├── config.json             # CLI 配置(aid, target, encrypt, debug, recent_targets)
│   ├── .history                # REPL 输入历史
│   ├── .sdk-check              # 更新检查节流缓存
│   └── downloads/              # 收到的文件
└── AIDs/                       # SDK 管理(多 AID 自然共存)
    └── <aid>/
        ├── private/key.json
        ├── public/cert.pem
        ├── tokens/meta.json
        └── messages.db         # CLI/daemon 共享消息历史

SDK 版本管理

  • 启动时 24h 内最多一次查询 pypi.org(失败静默跳过清华镜像兜底)
  • 发现新版自动 pip install -U fastaun 并重启
  • AUN_SKIP_UPDATE_CHECK=1 禁用

网关配置

  • 域名:gateway.agentid.pub
  • 端口:20001(非标准,SDK discovery 默认查 443 会失败)
  • WebSocket:wss://gateway.agentid.pub:20001/aun

开发

.venv/bin/pip install -e '.[dev]' pytest
.venv/bin/pytest tests/

相关文档

About

AUN CLI + headless daemon (Python) — interactive REPL and stdin/stdout JSON-RPC daemon for AUN protocol

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages