Repository navigation
Make first-run linking one line and fix four places new users got stuck - #233
Conversation
Alexgodoroja
left a comment
There was a problem hiding this comment.
Thanks. The AuthShell state fix, the 15-minute timeout and the installer's argument forwarding are all useful. With no arguments, the installer's output is byte-for-byte what it was, and the arguments are passed safely with exec "$target" "$@". I can't merge this yet, though. main has moved about 33 commits since you opened it and now conflicts in 4 files. Two of those changes also clash with what landed since.
Conflicts / superseded by main
app/src/routes/Workspace.tsx: #234/#242 replaced the empty Sessions list withSessionStartGuide. It has a macOS/Linux and Windows toggle and deliberately uses a plainshell auth(see the comment "The same path works without authorizing remote process creation"). The PR'sSETUP_COMMANDlist no longer has anywhere to go. Please drop this hunk and keep main's guide.app/src/styles/shell.css: #242 already fixed the top bar. Under 760px.new-sessionis an icon-only 44x44 button witharia-labeland.new-session-label { display: none }. This auto-merges without a conflict, but at 760px and below.topbar-right .new-session { height: 38px; padding: 0 11px }beats main's.new-session { height: 44px; padding: 0 }on specificity. That shrinks the touch target below the 44px main keeps on purpose. Please drop the whole shell.css hunk.README.md/docs/content.json: both were restructured, and the install table and the "Link a machine" card are gone. If you want the one-liner in the docs, it needs to go into the new "1. Link your computer" card on the app page.- Product question for maintainers: main's docs now say remote start "grants remote execution authority; choose it deliberately". The Machines empty state would put
--allow-remote-startinto the default copy-paste line. Someone needs to decide that on purpose, not have it arrive through a merge.
Installer bugs (public/install, the new if [ "$#" -gt 0 ] block)
execreplaces the shell, sotrap 'rm -rf "$temporary_dir"' EXITnever fires. Every run with arguments leaves$TMPDIR/shell-online.XXXXXX/{shell,SHA256SUMS}behind. I reproduced it: the leftover directory is still there after a run with arguments. Fix:rm -rf "$temporary_dir"; trap - EXIT HUP INT TERMbefore theexec.- With no terminal (CI,
sshwithout-t), the fallbackexec "$target" "$@"gives the command the rest of the installer script on stdin. I reproduced it: the child readprintf '\nNext:.... A[y/N]prompt then reads script text. Use</dev/nullin that branch.
With those two fixes and the conflicts resolved in main's favour, everything passes locally: root typecheck and vitest (733/733), scripts/test-install.sh, app tsc and vitest (1896 passed, 3 skipped), go vet, go test ./internal/account, and the layout/mobile browser checks.
a89ee91 to
0c24098
Compare
|
Thanks for the careful review. Rebased onto main as one commit, with every conflict resolved in main's favour: SessionStartGuide and main's top bar are untouched, and the shell.css hunk is gone. The one-liner lives in the "1. Link your computer" card instead of the README. On the product question I dropped The |
A first-run test from a phone sign-up to Claude Code started from the phone hit each of these: - The installer can now run a shell command after installing, by the new executable's full path: `curl ... | sh -s -- auth`. On a stock Mac the install directory is not on PATH, so the separate `shell auth` step failed with command not found. Piped into sh, the command gets /dev/tty for its prompts, or no input at all when there is no terminal, never the rest of the script. exec replaces the installer's shell, so it removes its temporary directory before, not on an EXIT trap that would never fire. - The empty Machines page and the app guide's "1. Link your computer" card show that one line. Remote start is left out of it on purpose: it grants remote execution authority, so it stays a choice made at the prompt. - The sign-up page's header "Sign in" link now carries router state, as the foot link already did, so signing in returns to the CLI's link request instead of the sessions list. - `shell auth` waits 15 minutes instead of 5 (sign-in, vault creation and recovery-key confirmation ran past 5) and says to run it again on timeout. - The empty-list command wraps instead of running off the edge of a phone. Rebased onto main: the Sessions empty state is main's SessionStartGuide, the top bar is main's (TeoSlayer#242), and README and docs keep main's structure. Tests: installer scenarios for the post-install command, its stdin without a terminal and its temporary directory; AuthShell header link state; setup command, remote start excluded; login timeout and message. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
0c24098 to
50030ec
Compare
Why
I ran a first-run test as a brand-new user: sign up on a phone, link a Mac from a fresh
HOMEon a stock PATH, then start Claude Code from the phone. It works, but a new user gets stuck in five places on the way. This PR fixes all five. None of them changes how sessions, encryption or the relay work.What changes for users
shellnot found after install~/.local/binisn't on PATH, so the separateshell authstep fails with "command not found"sh -s --with the new executable's full path:curl -fsSL https://shell.online/install | sh -s -- auth --allow-remote-start. Piped intosh, the command gets/dev/ttyfor its prompts. With no arguments the installer behaves exactly as before.shell auth, whose prompt is[y/N], so pressing Enter means the browser can't start sessions--allow-remote-startAuthShellpasseslocation.statethrough the header linkshell authtimes outshell authagainThe phone layout was checked by injecting this exact CSS into app.shell.online at 360, 390 and 430px. There's no overlap at any width, the row stays inside the viewport, and the command has no hidden overflow.
Security
sh -s --, and it runs the binary it just verified againstSHA256SUMS. Nothing runs by default.--allow-remote-startis the existing, documented flag. It now appears on the account pages whose only purpose is starting sessions from the browser. Consent is still given in the terminal, by the person pasting the command.Tests
scripts/test-install.sh: a new scenario with arguments (runs the command by full path, skips the "Next" steps) and one without (unchanged). It fails against the old installer.app/src/components/AuthShell.test.ts: the header link carries{ from }. It fails without the fix.app/src/lib/setup-command.test.ts,internal/account/login_test.go: the timeout is at least 15 minutes and the message says what to do.npm run check(485 tests, installer, SEO, mobile, formula),npm run build:web, app typecheck/lint/test (1,788 passed; lint warnings unchanged frommainat 54),go vet,gofmt,go test -race ./....cat public/install | sh -s -- auth --allow-remote-startin a pty with the published 0.22.0 binary installed, ranshell authon a stock PATH, and the machine linked with browser starts allowed, without a prompt.Not covered:
install.ps1doesn't take arguments yet (Windows wasn't tested). README,docs/content.json(app page) and CHANGELOG are updated.🤖 Generated with Claude Code