rsai-cli
v0.0.17
Published
RAI CLI — cài bộ Agent Skills (app-ads-setup, template-content-gen, ob-question-gen, postgres-dba) vào AI coding assistant (Claude Code, Kiro, Cursor...).
Maintainers
Readme
rsai-cli
CLI public cài bộ Agent Skills (app-ads-setup, template-content-gen, ob-question-gen, postgres-dba). Bản thân skill nằm trong
repo GitHub PRIVATE — rsai init tải về bằng GitHub token, nên chỉ ai có token mới lấy được nội dung.
Zero npm-dependency (chỉ Node ≥ 16 + tar hệ thống).
Mô hình
- CLI
rsai-clipublish public lên npm (ai cũng cài được) — nhưng KHÔNG chứa skill. - Skill thật ở repo private
RESOLUTION-AI-COMPANY-LIMITED/rsai-skills-private. rsai inittải skill từ repo private qua GitHub tarball API bằng GitHub PAT (quyềnrepo).
Cài & dùng
# 1. Cài CLI (public)
npm install -g rsai-cli # hoặc: npx rsai-cli ...
# 2. Đăng nhập GitHub — 2 cách:
rsai login # qua TRÌNH DUYỆT (device flow, giống gh): hiện mã → nhập trên browser
rsai login --token ghp_xxxxxxxx # hoặc dán Personal Access Token (quyền 'repo')
# (token lưu ở ~/.rsai/config.json, chmod 600)
# 3. Vào project và cài skill
cd /path/to/your/project
rsai init --ai claude # Claude Code (project)
rsai init --ai kiro --global # Kiro (global ~/.kiro/skills)
rsai init --ai all # tất cả assistantLệnh
rsai login [--repo owner/name] [--ref main] # login qua trình duyệt (device flow)
rsai login --token <PAT> [--repo owner/name] # hoặc dán PAT trực tiếp
rsai logout # xoá token GitHub (giữ nguyên key/config khác)
rsai whoami # xem repo/token đang dùng
rsai config set|get|unset|list <KEY> [VALUE] # lưu credentials cho skill vào ~/.rsai/config.json (chmod 600)
rsai config add-key|list-keys|remove-key GEMINI_API_KEY ... # nhiều key để skill tự xoay vòng
rsai cms login [--url https://cms.aperogroup.ai] # đăng nhập CMS Strapi qua SSO bằng trình duyệt, tự lưu token (~30 phút)
rsai cms status | logout [--purge] # xem hạn token / xoá token (--purge: xoá cả phiên trình duyệt)
rsai init --ai <assistant> [--global] [--dry-run] # tải + cài skill (cần token)
rsai update [--ai <assistant>] [--global] # tải bản mới, ghi đè
rsai uninstall [--ai <assistant>] [--global] # gỡ
rsai list # danh sách assistantToken cũng có thể truyền qua --token hoặc env RSAI_TOKEN / GITHUB_TOKEN.
Repo/ref override qua --repo owner/name, --ref <branch|tag>, hoặc env RSAI_REPO / RSAI_REF.
Assistant hỗ trợ (--ai)
claude, cursor, windsurf, antigravity, copilot, kiro, codex, qoder, roocode, gemini, trae, opencode, continue, codebuddy, droid, kilocode, warp, augment, codewhale, zcode, kimi, amazonq, openclaw, autoclaw, universal, all.
Global (--global) cài vào ~/.<assistant>/skills/ (vd ~/.claude/skills/, ~/.kiro/skills/).
Tạo GitHub token
GitHub → Settings → Developer settings → Personal access tokens → Fine-grained/Classic,
cấp quyền đọc (repo / Contents: Read) trên repo rsai-skills-private.
Cập nhật skill mới
Luồng 2 bước (skill nằm ở repo private, tách khỏi repo dev):
Phía maintainer — khi sửa skill xong, đẩy lên repo private:
bash sync-to-private.sh "mô tả thay đổi" # repo dev → rsai-skills-privatePhía người dùng — lấy bản mới:
rsai update # refresh TẤT CẢ assistant đã cài (chỉ cái đã cài, không đụng cái chưa cài)
rsai update --ai kiro # chỉ 1 assistant
rsai update --global # bản global (~/.<assistant>/skills)rsai update tải skill mới nhất từ repo private rồi ghi đè các skill đã cài. Assistant chưa init thì bỏ qua.
Login qua trình duyệt (device flow)
rsai login không kèm --token sẽ chạy OAuth device flow giống gh: CLI hiện 1 mã + mở
github.com/login/device, bạn nhập mã → GitHub cấp token, CLI tự nhận (không cần tạo PAT thủ công).
Mặc định dùng client_id công khai của GitHub CLI để chạy ngay. Để dùng OAuth App RIÊNG của tổ chức (khuyến nghị cho production), tạo OAuth App trên GitHub (bật "Device Flow") rồi set env:
export RSAI_CLIENT_ID=<your_oauth_app_client_id>Kiểm & cập nhật phiên bản CLI
rsai version # xem version CLI + SKILL đã cài + kiểm cả 2 bản mới
npm install -g rsai-cli@latest # cập nhật CLI lên bản mớiCLI tự kiểm bản mới trên npm (1 lần/ngày, cache ở ~/.rsai/update-check.json) và nhắc khi có bản mới.
Phân biệt: rsai version/npm update = cập nhật CLI; rsai update = cập nhật nội dung skill.
