gxy-skills
v0.1.14
Published
Install agent skills from Google Drive via npx skills
Maintainers
Readme
gxy-skills
從 Google Drive 資料夾安裝 agent skills,搭配 npx skills 生態系。
安裝
# 直接使用(不需安裝)
npx gxy-skills add gxy-skill-drive
# 或全域安裝
npm install -g gxy-skills使用方式
列出已安裝 skills
npx gxy-skills list
npx gxy-skills ls -g列出 Drive 資料夾可用 skills
和 npx skills add <source> --list 一樣,使用 add --list 只列出可安裝項目,不會安裝。
npx gxy-skills add gxy-skill-drive --list安裝 skills
# 用預設 Drive source alias
npx gxy-skills add gxy-skill-drive
# 用 folder ID(仍支援)
npx gxy-skills add <drive-folder-id>
# 用 Drive URL(仍支援)
npx gxy-skills add https://drive.google.com/drive/folders/<drive-folder-id>
# 安裝到特定 agent
npx gxy-skills add gxy-skill-drive -a cursor -a claude-code
# 安裝特定 skill
npx gxy-skills add gxy-skill-drive --skill my-skill
# 全部安裝(跳過確認)
npx gxy-skills add gxy-skill-drive --all更新 skills
從 Drive 重新下載最新內容並覆蓋安裝:
npx gxy-skills update gxy-skill-drive
npx gxy-skills update <drive-folder-id>
npx gxy-skills update https://drive.google.com/drive/folders/<drive-folder-id> -a codex -y如果沒有提供 Drive folder URL/ID,update 會直接透傳給官方 npx skills update:
npx gxy-skills update
npx gxy-skills update my-skill -g -y移除 skills
remove 會直接透傳給官方 npx skills remove:
npx gxy-skills remove my-skill
npx gxy-skills remove my-skill -g -y登入問題排查
如果瀏覽器登入成功後仍無法讀取 Drive 資料夾,請先執行:
npx gxy-skills logout
npx gxy-skills add gxy-skill-drive重新登入時請選有權限讀取該 Drive 資料夾的 Google 帳號。若使用 Apps Script backend 且仍失敗,通常代表該帳號不在 Apps Script 部署允許的網域或使用者範圍內。
原理
- 使用 Google OAuth 取得 Drive 讀取權限
- 預設直接透過 Google Drive API 讀取指定資料夾
- 將 skills 下載到本地暫存目錄
- 執行
npx --yes skills add ./temp --copy完成安裝或更新
所有 npx skills add 支援的參數(--agent, --skill, --global, --yes, --all, --list)都會透傳。
gxy-skill-drive 是內建 Drive source alias;也可以用 GXY_SKILLS_SOURCE_GXY_SKILL_DRIVE 覆寫成其他 folder ID。
直接傳 Drive folder ID 或 Drive URL 仍然支援。
沒有 Drive source 參數的 update 會改透傳給 npx skills update。
remove 會直接透傳給 npx skills remove。
使用者不需要預先安裝 skills;只要本機有 Node.js / npm,npx 會在需要時下載並執行 skills。
環境變數
一般使用不需要設定環境變數,可直接用 npx gxy-skills ...。
如需改用自己的 Apps Script backend 或 OAuth client,CLI 會自動讀取目前目錄的 .env,也會讀取 ~/.gxy-skills/.env。.env 不要提交到 GitHub 或 npm。
| 變數 | 說明 |
|------|------|
| GXY_SKILLS_BACKEND | 預設直接使用 Drive API;設為 apps-script 才改走 Apps Script backend |
| GXY_SKILLS_API_URL | 覆寫 Apps Script web app URL(GXY_SKILLS_BACKEND=apps-script 時可選) |
| GXY_SKILLS_SCRIPT_ID | 覆寫 Apps Script Execution API 使用的 script ID(GXY_SKILLS_BACKEND=apps-script 時可選) |
| GXY_SKILLS_OAUTH_CLIENT_ID | 覆寫 Google OAuth client ID |
| GXY_SKILLS_OAUTH_CLIENT_SECRET | 覆寫 Google OAuth client secret(視 OAuth client 類型而定) |
Drive 資料夾結構
your-drive-folder/
├── skill-name-a/
│ └── SKILL.md
├── skill-name-b/
│ ├── SKILL.md
│ └── assets/...
└── ...每個子資料夾代表一個 skill,必須包含 SKILL.md 檔案(含 YAML frontmatter 的 name 和 description)。
選用 Apps Script backend
此 CLI 預設不需要 Apps Script backend;它會直接使用 Drive API。
如果需要網域限制或集中管理的 Apps Script backend,請使用獨立專案 ../skills-server/ 部署,不要放回表單用的 appscript 專案。
License
MIT
