# How to sign in to the DunSocial CLI > On a laptop run dun auth login & approve in the browser. On a server or in CI set DUN_TOKEN & DUN_WORKSPACE_ID instead. dun auth status shows who you are, which workspace is selected & where the config lives. Updated: 2026-10-05. ## Two ways to sign in The CLI talks to `https://api.dunsocial.com` with a bearer token. You get that token one of two ways: a browser sign-in on your own machine, or a personal access token for automation. ## Device login on your laptop ```bash dun auth login ``` The CLI starts a device-code login & opens your browser at the DunSocial authorize page. You approve, pick a workspace if asked, & the CLI saves a session token locally. If a browser can't open, such as over SSH: ```bash dun auth login --no-browser ``` Follow the link & code shown in the terminal instead. ## A token for servers & CI Create a personal access token in the DunSocial app under Settings → CLI. It's shown once & looks like `dun_pat_…`. Then set two variables: ```bash export DUN_TOKEN=dun_pat_… export DUN_WORKSPACE_ID=your_workspace_id dun auth status --json ``` Environment variables win over the config file, so for CI you don't need to write anything to disk. ## Check who you are ```bash dun auth status dun auth whoami ``` `status` shows whether you're authenticated, which workspace is selected & where config is stored. `whoami` returns your profile. DunSocial's status output also shows where the config is stored, which helps when two setups seem to conflict. ## Choose a workspace ```bash dun workspace list dun workspace use your-workspace ``` A token created for CI is bound to a single workspace, so that choice is already made. DunSocial remembers the choice in the config, so you only pick it once per machine. ## Where the config lives DunSocial's CLI saves its config at `~/.config/dunsocial/config.json`, with file mode `0600` where the system allows it. Point `DUN_CONFIG` at another path to change it. Per-command overrides exist too: `--token`, `--workspace` & `--api-url`. ## Signing out ```bash dun auth logout ``` That clears the local config. If a token leaked, revoke it in Settings → CLI as well, because logging out locally doesn't invalidate a token that has been copied elsewhere. DunSocial's logout only affects the local machine, so the web app & other sessions are untouched. ## Related guides - [How to install the DunSocial CLI](https://www.dunsocial.com/hub/dunsocial-cli-guides/how-to-install-the-dunsocial-cli.md) - [How to find the right social account id in the DunSocial CLI](https://www.dunsocial.com/hub/dunsocial-cli-guides/how-to-find-the-right-social-account-id-in-the-dunsocial-cli.md) - [What is a personal access token & how does it secure API access?](https://www.dunsocial.com/hub/social-media-automation-for-developers/what-is-a-personal-access-token-and-how-does-it-secure-api-access.md) - [How to run the DunSocial CLI in GitHub Actions](https://www.dunsocial.com/hub/dunsocial-cli-guides/how-to-run-the-dunsocial-cli-in-github-actions.md) ## About this document This is the Markdown representation of https://www.dunsocial.com/hub/dunsocial-cli-guides/how-to-sign-in-to-the-dunsocial-cli. The HTML version of the same page is at the same URL. You can also request Markdown from any page by sending `Accept: text/markdown`. Machine-readable summary of the whole site: https://www.dunsocial.com/llms.txt ## Company - Product: DunSocial, https://www.dunsocial.com - Legal entity: THISUX PRIVATE LIMITED, Chennai, Tamil Nadu, India - Support: support@dunsocial.com - Open the app: https://app.dunsocial.com/login