Make browser login the default, and make modelslab update work on Windows and under package managers - #10
Merged
Conversation
…indows and under package managers A customer on Windows (pip, in a venv) ran `modelslab auth login` and got "Error: password: no input provided". Their account came from "Continue with Google", so it has no password: the prompt asked for something that does not exist, and the error never said so. The npm and PyPI READMEs send every new user to exactly that bare `modelslab auth login`. Login - Browser OAuth is now the default in an interactive terminal. Email and password are still used with --email, --password or --browser=false, when stdin is not a terminal (scripts piping credentials), and when there is no local browser to finish the grant: over SSH, or on Linux with no display. The callback listens on 127.0.0.1, which a browser across SSH cannot reach. - An empty password now says "no password entered" and points Google and GitHub accounts at `auth login --browser` and `auth forgot-password`. Update - Windows: `modelslab update` always failed with "Windows cannot replace a running executable". Windows will rename a running .exe even though it will not delete one, so the old binary moves aside to .old, the new one takes its name, and the .old file is removed on the next run. - Package managers: under pip, pipx, uv, npm, Homebrew or Scoop the updater overwrote a file the package manager owns — pip kept reporting the old version, the next `brew upgrade` or `npm install` put the old file back, and on Windows the launchers hold the file open. The install method is now read from the binary's path; `modelslab update` prints that manager's command instead, and `update --check` reports it. - The notification said "Run `modelslab update`" to everyone. It now shows the command for the install method, e.g. `pip install --upgrade modelslab-cli`. - A failed check was never cached, so offline, behind a proxy, or after GitHub's anonymous rate limit, every command waited out the 1.5s timeout. Failures are cached now and keep what the last good check found. - No notification in CI or when stderr is not a terminal. - "permission denied" on /usr/local/bin or Program Files now says to use sudo or an Administrator terminal. Verified against the real GitHub release with a 0.1.4 build: the notification shows the right command for a standalone and a pip layout and stays silent with CI=1 or redirected stderr; `update` in the pip layout refuses with the pip command; the standalone binary self-updated to 0.2.0 with its checksum verified and no .old/.new left behind. The Windows rename path is covered by cross-compilation only and still needs a run on a real Windows machine. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NJxK2YGapyVchfyE1F8CpR
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.
A customer on Windows (pip, in a venv) ran
modelslab auth loginand got:Their account came from Continue with Google (
signup_source = google), so it has no password. The prompt asked for something that does not exist, and the error never said so. The npm and PyPI READMEs send every new user to exactly that baremodelslab auth login.Login
--email,--passwordor--browser=false, when stdin is not a terminal (scripts piping credentials), and when there is no local browser: over SSH, or Linux with no display. The callback listens on127.0.0.1, which a browser across SSH cannot reach.no password enteredand points atauth login --browserandauth forgot-password.Update
Both the notification and
modelslab updatealready existed. They had these problems:modelslab updatealways failed on Windows ("Windows cannot replace a running executable").exe; move it to.old, put the new one in place, delete.oldon the next runmodelslab updatepip install --upgrade modelslab-cliCIis set or stderr is not a terminal/usr/local/binor Program Filessudoor an Administrator terminalVerification
go vet ./...andgo test ./internal/...pass; 14 new tests (login mode, install-method detection, failed-check caching, replace, permission hint). Cross-builds for windows/amd64, windows/arm64, linux/amd64, darwin/amd64.auth login→ browser flow; over SSH /--browser=false/--email→ password prompt; Enter at the prompt → the new hint.0.1.4, against the live GitHub release:modelslab updatefor a standalone copy andpip install --upgrade modelslab-clifor a copy undersite-packages/modelslab_cli/bin/; silent withCI=1and with redirected stderr;modelslab updatein the pip layout refuses with the pip command, exit 1;0.1.4 → 0.2.0, checksum verified, no.old/.newleft.Note for the release
Users on 0.2.0 run the old updater until they upgrade, and its notice says
modelslab update, which fails on Windows. Release notes and support replies should tell pip users to runpip install --upgrade modelslab-cli.🤖 Generated with Claude Code
https://claude.ai/code/session_01NJxK2YGapyVchfyE1F8CpR
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.