Authenticating Meshery via CLI
mesheryctl needs a token to call Meshery Server on your behalf. Run mesheryctl system login to get one. Meshery Server must be running first, so start it with mesheryctl system start if it is not.
Log in from a machine with a browser
Run the login command:
mesheryctl system loginmesheryctlasks Meshery Server which providers it offers and prompts you to pick one:Use the arrow keys to navigate: β β β β ? Select a Provider: βΈ Meshery LocalThe list comes from your server, so it shows any additional remote providers your server is configured with. To skip the prompt, name the provider with
-p, for examplemesheryctl system login -p Meshery. Runmesheryctl system provider listto see the names.Choose a provider:
- Meshery (or another remote provider) opens your browser at the provider’s sign-in page. After you sign in, the page says “you have logged in, you can close this window now”. Close it and return to your terminal. A remote provider keeps your designs, environments, and performance results between sessions.
- Local signs you in without a browser. Your work stays on this Meshery Server only.
Confirm that
mesheryctlprintedauthenticatedand that it saved the token to~/.meshery/auth.json:ls -l ~/.meshery/-rw-rw-r-- 1 ubuntu ubuntu 39 Dec 21 06:13 auth.json -rw-rw-r-- 1 ubuntu ubuntu 260 Dec 21 06:04 config.yaml -rw-rw-r-- 1 ubuntu ubuntu 988 Dec 21 06:04 meshery.yamlmesheryctlwrites the token to the file that the current context’s token entry points to in~/.meshery/config.yaml. That file is~/.meshery/auth.jsonunless you changed it withmesheryctl system token.
Log in from a machine without a browser
If mesheryctl runs on a machine with no browser, such as a remote server or a CI runner, download a token from Meshery Cloud and copy it onto that machine.
Go to https://cloud.meshery.io/security/tokens and sign in. Check that you are in the right organization, then click Create.
Enter a token name and purpose, then click Create.
Click the Download icon to download the token as
auth.json.Copy
auth.jsonto~/.meshery/auth.jsonon the machine that runsmesheryctl. To keep the file somewhere else, register its path as a token and attach it to your context:mesheryctl system token create my-token -f /path/to/auth.json --setRun
mesheryctl system checkand confirm that it reports no authentication error.
Log out
mesheryctl system logout empties the token file for the current context. Run mesheryctl system login again to get a new token.
For every mesheryctl command and flag, see the mesheryctl command reference.


