bencher auth CLI Subcommand


bencher auth

The bencher auth CLI subcommand signs the Bencher CLI in to a Bencher Plus server through your browser, so the commands you run on your own machine act as you without an API key. In CI, use an API key with the --key option instead.

bencher auth login

bencher auth login [OPTIONS]

bencher auth login opens the Bencher Console in your browser, where you sign in and approve the Bencher CLI. The browser then returns to the CLI, which keeps the sign-in and prints who signed in to which server. To choose the browser, set the BROWSER environment variable to its command.

Every command that calls the API uses the sign-in for its --host when no API key or API token is set, and renews it as needed. A sign-in lasts at most one year, and it is listed by the name of your device under Connected Apps in the Bencher Console, where you can revoke it.

The CLI keeps one sign-in for each API host: in the Windows Credential Manager on Windows, in the Secret Service on Linux, and in bencher/auth.json in your config directory on macOS, or wherever the Credential Manager or the Secret Service does not answer. Your config directory is $XDG_CONFIG_HOME or ~/.config, or %LOCALAPPDATA% on Windows, and only your user can read bencher/auth.json.

--no-browser

Print the link to open in a browser instead of opening one, then paste the code that the page shows. Use it on a machine without a browser, such as over SSH. The CLI does the same when it cannot open a browser. The code works only for the CLI that asked for it.

--admin

Ask for an admin sign-in, which only a server admin can approve. It has server admin rights only while you are a server admin.

--host <URL>

The URL of the Bencher API server to sign in to. Either the --host option or the BENCHER_HOST environment variable may be set.

Default: https://api.bencher.dev

bencher auth status

bencher auth status [OPTIONS]

Show who is signed in to the --host server, and whether it is an admin sign-in. It never prints a token.

bencher auth logout

bencher auth logout [OPTIONS]

Revoke the sign-in at the --host server and forget it. If the server cannot be reached, the CLI still forgets the sign-in and tells you to revoke it under Connected Apps in the Bencher Console.

API Keys and the Sign-In

An API key from the --key option or the BENCHER_API_KEY environment variable always takes precedence over the sign-in, so CI does not change. A sign-in cannot create API keys, invite members, or change an email, a plan, or a member’s role. Do those in the Bencher Console.



Published: Sat, November 28, 2026 at 1:40:00 PM UTC | Last Updated: Sat, November 28, 2026 at 11:24:55 PM UTC