Title: Add `jss install
Open Graph Title: Add `jss install
X Title: Add `jss install
Description: Phase 1 of the phased install plan (#464 comment). The meaningful core: a single working jss install
Open Graph Description: Phase 1 of the phased install plan (#464 comment). The meaningful core: a single working jss install
X Description: Phase 1 of the phased install plan (#464 comment). The meaningful core: a single working jss install <name> against the default registry. Once it lands, phases 2–6 (full spec, did:nostr resol...
Opengraph URL: https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/478
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Add `jss install \u003cname>` subcommand (Phase 1 of #464)","articleBody":"Phase 1 of the phased install plan ([#464 comment](https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/464#issuecomment-4474167100)). The meaningful core: a single working `jss install \u003cname>` against the default registry. Once it lands, phases 2–6 (full spec, did:nostr resolution, NIP-98 signed install, curated set, bundles) are mechanical extensions.\n\n## Scope\n\n`jss install \u003cname>` resolves to `https://github.com/solid-apps/\u003cname>`, clones, and pushes the working tree to `\u003cpod>/public/apps/\u003cname>/`. Re-runs are idempotent. Each app reports a per-line status.\n\n## Acceptance criteria\n\n```bash\n$ jss start & # in another terminal / background\n$ jss install chrome\nInstalling 1 app → http://localhost:4443\n✓ chrome → http://localhost:4443/public/apps/chrome/\n1/1 installed.\n\n$ curl -s -o /dev/null -w \"%{http_code}\\n\" http://localhost:4443/public/apps/chrome/index.html\n200\n\n$ jss install chrome # idempotent\n✓ chrome → http://localhost:4443/public/apps/chrome/ # or \"⊘ skipped\" — both fine\n```\n\n## Flags\n\n| Flag | Default | Purpose |\n|---|---|---|\n| `--pod \u003curl>` | `http://localhost:4443` (post-#477) | Target pod URL |\n| `--user \u003cname>` | `me` | Username for token fetch |\n| `--password \u003cpw>` | `$JSS_SINGLE_USER_PASSWORD` or `me` | Password (env wins over flag default) |\n| `--help` / `-h` | — | Subcommand help |\n\n## Behavior\n\n1. **Auth.** `POST \u003cpod>/idp/credentials` with `username=\u003cuser>&password=\u003cpassword>`, extract `access_token`. If pod is in `--public` mode (no IDP), skip token fetch.\n2. **Clone.** `git clone https://github.com/solid-apps/\u003cname> /tmp/jss-install-\u003cname>-\u003cpid>`. **No `--depth=1`** — shallow clones are rejected by git-receive on push.\n3. **Push.** Dual push to handle both `init.defaultBranch` conventions:\n ```\n git -C /tmp/... -c http.extraHeader=\"Authorization: Bearer \u003ctoken>\" push \u003cpod>/public/apps/\u003cname> HEAD:main\n git -C /tmp/... -c http.extraHeader=\"Authorization: Bearer \u003ctoken>\" push \u003cpod>/public/apps/\u003cname> HEAD:gh-pages\n ```\n Whichever matches server-side HEAD triggers `updateInstead` and extracts the working tree. The other just creates a stranded ref (harmless).\n4. **Skip-on-existing.** If the auto-init's path-empty check refuses (e.g. JSS bundles content there), translate the `repository not found` / 404 from the push into a friendly `⊘ \u003cname>: skipped (path already in use — bundled or manually placed)`.\n5. **Cleanup.** `rm -rf /tmp/jss-install-\u003cname>-\u003cpid>` always, even on failure.\n6. **Output.** Per-app `✓ \u003cname> → \u003cpod>/public/apps/\u003cname>/`, `⊘ \u003cname>: skipped`, or `✗ \u003cname>: \u003creason>`. Trailing `N/M installed.` summary.\n7. **Exit code.** 0 if all installs succeeded or skipped; non-zero if any failed.\n\n## Validation\n\n`\u003cname>` must match `/^[a-z0-9][a-z0-9_.-]*$/i`. Reject `..`, slashes (Phase 2 introduces them with a different shape), shell metacharacters.\n\n## Implementation notes\n\n- Reference implementation: jspod's `runInstall` in [bin/index.js](https://github.com/JavaScriptSolidServer/jspod/blob/gh-pages/index.js) — ~120 LoC. Port shape is direct; just drop the jspod-specific banner integration and the bundled-pilot heuristic (JSS doesn't bundle apps).\n- Use `spawnSync` for git operations (already used in `src/handlers/git.js`'s auto-init path).\n- New file: `src/cli/install.js` exporting an async function the CLI dispatches to.\n- CLI dispatch: extend `bin/jss.js`'s subcommand handling.\n- No new runtime dependencies needed.\n\n## Test plan\n\n- [ ] `jss install chrome` against a fresh pod → working tree extracts, `index.html` returns 200\n- [ ] Re-running the same install → no error, reports installed or skipped\n- [ ] `jss install nonexistent-name-that-doesnt-resolve` → `✗ \u003cname>: clone failed`, exit non-zero\n- [ ] `jss install chrome --pod http://other:5444` against a remote pod with the same auth flow\n- [ ] `--password` over env: `JSS_SINGLE_USER_PASSWORD=foo jss install chrome` uses the env value\n- [ ] `jss install chrome --user wrong --password wrong` → `✗ Could not authenticate against \u003cpod>`, exit non-zero\n- [ ] `jss install --help` shows the subcommand help\n\n## Depends on\n\n- [#477](https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/477) — port default fallback (`--pod` default should be `4443`, not `3000`)\n\n## Not in scope (later phases)\n\n- `\u003corg>/\u003crepo>` shorthand (Phase 2)\n- Full URLs, `#\u003cref>` pinning, `=\u003cname>` rename (Phase 2)\n- `--did` resolution (Phase 3)\n- `--nostr-privkey` NIP-98 auth (Phase 4)\n- No-arg curated set (Phase 5)\n- `--bundle` (Phase 6)\n\n## Parent\n\n#464 (phased plan in the [comment thread](https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/464#issuecomment-4474167100))","author":{"url":"https://github.com/melvincarvalho","@type":"Person","name":"melvincarvalho"},"datePublished":"2026-05-18T04:03:47Z","url":"https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/478"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:ef2bc438-552d-150b-70fd-56529f0526df |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 98E0:346CFE:67ED60:83F792:6B0393A5 |
| html-safe-nonce | adf4ca2b2ad4219cd989d953c39c422cc6631e0eb17891498308523da93d3f6d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5OEUwOjM0NkNGRTo2N0VENjA6ODNGNzkyOjZCMDM5M0E1IiwidmlzaXRvcl9pZCI6IjEyODIxNzUyMjcxNjU2NDM2ODUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 10e77b943283861bdb06bf88d7bae58b2a9aa8302d7603f9f112e6870f519404 |
| hovercard-subject-tag | issue:4466170027 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/JavaScriptSolidServer/JavaScriptSolidServer/478/issue_layout |
| twitter:image | https://opengraph.githubassets.com/df8c4761d9959ff2680ed4334b1b1dbb9d7550a8265cf5373922e0fa42e411f1/JavaScriptSolidServer/JavaScriptSolidServer/issues/478 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/df8c4761d9959ff2680ed4334b1b1dbb9d7550a8265cf5373922e0fa42e411f1/JavaScriptSolidServer/JavaScriptSolidServer/issues/478 |
| og:image:alt | Phase 1 of the phased install plan (#464 comment). The meaningful core: a single working jss install |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | melvincarvalho |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/JavaScriptSolidServer/JavaScriptSolidServer git https://github.com/JavaScriptSolidServer/JavaScriptSolidServer.git |
| octolytics-dimension-user_id | 205442424 |
| octolytics-dimension-user_login | JavaScriptSolidServer |
| octolytics-dimension-repository_id | 958025407 |
| octolytics-dimension-repository_nwo | JavaScriptSolidServer/JavaScriptSolidServer |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 958025407 |
| octolytics-dimension-repository_network_root_nwo | JavaScriptSolidServer/JavaScriptSolidServer |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width