Skip to Content
How-to guidesInstall the CLI

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

  1. Install the CLI:

    curl -fsSL https://marshal.codes/downloads/install.sh | sh

    The script checks the download’s sha256 before it installs. It puts marshal in ~/.local/bin, or in /usr/local/bin if that is the only choice. If the folder is not on your PATH, 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.

  2. Sign in:

    marshal login --server https://marshal.example.com

    Your 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 --server once. The CLI saves it in ~/.marshal/config.json.

    On a server or over SSH, there is no browser to open, so marshal login uses device login. See Sign in on a remote server below. You can also add --password to sign in with your email and password in the terminal.

  3. Check who you are and which organization is active:

    marshal config view marshal org current
  4. Recommended: install the daemon.

    marshal daemon install

    The 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.

  5. 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.

  1. On the remote machine, run:

    marshal login --server https://marshal.example.com

    With no display detected, the CLI says it is using device login. To choose it yourself on any machine, run marshal login --device.

  2. 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.

  3. 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.

  4. 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

VariableWhat it does
MARSHAL_CLI_VERSION=x.y.zInstalls 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 says Login approved and the terminal signs in.
  • marshal config view shows your server under api_url and a logged in line with your email.
  • marshal org current prints 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 upgrade installs the newest CLI that works with the server you are signed in to. marshal upgrade --check only tells you if there is one.
  • marshal version prints the CLI, daemon, and server versions.
  • In more than one organization? marshal org list shows them all, and marshal org switch <slug> changes the active one.
  • marshal logout signs 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>.