Skip to content

apkg logout

The logout command removes stored credentials for a registry from ~/.apkg/credentials.json. After logging out, commands that require authentication (such as publish, token, and key) will fail until you login again.

Terminal window
apkg logout [--registry <URL>]
OptionDescription
--registry <URL>Remove credentials for a specific registry instead of the default

The --registry flag is a global option available to all commands. When provided, it removes credentials scoped to that registry URL. Without it, credentials for the resolved default registry are removed.

  1. APKG resolves the target registry URL using the standard precedence order.
  2. The credential entry for that registry is deleted from ~/.apkg/credentials.json.
  3. Other credential entries (for different registries) are left untouched.

If no credentials exist for the target registry, the command exits silently.

Log out from the default registry:

Terminal window
apkg logout

Log out from a private registry:

Terminal window
apkg logout --registry https://registry.internal.example.com

Verify you are logged out:

Terminal window
apkg whoami
CommandDescription
loginAuthenticate with the registry
whoamiShow the authenticated user
configManage CLI configuration
tokenManage long-lived API tokens