Skip to content

Quickstart

This guide takes you from an admitted beta account to your first execution from the terminal. You do not need to build the client from source.

You need access to the mPaka console and a terminal on Linux, macOS, or Windows. The console manages your account and credentials; the CLI submits the workload.

The mPaka download page is the source of truth for supported platforms, manual downloads, and installer verification.

On Linux or macOS, run:

Terminal window
curl -fsSL https://cli.mpaka.dev/install | bash

On Windows PowerShell, run:

Terminal window
irm https://cli.mpaka.dev/install.ps1 | iex

Open a new terminal if the installer asks you to refresh your PATH, then verify the installation:

Terminal window
mpaka --version

Open API keys in the console, create a key for this client, and copy its token when it appears. The token is shown once. You can also create it with the CLI after signing in:

Terminal window
mpaka login --email user@example.com
mpaka api-keys create --name hello-python

Creating or rotating a key with the CLI requires an owner account. The CLI prints the token once and does not save it; handle it as a secret.

Set it for your current terminal session without putting the token in shell history. For longer-lived use, store it in a secret manager.

Linux or macOS:

Terminal window
printf 'mPaka API key: '
read -r -s MPAKA_API_KEY
printf '\n'
export MPAKA_API_KEY

Windows PowerShell:

Terminal window
$secureKey = Read-Host 'mPaka API key' -AsSecureString
$env:MPAKA_API_KEY = (New-Object System.Net.NetworkCredential('', $secureKey)).Password
Remove-Variable secureKey

Read API keys before configuring a shared or deployed client.

Create hello.py:

print("Hello from mPaka")

Source must be non-empty Python and no larger than 16 KiB.

Terminal window
mpaka run --file hello.py

The CLI prints the execution ID and lifecycle status, then polls until the execution reaches a terminal state. Its final output includes:

  • Status — the lifecycle outcome.
  • Mode — how the service handled the workload.
  • Exit code — the Python process result when one is available.
  • stdout and stderr — the program output returned by the service.

The CLI also prints a generated idempotency key to standard error before a new submission. Keep it if the network fails and you need to recover the same request without creating a duplicate.

A run succeeds only when all three conditions are true:

  1. Status is completed.
  2. Mode is not mock_no_code_execution.
  3. Exit code is 0.

Any other combination returns a non-zero CLI exit status. In particular, mock_no_code_execution means the source was not executed, even if the lifecycle record says completed.

If polling ends before the execution becomes terminal, the CLI reports the execution ID and last known status. Inspect it without submitting again:

Terminal window
mpaka executions get <EXECUTION_ID>

For code that needs third-party packages, create a text file such as requirements.txt with pinned versions:

requests==2.32.3

Create the environment, wait for it to become ready, and submit using its ID:

Terminal window
mpaka environments create --requirements requirements.txt
mpaka environments wait <ENVIRONMENT_ID>
mpaka run --file hello.py --environment <ENVIRONMENT_ID>

Run the execution only after the wait reports ready. If the environment is failed, inspect it with mpaka environments get <ENVIRONMENT_ID> and stop before submitting. Environment builds are asynchronous and depend on deployment configuration. See the CLI reference for listing and timeout behavior, or the HTTP API for the full contract.