Skip to main content
Log in to let the CLI act as you in one workspace. You start the sign-in in the terminal and approve it in a browser where you are signed in to Agent Golf. The CLI never sees your password.

Before you begin

Log in

  1. Run:
  2. The CLI shows a URL and a code, for example:
    The CLI also tries to open the URL in your browser. When it cannot, it shows Could not open a browser automatically; use the URL above. Open the URL yourself, on this machine or on another device.
  3. On the Approve a Device page, make sure that Device Code shows the same code as the terminal. Approve only a sign-in that you started.
  4. In Workspace, select the workspace that the CLI acts in.
  5. Select Approve. The page shows Device Approved.
The terminal shows Logged in. agentgolf harness setup, for example agentgolf harness setup --all, also starts this sign-in when you are not logged in.

Stay logged in

The CLI renews its login each time that you run a command. A login that you do not use for 30 days expires. See Sign-in and token lifetimes. Run agentgolf login again when a command stops with an error that tells you to. This occurs when:
  • The login expired.
  • An admin removed you from the workspace, or made your access inactive.
  • You changed AGENTGOLF_API_BASE_URL. Each login is for one API address. See Environment variables.

Log out

Run:
The CLI shows Logged out. It removes the login for the API address that the CLI uses. The command also succeeds when you are not logged in.

Common problems

Where the CLI keeps the login

  • On Linux, the CLI uses $XDG_CONFIG_HOME in place of ~/.config when that variable is set.
  • prod is the folder of https://api.agent.golf, and dev is the folder of the Agent Golf development API. Each other API address shares the folder custom and the user custom/refresh-token. The custom folder holds one login, for the API address that it recorded.
  • The CLI makes the folder readable only by your user, and the files readable and writable only by your user.
  • The settings files that agentgolf harness setup writes hold your publishing key. See agentgolf harness setup.