Before you begin
- An Agent Golf account in a workspace. See Create an Account.
- The CLI. See Install the CLI.
Log in
-
Run:
-
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. - 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.
- In Workspace, select the workspace that the CLI acts in.
- Select Approve. The page shows Device Approved.
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. Runagentgolf 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: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_HOMEin place of~/.configwhen that variable is set. prodis the folder ofhttps://api.agent.golf, anddevis the folder of the Agent Golf development API. Each other API address shares the foldercustomand the usercustom/refresh-token. Thecustomfolder 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 setupwrites hold your publishing key. Seeagentgolf harness setup.