Install the CLI and sign in
Put Marshal in your terminal in two commands. With the marshal CLI you start spaces, attach to them from your own shell, launch runs, and script all of it. Install it once per machine, then sign in to your Marshal server.
Before you start
- A Mac (Apple Silicon or Intel) or a Linux machine (x86_64 or arm64).
- Your Marshal server URL. It is the address you open the web app at, for example
https://marshal.example.com. - A Marshal account in an organization. Any role works.
Steps
-
Install the CLI:
curl -fsSL https://marshal.codes/downloads/install.sh | shThe script checks the download’s sha256 before it installs. It puts
marshalin~/.local/bin, or in/usr/local/binif that is the only choice. If the folder is not on yourPATH, the script tells you.To read the script first, other platforms, and direct downloads, open marshal.codes/downloads . In the web app, the same steps are in your user menu under Download CLI, with your server URL filled in.
-
Sign in:
marshal login --server https://marshal.example.comYour browser opens on the Marshal sign-in page. Sign in as you do in the web app. The CLI waits up to 5 minutes. If the browser does not open, copy the URL the CLI prints. You set
--serveronce. The CLI saves it in~/.marshal/config.json.On a server or over SSH, there is no browser to open, so
marshal loginuses device login. See Sign in on a remote server below. You can also add--passwordto sign in with your email and password in the terminal. -
Check who you are and which organization is active:
marshal config view marshal org current -
Recommended: install the daemon.
marshal daemon installThe daemon runs in the background. It powers the Ports and Mounts tabs of a space in the web app, and desktop notifications. It starts on every login. It is part of the same binary, so there is nothing else to download.
-
Optional: turn on tab completion with
marshal completions setup.
Sign in on a remote server
Sign in to a machine that has no browser, such as a cloud VM or a box you reach over SSH, by approving the login from your laptop or phone.
-
On the remote machine, run:
marshal login --server https://marshal.example.comWith no display detected, the CLI says it is using device login. To choose it yourself on any machine, run
marshal login --device. -
The CLI prints a link and a code. Open the link on any device where you can sign in, with your password or Google. The pre-filled link already holds the code. Otherwise, type the code in.
-
Check the details on the approval page: the host name and operating system the CLI reported, the network address of the request, how long ago it started, and the organization. Choose Approve.
-
The terminal finishes the login and signs you in to the organization that was active on the approval page. To use a different one, switch organizations on that page before you approve.
The request is valid for 10 minutes. Deny is the default button, and you should approve only a code you started yourself. The host name and operating system come from the machine that asked, so the page marks them as unverified.
Want the browser on a machine that looks headless, for example with a display you forward some other way? Run marshal login --browser.
Options for the install script
| Variable | What it does |
|---|---|
MARSHAL_CLI_VERSION=x.y.z | Installs that version instead of the latest. |
INSTALL_DIR=<folder> | Installs into that folder. |
For example: curl -fsSL https://marshal.codes/downloads/install.sh | INSTALL_DIR=$HOME/bin sh.
What you should see
- The install script ends with
==> Done. Next: marshal login --server <your Marshal server URL>. - After sign-in:
✓ Logged in as you@example.com. - With device login, the terminal shows a link, a code, and
Waiting for approval (expires in 10 minutes)…. When you choose Approve, the page saysLogin approvedand the terminal signs in. marshal config viewshows your server underapi_urland alogged inline with your email.marshal org currentprints the slug of your active organization.- After
marshal daemon install, a message that the daemon is installed and starts on every login.
Keep it current
marshal upgradeinstalls the newest CLI that works with the server you are signed in to.marshal upgrade --checkonly tells you if there is one.marshal versionprints the CLI, daemon, and server versions.- In more than one organization?
marshal org listshows them all, andmarshal org switch <slug>changes the active one. marshal logoutsigns this machine out. Your server URL stays saved.
Next
Create a space and attach to it from your terminal with marshal spaces new --manifest <name>.