OceanLaunch docs

Build, ship and run your apps

Deploying

Command-line tool

Deploy an app and watch its build from your terminal, or from any CI, with one command.

Install

It needs Node.js 18.17 or newer, on Windows, macOS or Linux, and nothing else:

npm install -g https://oceanlaunch.cloud/cli/oceanlaunch-cli-0.1.0.tgz
oceanlaunch --version

The package's SHA-256 is bada5728ac0285480569a4580bffb21af295afe8638e84ec6e09f0e532d41e3f. To check it first, download the file, compare its checksum (sha256sum, or Get-FileHash on Windows), then install the downloaded file.

Sign in

  1. Make a token under Account → API tokens (see API tokens). Choose Read and deploy to deploy with it.
  2. Run oceanlaunch login and paste it. It isn't shown as you paste, and it's checked before it's saved.

The token is saved in a file only you can read (~/.config/oceanlaunch/config.json, or %APPDATA%\oceanlaunch\config.json on Windows), together with the portal's address, and is only ever sent there. oceanlaunch logout removes it from the file; revoke it under API tokens too if you no longer need it.

The tool never takes a token on the command line, where it would end up in your shell history: paste it, pipe it in, or set OCEANLAUNCH_TOKEN.

Commands

CommandWhat it does
oceanlaunch appsThe workspace's apps, their status and addresses.
oceanlaunch status my-appOne app and its latest deployment, with the reason if it failed.
oceanlaunch deploy my-appDeploys the newest commit (or latest upload) and prints the build log until it's live. --quiet prints only the result; --no-wait returns once it's queued.
oceanlaunch logs my-appThe latest deployment's log. Add a number for an older one, and --follow to keep printing until it finishes.
oceanlaunch deployments my-appIts recent deployments.
oceanlaunch workspacesYour workspaces and your role in each.
oceanlaunch use my-workspaceMakes a workspace the default, so you can leave out -w.
oceanlaunch whoamiWho the token belongs to and what it may do.

With one workspace, it's used by itself. Otherwise pick one with -w my-workspace, OCEANLAUNCH_WORKSPACE or oceanlaunch use. Add --json to any command for output a script can read.

In CI

Save a Read and deploy token as a secret named OCEANLAUNCH_TOKEN; nothing needs to sign in. In GitHub Actions, after your tests:

- name: Deploy to OceanLaunch
  env:
    OCEANLAUNCH_TOKEN: ${{ secrets.OCEANLAUNCH_TOKEN }}
  run: |
    curl -fsSLo oceanlaunch-cli.tgz https://oceanlaunch.cloud/cli/oceanlaunch-cli-0.1.0.tgz
    echo "bada5728ac0285480569a4580bffb21af295afe8638e84ec6e09f0e532d41e3f  oceanlaunch-cli.tgz" | sha256sum -c -
    npx --yes --package ./oceanlaunch-cli.tgz oceanlaunch deploy my-app -w my-workspace --quiet

The checksum line makes the job stop if the file isn't exactly the published one, before anything runs with your token. Keep --package … oceanlaunch as it is: without it, npx runs nothing and still reports success.

deploy exits with 0 when the app is live and 3 when the deployment fails or is cancelled, so the job fails with it. Other problems (a refused token, a mistyped app) exit with 1, and a wrong command with 2.

How it keeps your token safe