# CLI agent binary name collision with Grok CLI — login goes to wrong OAuth provider

**URL:** <https://forum.cursor.com/t/cli-agent-binary-name-collision-with-grok-cli-login-goes-to-wrong-oauth-provider/166249>\
**Category:** Bug Reports\
**Tags:** cli, login\
**Created:** [July 21, 2026, 9:14am UTC](https://forum.cursor.com/t/cli-agent-binary-name-collision-with-grok-cli-login-goes-to-wrong-oauth-provider/166249 "2026-07-21T09:14:11Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![deanrie](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/deanrie/32/1263_2.png) [@deanrie](https://forum.cursor.com/u/deanrie)\
**Post date:** [July 21, 2026, 10:59am UTC](https://forum.cursor.com/t/cli-agent-binary-name-collision-with-grok-cli-login-goes-to-wrong-oauth-provider/166249/5 "2026-07-21T10:59:36Z")

</div>

Hey, thanks for the detailed report. This isn’t a Cursor auth flow bug, it’s a binary name collision.

Both Grok CLI and Cursor CLI install an executable named `agent` into `~/.local/bin`. Whichever one was installed or updated last overwrites the symlink. Right now `agent` points to the Grok binary, so `agent login` opens [grok.com](http://grok.com) and `agent models` only shows grok-4.5. Cursor CLI isn’t being called at all. It doesn’t read `~/.grok/auth.json`, the `agent` command is simply resolving to Grok.

The easiest fix is to run Cursor CLI via `cursor-agent`. Cursor installs this separate symlink next to `agent`, and you already have it in `~/.local/bin`. It points directly to the Cursor binary and doesn’t conflict with Grok, so `cursor-agent login`, `cursor-agent models`, etc will work with Cursor no matter who currently owns `agent`.

If you want the `agent` name to point back to Cursor, reinstall the CLI via `curl https://cursor.com/install -fsS | bash`, but note that the next Grok auto update might grab it again. So `cursor-agent` is the more stable option.

---

_[View the full topic](https://forum.cursor.com/t/cli-agent-binary-name-collision-with-grok-cli-login-goes-to-wrong-oauth-provider/166249)._
