feat(rkd): connect with prod, dev or any address #5

Merged
dozken merged 1 commit from feat/easier-server-address into main 2026-09-20 15:29:06 +02:00
Owner

Summary

Connecting shouldn't require knowing the API hostname. /rkd:configure prod and dev name RKD's hosted servers, and any other address works too: a bare hostname gets https://, a localhost address gets http://, a trailing / or a pasted /api is ignored, and the web app's own address works because it serves the API. The address is checked against /api/health before a code is requested, so a typo or a non-RKD server fails in about a second with a plain message rather than after the ten-minute code expires. With no address, /rkd:configure asks which server.

The companion change on the RKD side (nanoya-biz/rkd#971) makes Settings → Apps → Claude Code show the exact command with the address that app talks to, plus a Copy button.

Version 0.2.3.

Type of change

  • Bug fix
  • New feature
  • Refactor / cleanup (no user-visible change)
  • UI / UX
  • Build, CI, or tooling
  • Docs

Test plan

Automated:

  • pnpm test (100, 17 new for the resolver: shorthands, bare hosts, localhost, trailing / and /api, ports and paths, other schemes refused, and the reachability check for a healthy server, a non-RKD server and an unreachable one)
  • pnpm typecheck, pnpm check:dist, Node 20 handshake smoke, claude plugin validate --strict

Manual, through the real CLI against a local server:

  • login rkd-typo.invalid → "couldn't reach https://rkd-typo.invalid: check the address and your connection"
  • login 127.0.0.1:1 → "couldn't reach http://127.0.0.1:1…"
  • login https://example.com → "answered HTTP 404 at /api/health, so it doesn't look like an RKD server (or it's down)"
  • login 127.0.0.1:18090 (no scheme) signed in, saved RKD_SERVER=http://127.0.0.1:18090, and the second machine showed up not active in Settings → Apps

Review checklist

  • No secrets, tokens, or personal URLs added (the two hosted addresses are public and already in the RKD apps)
  • README and skill updated

Migrations and breaking changes

None. Existing login <full-url> calls resolve to themselves.

Notes for the reviewer

  • The hosted addresses are hardcoded in src/server-url.ts (prod, dev), the same two the RKD apps use in serverConfig.ts. A self-hosted server just passes its own address.
  • checkReachable uses /api/health, which every RKD server already exposes; it needs no auth and no new endpoint.

https://claude.ai/code/session_01GdkP2Y3vcxcGz5XCFFWW16

## Summary Connecting shouldn't require knowing the API hostname. `/rkd:configure prod` and `dev` name RKD's hosted servers, and any other address works too: a bare hostname gets `https://`, a localhost address gets `http://`, a trailing `/` or a pasted `/api` is ignored, and the web app's own address works because it serves the API. The address is checked against `/api/health` **before** a code is requested, so a typo or a non-RKD server fails in about a second with a plain message rather than after the ten-minute code expires. With no address, `/rkd:configure` asks which server. The companion change on the RKD side (nanoya-biz/rkd#971) makes **Settings → Apps → Claude Code** show the exact command with the address that app talks to, plus a Copy button. Version 0.2.3. ## Type of change - [ ] Bug fix - [x] New feature - [ ] Refactor / cleanup (no user-visible change) - [ ] UI / UX - [ ] Build, CI, or tooling - [x] Docs ## Test plan Automated: - [x] `pnpm test` (100, 17 new for the resolver: shorthands, bare hosts, localhost, trailing `/` and `/api`, ports and paths, other schemes refused, and the reachability check for a healthy server, a non-RKD server and an unreachable one) - [x] `pnpm typecheck`, `pnpm check:dist`, Node 20 handshake smoke, `claude plugin validate --strict` Manual, through the real CLI against a local server: - [x] `login rkd-typo.invalid` → "couldn't reach https://rkd-typo.invalid: check the address and your connection" - [x] `login 127.0.0.1:1` → "couldn't reach http://127.0.0.1:1…" - [x] `login https://example.com` → "answered HTTP 404 at /api/health, so it doesn't look like an RKD server (or it's down)" - [x] `login 127.0.0.1:18090` (no scheme) signed in, saved `RKD_SERVER=http://127.0.0.1:18090`, and the second machine showed up **not active** in Settings → Apps ## Review checklist - [x] No secrets, tokens, or personal URLs added (the two hosted addresses are public and already in the RKD apps) - [x] README and skill updated ## Migrations and breaking changes None. Existing `login <full-url>` calls resolve to themselves. ## Notes for the reviewer - The hosted addresses are hardcoded in `src/server-url.ts` (`prod`, `dev`), the same two the RKD apps use in `serverConfig.ts`. A self-hosted server just passes its own address. - `checkReachable` uses `/api/health`, which every RKD server already exposes; it needs no auth and no new endpoint. https://claude.ai/code/session_01GdkP2Y3vcxcGz5XCFFWW16
feat(rkd): connect with prod, dev or any address
All checks were successful
CI / rkd-plugin (pull_request) Successful in 43s
a53f62425e
Nobody should need to know the API hostname to connect. `/rkd:configure
prod` and `dev` name the hosted servers; a bare hostname gets https, a
localhost address gets http, a trailing slash or pasted /api is ignored,
and the web app's own address works too. The address is checked against
/api/health before a code is requested, so a typo or a non-RKD server
fails in a second with a plain message instead of after the code
expires. With no address, /rkd:configure asks which server.

Claude-Session: https://claude.ai/code/session_01GdkP2Y3vcxcGz5XCFFWW16
dozken merged commit 5469a3b7c8 into main 2026-09-20 15:29:06 +02:00
dozken deleted branch feat/easier-server-address 2026-09-20 15:29:06 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
rkd/claude-plugins!5
No description provided.