agent-Specialization/cli/bin/astrion
JOJO d97c1423b1 feat(cli): rewrite CLI on opentui with Gateway host Bearer channel
- replace Ink implementation with opentui + React 19 (old version kept at cli/legacy-ink-src/ for field reference)
- all traffic goes through Gateway host Bearer token; workspace bound via X-Astrion-Workspace-Id header
- auto-spawn server only when no instance is alive (never kill/restart running ones); stale server without token is detected
- astrion launcher (bin/astrion, symlink-aware, --version/--help fast-exit)
- slash menu panels (session/model/mode/permission/path/context/approvals...) with shared selector component
- backend: host workspace list/create dual-channel endpoints, host token generated at startup
- i18n reads OS locale at startup (zh/en)

Co-authored-by: Astrion powered by Kimi-K3 <astrion-agent@users.noreply.github.com>
2026-09-11 17:27:53 +08:00

42 lines
1.4 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/sh
# astrion 启动入口:优先使用 bunopentui FFI 需要 bun>=1.3 或 node>=26.4
# 支持经 symlink 调用(/opt/homebrew/bin/astrion -> cli/bin/astrion先解析真实路径再定位 src
# 解析符号链接得到脚本真实路径macOS 无 readlink -f手动逐级解析
SELF="$0"
while [ -L "$SELF" ]; do
LINK_DIR="$(cd -P "$(dirname "$SELF")" >/dev/null 2>&1 && pwd)"
SELF="$(readlink "$SELF")"
case "$SELF" in
/*) ;; # 绝对路径直接用
*) SELF="$LINK_DIR/$SELF" ;; # 相对路径相对链接所在目录展开
esac
done
SCRIPT_DIR="$(cd -P "$(dirname "$SELF")" >/dev/null 2>&1 && pwd)"
# 快速退出分支(不启动 TUI用于安装验证与信息查询
case "${1:-}" in
--version|-v)
echo "astrion 0.2.0 (opentui)"
exit 0
;;
--help|-h)
echo "用法: astrion"
echo " 在当前目录启动 Astrion CLI当前目录即工作区未注册时会询问创建"
echo "选项:"
echo " -v, --version 显示版本"
echo " -h, --help 显示本帮助"
exit 0
;;
esac
ENTRY="$SCRIPT_DIR/../src/main.tsx"
if command -v bun >/dev/null 2>&1; then
exec bun "$ENTRY" "$@"
elif [ -x "$HOME/.bun/bin/bun" ]; then
exec "$HOME/.bun/bin/bun" "$ENTRY" "$@"
else
echo "astrion: 未找到 bun 运行时(需要 bun>=1.3https://bun.sh" >&2
exit 1
fi