You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
classCodexSsh < Formuladesc"AI-native SSH management for AI assistants"homepage"https://github.com/xlyoung/codex-ssh"version"0.1.0"license"MIT"on_macosdoon_inteldourl"https://github.com/xlyoung/codex-ssh/releases/download/v0.1.0/codex-ssh_darwin_amd64.tar.gz"sha256"..."endon_armdourl"https://github.com/xlyoung/codex-ssh/releases/download/v0.1.0/codex-ssh_darwin_arm64.tar.gz"sha256"..."endendon_linuxdoon_inteldourl"https://github.com/xlyoung/codex-ssh/releases/download/v0.1.0/codex-ssh_linux_amd64.tar.gz"sha256"..."endon_armdourl"https://github.com/xlyoung/codex-ssh/releases/download/v0.1.0/codex-ssh_linux_arm64.tar.gz"sha256"..."endenddefinstallbin.install"codex-ssh"endtestdosystem"#{bin}/codex-ssh","--version"endend
4. Shell 补全
目标
codex-ssh completion bash # Bash 补全
codex-ssh completion zsh # Zsh 补全
codex-ssh completion fish # Fish 补全
实现
使用 cobra 的内置补全功能
添加 completion 子命令
5. 多机并行执行
目标
codex-ssh exec @all "uname -a"# 所有主机
codex-ssh exec @web "systemctl status nginx"# 按 tag 过滤
codex-ssh exec @web,@db "df -h"# 多 tag
实现
exec 命令支持 @tag 语法
并行执行(goroutine + WaitGroup)
结果带主机前缀输出
失败主机单独报告
6. GitHub CI/CD
workflows/ci.yml
name: CIon: [push, pull_request]jobs:
test:
runs-on: ubuntu-lateststeps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5with:
go-version: '1.22'
- run: go test -v ./...
- run: go vet ./...
- uses: golangci/golangci-lint-action@v4with:
version: latest