Skip to main content
📢 New post: Editor Superpowers for Phobos — Introducing the Language Server and VS Code Extension — Read more →

CLI

The Phobos CLI supports all major platforms, and binaries are released via GitLab releases.

Have a question?

Check the FAQ to see if there's already an answer.

Download binary

Latest version: <VERSION>

phobos_<VERSION>_linux_amd64
curl -LO "https://gitlab.com/api/v4/projects/59088135/packages/generic/phobos-cli/<VERSION>/phobos_<VERSION>_linux_amd64"
mv phobos_<VERSION>_linux_amd64 phobos
chmod +x phobos
caution

Installing the Phobos CLI on other platforms may be possible, but it is not recommended nor supported.

Build from source

While downloading a pre-built binary meets most use-cases, it may be desired to build a binary from source. Doing so will allow changing the default Phobos HTTP endpoint (DefaultHTTPEndpoint) the CLI uses, which offers some convenience when configuring the CLI.

The CLI project includes a handy Makefile to help the build process be a little easier.

Requirements

Git clone the project to the local machine
git clone https://gitlab.com/infor-cloud/martian-cloud/phobos/phobos-cli.git
Use make to compile a binary
cd <project-directory>
make build

To set a custom default endpoint at build time, pass it via ldflags:

Build with a custom default endpoint
go build -ldflags "-X main.DefaultHTTPEndpoint=https://api.phobos.example.com" -o phobos ./cmd/phobos

Frequently asked questions (FAQ)

Is there a way to run the CLI from any directory?

Yes. Add the directory containing the binary to your system's PATH.

On Linux/macOS (Bash):

echo "PATH=\$PATH:[binary path]" >> ~/.bashrc && source ~/.bashrc

On Windows (PowerShell):

[Environment]::SetEnvironmentVariable("Path", $env:Path + ";[binary path]", "User")

Replace [binary path] with the full path to the directory containing the CLI binary.

Does the CLI auto-update?

At the moment, it does not. However, running phobos version will show when a newer version is available and provide the download URL.

Is the CLI binary signed?

Not yet, although, this is on our roadmap.