mosh:devices:bridge:moshctl
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| mosh:devices:bridge:moshctl [2026/04/21 03:30] – created mosh | mosh:devices:bridge:moshctl [2026/04/21 03:56] (current) – mosh | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | = moshctl User Guide = | + | =====moshctl User Guide===== |
| - | < | + | '' |
| This guide reflects the current CLI behavior in the codebase and the auth flow currently running on the server. | This guide reflects the current CLI behavior in the codebase and the auth flow currently running on the server. | ||
| - | == What < | + | ===What |
| - | < | + | '' |
| The current default API URL is: | The current default API URL is: | ||
| - | < | + | '' |
| - | http:// | + | |
| - | </ | + | |
| Most commands require a bearer token. The only command intended to work without a token is: | Most commands require a bearer token. The only command intended to work without a token is: | ||
| - | < | + | '' |
| - | moshctl health | + | |
| - | </ | + | |
| - | == Quick Start == | + | ====Quick Start==== |
| - | === 1. Create an API Token on the Bridge Host === | + | ===1. Create an API Token on the Bridge Host=== |
| - | Run this where < | + | Run this where '' |
| - | <syntaxhighlight lang="bash"> | + | <code bash> |
| moshbridge admin token --store / | moshbridge admin token --store / | ||
| - | </syntaxhighlight> | + | </code> |
| This prints a raw token once. It will look something like: | This prints a raw token once. It will look something like: | ||
| - | < | + | '' |
| - | mtk_ab12cd_7b2XcYpL9uV3qWmR8nKs4dTfZ1eH6jQa | + | |
| - | </ | + | |
| Save it right away. | Save it right away. | ||
| - | === 2. Save the Token for < | + | ===2. Save the Token for '' |
| Recommended, | Recommended, | ||
| - | <syntaxhighlight lang="bash"> | + | <code bash> |
| echo '< | echo '< | ||
| - | </syntaxhighlight> | + | </code> |
| Or explicitly: | Or explicitly: | ||
| - | <syntaxhighlight lang="bash"> | + | <code bash> |
| moshctl auth init --token '< | moshctl auth init --token '< | ||
| - | </syntaxhighlight> | + | </code> |
| By default, < | By default, < | ||
| Line 70: | Line 64: | ||
| Unauthenticated health check: | Unauthenticated health check: | ||
| - | <syntaxhighlight lang="bash"> | + | <code bash"> |
| moshctl health | moshctl health | ||
| - | </syntaxhighlight> | + | </code> |
| Authenticated status check: | Authenticated status check: | ||
| - | <syntaxhighlight lang="bash"> | + | <code bash> |
| moshctl status | moshctl status | ||
| - | </syntaxhighlight> | + | </code> |
| == Global Flags == | == Global Flags == | ||
| Line 90: | Line 84: | ||
| Example: | Example: | ||
| - | <syntaxhighlight lang="bash"> | + | <code bash> |
| moshctl -url http:// | moshctl -url http:// | ||
| - | </syntaxhighlight> | + | </code> |
| === < | === < | ||
| Line 100: | Line 94: | ||
| Example: | Example: | ||
| - | <syntaxhighlight lang="bash"> | + | <code bash> |
| moshctl -token-file ~/ | moshctl -token-file ~/ | ||
| - | </syntaxhighlight> | + | </code> |
| === < | === < | ||
| Line 110: | Line 104: | ||
| Example: | Example: | ||
| - | <syntaxhighlight lang="bash"> | + | <code bash> |
| moshctl -version | moshctl -version | ||
| - | </syntaxhighlight> | + | </code> |
| == Authentication Commands == | == Authentication Commands == | ||
| - | === < | + | ===< |
| Saves a raw bearer token locally and immediately verifies that it works against the bridge. | Saves a raw bearer token locally and immediately verifies that it works against the bridge. | ||
| Line 122: | Line 116: | ||
| Examples: | Examples: | ||
| - | <syntaxhighlight lang="bash"> | + | <code bash> |
| moshctl auth init --token '< | moshctl auth init --token '< | ||
| - | </syntaxhighlight> | + | </code> |
| - | <syntaxhighlight lang="bash"> | + | <code bash> |
| echo '< | echo '< | ||
| - | </syntaxhighlight> | + | </code> |
| With a custom token file: | With a custom token file: | ||
| - | <syntaxhighlight lang="bash"> | + | <code bash> |
| echo '< | echo '< | ||
| - | </syntaxhighlight> | + | </code> |
| Notes: | Notes: | ||
| * The token file stores the raw bearer token, not the bcrypt hash. | * The token file stores the raw bearer token, not the bcrypt hash. | ||
| - | * < | + | * '' |
| * The token is verified by making a real API call after saving it. | * The token is verified by making a real API call after saving it. | ||
/var/www/wiki.moshnetworks.com/data/attic/mosh/devices/bridge/moshctl.1776742205.txt.gz · Last modified: by mosh
