[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7B0MCHSNR0DGRPY3M0QDZ1B":3,"skill-same:01M7B0MCHSNR0DGRPY3M0QDZ1B":55},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":23,"commitSha":24,"skillDirectory":25,"forksCount":13,"repositoryHtmlUrl":26,"repositoryHomepageUrl":6,"ownerHtmlUrl":27,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":28,"install":29,"resources":42},"01M7B0MCHSNR0DGRPY3M0QDZ1B","codespace-gh-auth",null,"Extract GitHub token from VS Code for API in Codespaces.","gitricko\u002F.minions","gitricko","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F18060558?v=4","01M7B0KG9EHG0CZ0QT1EN5YPCR","01M7B0KGA0ZV14R7SKBF3B5SCT",2,"MIT","https:\u002F\u002Fgithub.com\u002Fgitricko\u002F.minions\u002Fblob\u002Fmain\u002Fskills\u002Fcodespace-gh-auth\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: codespace-gh-auth\ndescription: \"Extract GitHub token from VS Code for API in Codespaces.\"\n---\n\n# GitHub Codespace Authentication\n\n## Problem\nIn a GitHub Codespace, the GITHUB_TOKEN env var is set in the VS Code server process but NOT inherited by the Hermes agent session.\n\n## Solution\n\n### Quick Usage (Source the script, then use functions)\n\n```bash\nsource \u002Fhome\u002Fcodespace\u002F.hermes\u002Fskills\u002Fminions\u002Fcodespace-gh-auth\u002Fscripts\u002Fcodespace-gh-auth.sh\n\n# Get token for API calls\nget_github_token\ncurl -s -H \"Authorization: token $GITHUB_TOKEN\" https:\u002F\u002Fapi.github.com\u002F...\n\n# Push with token-embedded URL (no credential prompts)\ngit_push_with_token\n\n# Set up gh CLI\nsetup_gh_cli\ngh pr create ...\n\n# Full workflow: commit → push → PR\ncodespace_create_pr \"Title\" \"Body\"\n```\n\n### Step 1: Extract the real GITHUB_TOKEN from the VS Code server\n\n```bash\nVSCODE_PID=$(pgrep -f \"server-main.js\" | head -1)\nGITHUB_TOKEN=$(cat \u002Fproc\u002F$VSCODE_PID\u002Fenviron 2>\u002Fdev\u002Fnull | tr '\\0' '\\n' | grep \"^GITHUB_TOKEN=\" | cut -d= -f2-)\n```\n\n### Push gotcha (verified 2026-10-31)\n\n`git push` from a non-interactive bash tool HANGS (many minutes) unless\n`GITHUB_TOKEN` is exported in the push command's own shell: the Codespace\ncredential helper `\u002F.codespaces\u002Fbin\u002Fgitcredential_github.sh` returns nothing\nwhen its env has no `GITHUB_TOKEN`, and with zero credentials git just\nstalls (no error). Do NOT embed the token in the remote URL —\n`https:\u002F\u002Fuser:token@…` fails with `No anonymous write access` for the\n`ghu_` App token. Working pattern (single command):\n\n```bash\nPID=$(pgrep -f \"server-main.js\" | head -1)\nexport GITHUB_TOKEN=$(cat \u002Fproc\u002F$PID\u002Fenviron | tr '\\0' '\\n' | grep \"^GITHUB_TOKEN=\" | cut -d= -f2-)\ngit push -u origin \u003Cbranch>\n```\n\nAlso: `source codespace-gh-auth.sh` under a non-bash shell chokes on\nbashisms and can leave a 3-char garbage token — prefer inline extraction\nover sourcing in tool contexts.\n\n### Step 2: Use it for API calls\n\n```bash\ncurl -s -X POST \\\n  -H \"Authorization: token $GITHUB_TOKEN\" \\\n  -H \"Accept: application\u002Fvnd.github.v3+json\" \\\n  \"https:\u002F\u002Fapi.github.com\u002Frepos\u002FOWNER\u002FREPO\u002Fissues\u002FISSUE_NUM\u002Fcomments\" \\\n  -d '{\"body\": \"your comment\"}'\n```\n\n### Step 3: Use it for gh CLI (optional)\n\n```bash\nunset GH_TOKEN\nexport GH_TOKEN=\"$GITHUB_TOKEN\"\ngh auth status\n```\n\n## Pitfalls\n- Do NOT use GITHUB_CODESPACE_TOKEN for REST API calls (returns 401)\n- Do NOT run gh auth login (unnecessary)\n- The VS Code server PID can be found with: pgrep -f \"server-main.js\"\n- Token is a GitHub App user-to-server token (ghu_xxx prefix), ~40 chars\n- **Critical limitation**: This is a GitHub App token gated by Codespaces app installation. It works for the origin repo and Codespaces-connected repos, but FAILS (403) on other repos the user has access to. Use device code flow for those cases.\n\n### Token Scope Comparison\n\n| Method | Token Type | Scope | Works On |\n|--------|------------|-------|----------|\n| **Extract from VS Code** | GitHub App user-to-server (`ghu_`) | `repo` (app-gated) | Origin repo + Codespaces-connected repos only |\n| **Device code flow** | Classic OAuth (`gho_`\u002F`ghp_`) | Full user scopes | **All repos the user has access to** |\n| **Unauthenticated API** | None | Public only | Public repos (read-only) |\n\n**When to use device flow instead**: Working on repos outside the Codespaces app installation (other users' repos, orgs without Codespaces app).\n\n## Scripts\n\n- `scripts\u002Fcodespace-gh-auth.sh` — Reusable functions: `get_github_token`, `git_push_with_token`, `setup_gh_cli`, `codespace_create_pr`\n\n## References\n\n- `references\u002Fgit-push-with-token.md` — Complete git push + PR workflow using extracted token","# GitHub Codespace Authentication\n\n## Problem\nIn a GitHub Codespace, the GITHUB_TOKEN env var is set in the VS Code server process but NOT inherited by the Hermes agent session.\n\n## Solution\n\n### Quick Usage (Source the script, then use functions)\n\n```bash\nsource \u002Fhome\u002Fcodespace\u002F.hermes\u002Fskills\u002Fminions\u002Fcodespace-gh-auth\u002Fscripts\u002Fcodespace-gh-auth.sh\n\n# Get token for API calls\nget_github_token\ncurl -s -H \"Authorization: token $GITHUB_TOKEN\" https:\u002F\u002Fapi.github.com\u002F...\n\n# Push with token-embedded URL (no credential prompts)\ngit_push_with_token\n\n# Set up gh CLI\nsetup_gh_cli\ngh pr create ...\n\n# Full workflow: commit → push → PR\ncodespace_create_pr \"Title\" \"Body\"\n```\n\n### Step 1: Extract the real GITHUB_TOKEN from the VS Code server\n\n```bash\nVSCODE_PID=$(pgrep -f \"server-main.js\" | head -1)\nGITHUB_TOKEN=$(cat \u002Fproc\u002F$VSCODE_PID\u002Fenviron 2>\u002Fdev\u002Fnull | tr '\\0' '\\n' | grep \"^GITHUB_TOKEN=\" | cut -d= -f2-)\n```\n\n### Push gotcha (verified 2026-10-31)\n\n`git push` from a non-interactive bash tool HANGS (many minutes) unless\n`GITHUB_TOKEN` is exported in the push command's own shell: the Codespace\ncredential helper `\u002F.codespaces\u002Fbin\u002Fgitcredential_github.sh` returns nothing\nwhen its env has no `GITHUB_TOKEN`, and with zero credentials git just\nstalls (no error). Do NOT embed the token in the remote URL —\n`https:\u002F\u002Fuser:token@…` fails with `No anonymous write access` for the\n`ghu_` App token. Working pattern (single command):\n\n```bash\nPID=$(pgrep -f \"server-main.js\" | head -1)\nexport GITHUB_TOKEN=$(cat \u002Fproc\u002F$PID\u002Fenviron | tr '\\0' '\\n' | grep \"^GITHUB_TOKEN=\" | cut -d= -f2-)\ngit push -u origin \u003Cbranch>\n```\n\nAlso: `source codespace-gh-auth.sh` under a non-bash shell chokes on\nbashisms and can leave a 3-char garbage token — prefer inline extraction\nover sourcing in tool contexts.\n\n### Step 2: Use it for API calls\n\n```bash\ncurl -s -X POST \\\n  -H \"Authorization: token $GITHUB_TOKEN\" \\\n  -H \"Accept: application\u002Fvnd.github.v3+json\" \\\n  \"https:\u002F\u002Fapi.github.com\u002Frepos\u002FOWNER\u002FREPO\u002Fissues\u002FISSUE_NUM\u002Fcomments\" \\\n  -d '{\"body\": \"your comment\"}'\n```\n\n### Step 3: Use it for gh CLI (optional)\n\n```bash\nunset GH_TOKEN\nexport GH_TOKEN=\"$GITHUB_TOKEN\"\ngh auth status\n```\n\n## Pitfalls\n- Do NOT use GITHUB_CODESPACE_TOKEN for REST API calls (returns 401)\n- Do NOT run gh auth login (unnecessary)\n- The VS Code server PID can be found with: pgrep -f \"server-main.js\"\n- Token is a GitHub App user-to-server token (ghu_xxx prefix), ~40 chars\n- **Critical limitation**: This is a GitHub App token gated by Codespaces app installation. It works for the origin repo and Codespaces-connected repos, but FAILS (403) on other repos the user has access to. Use device code flow for those cases.\n\n### Token Scope Comparison\n\n| Method | Token Type | Scope | Works On |\n|--------|------------|-------|----------|\n| **Extract from VS Code** | GitHub App user-to-server (`ghu_`) | `repo` (app-gated) | Origin repo + Codespaces-connected repos only |\n| **Device code flow** | Classic OAuth (`gho_`\u002F`ghp_`) | Full user scopes | **All repos the user has access to** |\n| **Unauthenticated API** | None | Public only | Public repos (read-only) |\n\n**When to use device flow instead**: Working on repos outside the Codespaces app installation (other users' repos, orgs without Codespaces app).\n\n## Scripts\n\n- `scripts\u002Fcodespace-gh-auth.sh` — Reusable functions: `get_github_token`, `git_push_with_token`, `setup_gh_cli`, `codespace_create_pr`\n\n## References\n\n- `references\u002Fgit-push-with-token.md` — Complete git push + PR workflow using extracted token",{"name":5,"description":7},"main","e95aec76487a22bbbc23b63234724bc7178d4692","skills\u002Fcodespace-gh-auth","https:\u002F\u002Fgithub.com\u002Fgitricko\u002F.minions","https:\u002F\u002Fgithub.com\u002Fgitricko","2026-11-13 16:00:00",{"source":8,"skillName":5,"commands":30,"prompt":40,"zipAvailable":41},[31,34,37],{"tool":32,"command":33},"npx","npx skills add gitricko\u002F.minions --skill codespace-gh-auth",{"tool":35,"command":36},"bunx","bunx skills add gitricko\u002F.minions --skill codespace-gh-auth",{"tool":38,"command":39},"pnpm","pnpm dlx skills add gitricko\u002F.minions --skill codespace-gh-auth","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fgitricko\u002F.minions\u002Fblob\u002Fmain\u002Fskills\u002Fcodespace-gh-auth\u002FSKILL.md",true,[43,49],{"path":44,"resourceType":45,"resourceTypeDesc":46,"sizeBytes":47,"sourceHtmlUrl":48},"references\u002Fgit-push-with-token.md","REFERENCE","参考文档",2858,"https:\u002F\u002Fgithub.com\u002Fgitricko\u002F.minions\u002Fblob\u002Fmain\u002Fskills\u002Fcodespace-gh-auth\u002Freferences\u002Fgit-push-with-token.md",{"path":50,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":53,"sourceHtmlUrl":54},"scripts\u002Fcodespace-gh-auth.sh","SCRIPT","脚本",2419,"https:\u002F\u002Fgithub.com\u002Fgitricko\u002F.minions\u002Fblob\u002Fmain\u002Fskills\u002Fcodespace-gh-auth\u002Fscripts\u002Fcodespace-gh-auth.sh",[56,63,70,77,84,91],{"skillNo":57,"name":58,"nameZh":6,"description":59,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":18},"01M7B0VJ3Q0YMCTJY69FEJ4100","version-single-source","Use when adding a new component dependency or versioning a binary in install\u002Fboot scripts.","https:\u002F\u002Fgithub.com\u002Fgitricko\u002F.minions\u002Fblob\u002Fmain\u002Fskills\u002Fversion-single-source\u002FSKILL.md",[],[],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":18},"01M7B0V888DV8J3JY5W9Z6WCF3","tdd","Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions \"red-green-refactor\", or wants integration tests.","https:\u002F\u002Fgithub.com\u002Fgitricko\u002F.minions\u002Fblob\u002Fmain\u002Fskills\u002Ftdd\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":18},"01M7B0TVFM38JH3PBA2K219Z2X","shell-path-login","Use when a binary or script works in one shell context but not another (interactive vs non-interactive login vs non-login shell).","https:\u002F\u002Fgithub.com\u002Fgitricko\u002F.minions\u002Fblob\u002Fmain\u002Fskills\u002Fshell-path-login\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":18},"01M7B0TKFCTVQBTSNF9WF1MXJ6","self-update-fix","Fix a failing dependency update PR. Use when a self-update PR's CI fails, or when invoked by scripts\u002Fself-update-fix.sh.","https:\u002F\u002Fgithub.com\u002Fgitricko\u002F.minions\u002Fblob\u002Fmain\u002Fskills\u002Fself-update-fix\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":18},"01M7B0TB57WEW0E6E9874K3C72","pr-change-log","Use when a multi-commit PR needs its description written\u002Fupdated, or when closing out a long branch with many fix commits.","https:\u002F\u002Fgithub.com\u002Fgitricko\u002F.minions\u002Fblob\u002Fmain\u002Fskills\u002Fpr-change-log\u002FSKILL.md",[],[],{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":18},"01M7B0T2FGSV0ZFRZ46PG4BBY2","persistent-knowledge","Persistent skills\u002Fknowledge in Codespace via symlinks.","https:\u002F\u002Fgithub.com\u002Fgitricko\u002F.minions\u002Fblob\u002Fmain\u002Fskills\u002Fpersistent-knowledge\u002FSKILL.md",[],[]]