Skip to Content
Tares

What does tares logout remove, and what happens if the workspace cannot be reached?

Tares logout removes this machine’s key from your Tares Cloud workspace and deletes the ~/.tares/login.json file. Your browser sessions and other machines are not affected. If the workspace cannot be reached, Tares still deletes the file and the command says where to remove the key by hand.

How it works

When you run tares login, the workspace makes an admin key for your machine and the CLI saves the workspace and that key in ~/.tares/login.json, readable only by you. tares logout undoes both halves of that:

  • It removes this machine’s key from the workspace. The key is the one named with a cli prefix, followed by your machine name and your email, under Settings > Access and API keys.
  • It deletes ~/.tares/login.json, so the CLI forgets the workspace and the key.

The command touches only this machine’s key. Your browser sessions in the console stay signed in, and every other machine you connected keeps its own key and keeps working.

Every tares command finds its Tares in a fixed order:

  1. A flag, such as --taresd.
  2. TARESD_URL and TARES_AUTH_TOKEN.
  3. The workspace tares login saved.
  4. The local Tares at http://127.0.0.1:8787.

Once tares logout has deleted the saved login, step 3 no longer applies. Commands such as tares status then fall through to the local Tares, so logout is also a quick way to work against a local tares up again.

Set it up

  1. Run the command on the machine you want to disconnect. It takes no flags.
tares logout
  1. Read the output. When the workspace answers, Tares removes the key there and deletes ~/.tares/login.json in the same run, and you have nothing else to do.

  2. If the workspace cannot be reached, the file is still deleted. The command then tells you where to remove the key by hand. Open the workspace console, go to Settings > Access and API keys and delete the key named with the cli prefix, your machine name and your email. Do this once the workspace is reachable again.

  3. Check where this machine points now.

tares status

With no saved login, tares status asks the local Tares at http://127.0.0.1:8787, unless a flag or TARESD_URL says otherwise. If a variable such as TARESD_URL is still set in your shell, it takes priority over everything saved, so unset it if you want the local default.

  1. To connect again later, run tares login. It opens the console’s Connect a terminal page, you pick a workspace and choose Connect, and the CLI saves a fresh key and a new ~/.tares/login.json. Running tares login again while you are already signed in replaces the saved workspace and removes the previous key, so you do not need to log out first just to switch workspaces.

The full list of commands and flags is in the CLI reference.

What you get

  • This machine stops holding a working key for your workspace. The key is revoked in the workspace, not only forgotten locally.
  • The saved login is gone from disk in every case, including when the workspace is down. You never end up with a stale ~/.tares/login.json after you asked to log out.
  • Your teammates, your other machines and your own browser sessions carry on without interruption, because only this machine’s key is removed.
  • If the workspace was unreachable, you get a pointer to the place where the leftover key can be removed by hand, so you can finish the cleanup yourself.
  • Commands on this machine go back to the local Tares by default, which suits you if you also run tares up for local work. If you use Tares for monitoring and on-call work, the AI SRE guide shows what to set up next.

When something else fits

  • If you only want to switch to a different workspace, run tares login again. It replaces the saved workspace and removes the previous key, so you do not need tares logout first.
  • If you want to cut off a machine you cannot reach, such as a lost laptop, delete its cli key under Settings > Access and API keys in the console instead of running the command on that machine.
  • If you want one command to use a local Tares while staying signed in, set TARESD_URL=http://127.0.0.1:8787 for that shell and keep your login.

Still stuck? Get help

Last updated on