Repository navigation
Sign in to Skillhook Cloud with the browser: cloud login and the agent's setup tool - #26
Merged
Merged
Conversation
…k_cloud_setup `skillhook cloud login` signs in with RFC 8628's device flow against the cloud's /api/auth/device endpoints: it shows a code, opens the cloud's sign-in page (not over SSH, not on Linux without a display, never with --no-browser), polls until a person approves the code there, and keeps the organisation API key the cloud makes for this computer and hands over once. `--key shc_…|-` and a bare `--key` (asked for at a terminal) keep a key made on the dashboard; in CI login asks for those instead of waiting for a person. The skillhook-cloud MCP server's skillhook_cloud_setup does the same for an agent: without a working key it opens the person's browser and returns the link and the code, keeps the key once they approved and loads the cloud's tools. The agent never sees the key and cannot pick the cloud; HTTPS and SKILLHOOK_NO_CLOUD are enforced inside the sign-in itself. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n-ux-80dbb6 # Conflicts: # AGENTS.md # CHANGELOG.md # llms.txt
JOsacky
enabled auto-merge (squash)
October 9, 2026 14:37
Merged
JOsacky
added a commit
that referenced
this pull request
Oct 9, 2026
## What Version bump to 0.10.0 (`npm run release -- minor`): `package.json`, `package-lock.json`, the three plugin manifests, and the Unreleased changelog section moved under `## 0.10.0` (one entry re-wrapped, and it now says the cloud side is live on https://skillhook.dev). When this merges, the Release workflow tags `v0.10.0` and dispatches Publish. `npm run check` passes locally (typecheck, 331 tests in 46 files, build, schema and release metadata checks). ## Changes since 0.9.1 - `skillhook cloud login` signs in with the browser instead of asking for a key copied from the dashboard, and the `skillhook-cloud` MCP server's `skillhook_cloud_setup` does the same for an agent. See #26. The cloud side (MeterApp/skillhook-cloud#58) is deployed: on https://skillhook.dev, `POST /api/auth/device/code` answers a code and `https://skillhook.dev/activate`, the token endpoint answers `authorization_pending` until approval, and `/activate` sends a signed-out visitor to sign in first (checked before opening this). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
skillhook cloud loginno longer asks for a key copied out of the dashboard. It signs in with the browser, RFC 8628's device flow, the way the Car Image CLI does: it shows a code, opens the cloud's sign-in page, the person approves the code there for an organisation they administer (choosing read, run or admin access), and the cloud hands the waiting CLI a new organisation API key, once. Theskillhook-cloudMCP server'sskillhook_cloud_setupdoes the same for an agent, so an agent without a terminal connects the cloud's tools: it opens the person's browser and gets the link and the code to show, never the key.The cloud side is MeterApp/skillhook-cloud#58 (
/api/auth/device/*and/activate); it deploys before a release carries this. Against a cloud without those endpoints, login says to use--key.What changed
src/cloud/login.ts(new):browserLoginstarts a sign-in (POST /api/auth/device/code, sending only "skillhook CLI on ", the key's name on the dashboard), reports the page and the code, then pollsPOST /api/auth/device/token(5 s more afterslow_down, doubling up to 30 s while the cloud cannot answer) until the key, a cancel or the ten-minute expiry. It refuses underSKILLHOOK_NO_CLOUDand to plain http, and only opens an https page (loopback http in tests).openBrowserusesopen/xdg-openwith argv, never a shell, and not over SSH or on Linux without a display.skillhook cloud login: without--keyit signs in with the browser; the link and the code go to stderr, so--jsonstill answers on stdout;--no-browseronly prints the link; in CI it refuses and points at--key -or the environment. The key the cloud hands over is kept at once (keepApiKey:.env, mode 600, with its cloud), then read back with/api/v1/mefor the message.--key shc_…,--key -and a bare--key(asked for at a terminal) keep a key made on the dashboard, as before. The question of which cloud to use when the kept key's and the machine's differ is asked before a sign-in too.CliIOgainsopenUrlandsleep: the real IO opens the browser, test IOs never do.skillhook mcp --cloud:skillhook_cloud_setup {wait_seconds?}starts the sign-in when it would help (no key, a malformed or refused one; not the kill switch, plain http or an unreachable cloud), returns at once withurl,code,browser_opened,expires_in_seconds, and on approval keeps the key and loads the catalogue (tools/list_changed); called again it reports the same sign-in or waits for it, and after a cancelled one starts another. It signs in only to the cloud the key would go to, and says so whenSKILLHOOK_CLOUD_API_KEYin its environment would win over a kept key.connectCloudnow reports the error'scodeandstatus.skillhook cloud logininstead.cloudRequestreadserror_descriptionfrom OAuth-style errors.FakeCloudanswers/api/auth/device/*from a per-poll script. Docs:docs/cloud.md,docs/mcp.md,docs/security.md,README.md,llms.txt,skills/skillhook-cloud/SKILL.md,AGENTS.md(the outbound requests rule names the sign-in requests), and the changelog under Unreleased. No version bump: nothing is published by this merge.Verified
npm run checkon the branch merged withmain(0.9.1): typecheck, 331 tests in 46 files, build, schema check, release metadata. New tests: the CLI sign-in (the prompt on stderr, the browser opened once and not with--no-browser, the exact poll waits throughpending,slow_down, a 500 and approval, the key kept and never printed, cancel and expiry kept nothing, an older cloud, CI, the kill switch, plain http), and the MCP setup tool (link and code at once, the same sign-in when asked again, approval loads the tools, a cancelled one starts over, an environment key, plain http refused)./activatelogged it in (.envmode 600, the key never printed,skillhook cloud overviewworked with it), and Cancel made it exit 1 with "The sign-in was not approved: The sign-in was cancelled in the browser." The builtskillhook mcp --cloud, driven over stdio, returned the link and the code fromskillhook_cloud_setupwithout opening a browser (SSH_CONNECTIONset); after the approval,wait_secondsreturnedconnected: true, 31 tools loaded anddescribe_cloudanswered with the new key.🤖 Generated with Claude Code