Skip to main content

Install and configure the DALP CLI

Install the DALP CLI, authenticate with a browser device code flow, and configure the API URL, active organisation, and output format.

The DALP CLI (dalp) is a standalone command-line client for the Platform API. It ships as the package @settlemint/dalp-cli, and every business command it exposes calls the same public v2 endpoints documented in the DALP API reference.

Install

The dalp command requires both Node.js and Bun on your PATH, whichever package manager installs it: Node.js launches the command wrapper and Bun runs the CLI. The package installs neither runtime. Read the required versions from the package's engines field, install both runtimes on the machine or CI image, and confirm each one responds:

npm view @settlemint/dalp-cli engines
# example output: { bun: '1.4.4', node: '>=20.11.0' }
node --version
bun --version

dalp does not check those versions when it starts. Install the package globally with the package manager you already use, then confirm the install by printing the version:

npm install --global @settlemint/dalp-cli
dalp --version
pnpm add --global @settlemint/dalp-cli
dalp --version
bun add --global @settlemint/dalp-cli
dalp --version

When either runtime is missing from your PATH, dalp --version stops. Without Node.js, your shell reports that it cannot find node. Without Bun, dalp exits with code 127 and prints:

dalp: cannot start Bun (<reason>). Install Bun and put it on your PATH.

A dalp command does not load .env files or bunfig.toml from your current folder, so a cloned repository cannot change the CLI's environment or run preload code. That protection holds whenever Node.js starts dalp, as the installed binary does.

When Bun starts dalp directly, Bun reads those files before dalp begins. That happens with bunx, with a package script on a machine without Node.js, with --bun, or with a package script in a project whose bunfig.toml sets run.bun.

Set the variables the CLI reads (DALP_URL, DALP_CONFIG_DIR, DALP_ORG and DALP_WALLET_CODE) in your shell or CI job environment. Values kept only in a .env file do not apply:

  • Without DALP_CONFIG_DIR, every command uses ~/.config/dalp.
  • Without DALP_URL, dalp login takes the instance from .dalprc.json or the global config file.
  • Without DALP_WALLET_CODE, a non-interactive login stops with kit.cli.WALLET_CODE_REQUIRED.

A tool that loads a .env file into the environment before it starts dalp still passes those values on. dalp login asks before it uses a DALP_URL or DALP_CONFIG_DIR that arrived that way, as Authenticate describes, and uses DALP_ORG and DALP_WALLET_CODE without asking.

Run dalp --update to install the latest published version. In a terminal, dalp also prints a notice when a newer version exists. It checks the package registry at most once a day for that notice, and the NO_UPDATE_NOTIFIER environment variable or a CI environment switches the notice off.

The TypeScript SDK runs in browser, server and React Native applications on the runtime your application already uses. Use the CLI for terminal access to an instance, and the SDK when you build software.

Authenticate

Point the CLI at your instance, then sign in and confirm the session:

dalp config set apiUrl https://your-instance.example.com
dalp login
dalp whoami

The login step accepts only HTTPS instance URLs. HTTP is accepted for localhost, 127.0.0.1 and ::1 alone, for local development. A URL that is not absolute, or that carries embedded credentials, a query string or a fragment, is refused with kit.cli.INVALID_URL. There is no default instance: without a URL from dalp login --url, DALP_URL or the apiUrl config key, login stops with NO_URL.

Before it sends anything, dalp login writes the instance URL and its source to standard error, as in Signing in to https://your-instance.example.com (host from --url). The line names the file and its path when a file chose the URL. A successful login reports the source in instanceSource: --url, DALP_URL, project file for .dalprc.json, global config, or project .env file when a .env file set DALP_URL or DALP_CONFIG_DIR.

A file in the working directory may come with a repository someone else wrote, so dalp login asks before such a file chooses where you sign in. Although the CLI never loads .env files itself, a launcher can export one first. When DALP_URL or DALP_CONFIG_DIR is set and any .env file in the working directory defines it too (.env, .env.local, .env.development, .env.production, .env.test and their .local variants), login treats the value as that file's choice and prompts in two cases:

  • The URL comes from .dalprc.json or from a DALP_URL that a .env file also defines, and the global file holds no apiUrl or a different one.
  • DALP_CONFIG_DIR is set and a .env file also defines it. The login then keeps its configuration in that directory, and on Linux and Windows its credentials too, so it asks on every login, even when the URL matches ~/.config/dalp/config.json.

In a terminal, dalp login shows what the file chose and asks before sending any request. Enter y or yes to sign in, which replaces stored credentials as any login does. Any other input, or an empty reply, stops the login with kit.cli.LOGIN_HOST_DECLINED and leaves configuration and credentials unchanged.

After a successful login, the global file holds the new URL, so a later login to that URL from the same folder goes ahead without the prompt unless the DALP_CONFIG_DIR case applies.

In agent mode, or when standard input is not a terminal, the login stops with kit.cli.LOGIN_HOST_UNCONFIRMED and sends nothing. To sign in from a script or an agent, pass the instance with dalp login --url.

A DALP_URL set in your shell works too, as long as no .env file in the working folder defines DALP_URL. Move any DALP_URL or DALP_CONFIG_DIR out of project .env files and into your shell environment so non-interactive logins do not prompt or fail.

Once the URL is settled, dalp login requests a device code and a short user code from the instance and polls until you approve the request in the browser. When its output is a terminal and you pass no --format flag, it prints the verification URL and the user code and tries to open the URL. In agent mode the CLI does neither, so start the sign-in from a terminal without --format.

The Console shows its device approval screen at /auth/device. Enter the eight-character code shown in the terminal, or open the link that already carries it. If you have no Console session, the Console asks you to sign in first and returns you to that screen.

Once the screen has the complete code, it shows what approval allows: full access to your account, including creating API keys. Approve only a sign-in you started now. If someone else sent you the link or code, select Deny. Approve stays disabled until the request has loaded.

A code the instance does not recognise, that has expired, or that another account already claimed returns “That code is wrong or has expired. Check the code in your terminal and try again.” The user code expires after 10 minutes. The CLI backs off when the instance asks it to slow down, stops polling after expiry, and rejects any token response that arrives late. It exits with kit.cli.DEVICE_AUTHORIZATION_TIMEOUT on expiry and kit.cli.AUTHORIZATION_DENIED if you select Deny.

On approval, the CLI reads the granted session, requires an active organisation, asks for your wallet PIN and creates a new API key scoped read-write, or read when you pass --read-only (Sign in with a read-only key). The key expires after 90 days, is stored locally, and is named dalp-cli with your machine's hostname, such as dalp-cli (dev-laptop).

API key names hold at most 32 characters, so a hostname longer than 21 characters is truncated to its first 20 characters followed by …, as in dalp-cli (build-agent-07.eu-we…). A session with no active organisation creates nothing and fails with kit.cli.NO_ACTIVE_ORGANIZATION. Once the key is stored, the CLI saves apiUrl and defaultOrg in the global config file.

The lifetime is fixed: dalp login offers no shorter-lived key, and the CLI reads no API key from the environment. For a CI job or a service, create an API key as Authentication and API keys describes and call the API or the SDK with it.

Creating the key, a read key included, needs the same wallet verification as signing a transaction. The CLI asks for your wallet PIN on the terminal without echoing it. Pass --wallet-factor otp, --wallet-factor oidc-mfa or --wallet-factor secret-codes to confirm with an authenticator app, an identity-provider authenticator or a recovery code instead.

An account with an authenticator configured must use otp or oidc-mfa, because the platform refuses a PIN or recovery code with WALLET_STEP_UP_STRONGER_FACTOR_REQUIRED. When standard input is not a terminal, set DALP_WALLET_CODE. Without it, login stops with kit.cli.WALLET_CODE_REQUIRED after browser approval and creates no key.

Requests made with the key afterwards carry no wallet verification. The platform does not ask an API-key request for it, and refuses one only during the cooling-off period after a security change. A stored read-write key therefore carries the signing authority of the account until it expires or is revoked. A read key carries none.

During a cooling-off period after a security change, login stops with WALLET_STEP_UP_HELD and preserves your stored credentials. A wrong wallet code stops it with WALLET_STEP_UP_REJECTED. Any other key creation refusal stops with API_KEY_FAILED.

When your deployment requires two-factor sign-in and your account has not set it up, browser approval succeeds but key creation fails before wallet verification. The CLI prints Authorized, but the API key was not created with code LOGIN_TWO_FACTOR_REQUIRED and reason Set up two-factor sign-in before you create or change an API key., and stores no key. Set up two-factor sign-in on the Security page, then run dalp login again.

The CLI process never touches your password: you approve the short code inside your browser, where you sign in however your organisation requires. On approval, the CLI briefly holds a device session token in memory and never writes it to disk.

The CLI sends that bearer token only to read the session, create the API key and sign out the session. Every other account route refuses it, and those three routes accept bearer tokens only from a device sign-in. The device session works only as that bearer token: sent as a browser session cookie, it is refused with DEVICE_SESSION_BEARER_ONLY, an answer to the bearer never sets a cookie, and reading the session never extends it. When the Console signs in through an identity provider, only a Console session can approve a device code, and the Investor portal refuses device routes with DEVICE_SIGN_IN_NEEDS_CONSOLE.

Once the key is created, or the login stops after your approval, the CLI signs that session out, so it does not stay valid for the 7 days a session lasts. If the sign-out fails, the CLI keeps the new key and prints “Warning: The sign-in session this login used could not be ended. It expires on its own within 7 days, or you can end it from your Security page in the Console.” You end it among the sessions on your Security page.

The minted key is an ordinary API key, the same kind of secret a backend service holds, and once it is issued the platform treats it like a key created through the API key routes. It differs only in how it is made: a person's browser login creates it. Nothing binds it to the machine that stored it, so whoever holds the key can use it from any host until it expires after 90 days or is revoked under API keys in the Console.

Confirm the session at any time with dalp whoami. End it with dalp logout, which removes the stored credentials from this machine.

dalp whoami
dalp logout

Logging out revokes this machine's API key on the server and then removes the stored credentials. When the instance does not confirm the revocation, the command removes the local credentials anyway and fails with kit.cli.API_KEY_REVOKE_UNCONFIRMED, telling you to revoke the dalp-cli key under API keys in the Console.

The CLI stores one credential set at a time, not multiple named profiles. Re-running dalp login creates the new key, revokes the previous key, and only then saves the new one. If revoking the previous key fails, the CLI rolls back the new key and fails with kit.cli.API_KEY_REVOKE_FAILED, keeping your previous credentials intact.

If saving the new credentials fails after revoking the old key, the CLI revokes the new key and fails with kit.cli.CREDENTIAL_STORE_FAILED, so run dalp login again. On Linux and Windows, use separate DALP_CONFIG_DIR directories for separate identities. On macOS, the keychain stores one login under the dalp-cli service name and replaces any prior entry on save.

Sign in with a read-only key

Pass --read-only when the CLI only needs to inspect, for example for an agent:

dalp login --read-only

The platform refuses every write that carries a read key with 403 and DALP-0036 (SESSION_POLICY_DENIED), whether you type the command or an agent sends it, and stores nothing. Do not retry: the refusal comes from the key's scope, not from the request. The one change the key can make is to revoke itself, which dalp logout does as it does for a read-write key.

dalp whoami, dalp org and every get command work the same with either key. Every command that uses this login is read-only too, so keep a second login in its own config directory when you also need to write (Credential storage). To write again, run dalp login without the flag, which replaces the stored key. The key keeps the read scope unless its owner raises it under API keys in the Console, which needs wallet verification.

Active organisation

The API key that dalp login creates belongs to one organisation: the active organisation of the session that approved the login. Inspect it with the org command group:

dalp org list
dalp org switch <organizationId>
dalp org current

org list lists only the organisation the stored key belongs to, because an API key reads only its own organisation. org switch accepts only that same organisation, saving it in stored credentials and defaultOrg.

Passing another organisation id fails with a message naming the key's organisation and saves nothing. An API key cannot move between organisations, so run dalp login again to work in a different organisation or to replace a key that has no organisation.

Configuration

The CLI resolves three configurable keys: apiUrl, defaultOrg, and format. Read and write them with:

dalp config get apiUrl
dalp config set defaultOrg <organizationId>
dalp config list

config get and config set both require a key name and refuse unknown keys with INVALID_CONFIG_KEY. config set always writes the global file, stores apiUrl and defaultOrg as typed, and accepts only toon, json, yaml or md for format.

There is no bare dalp config get that dumps every key. Run dalp config list to see the global file's stored values alongside the effective resolved values after layering.

These keys are read by dalp login, dalp config and the other configuration-aware commands. They do not move an existing login: every other command talks to the instance URL and the organisation that dalp login stored, so to change where the CLI points, run dalp login against the new instance.

dalp login resolves its instance URL from three layers, each overriding the one before it:

  1. The global file at ~/.config/dalp/config.json (override the directory with the DALP_CONFIG_DIR environment variable).
  2. A project file named .dalprc.json in the current working directory.
  3. The DALP_URL environment variable, or dalp login --url.

dalp login asks before it uses a URL from .dalprc.json or a .env file that is not the global file's apiUrl, and before it uses a DALP_CONFIG_DIR from a .env file, as Authenticate describes. It does not ask about --url, or about a DALP_URL set in your shell when no .env file in the folder defines one, unless a .env file sets DALP_CONFIG_DIR.

Every other command that uses the stored login sends its requests to the stored instance, whatever these layers say. Which stored login that is depends on the config directory and the platform, as Credential storage describes. When the layers resolve apiUrl to another instance, the command writes one line to standard error before it runs, so you see the mismatch:

→ https://your-instance.example.com (stored login, not https://other-instance.example.com from project file /work/payments-app/.dalprc.json)

The warning names the stored instance first, then the other URL and the layer that set it (DALP_URL, project file <path>, or global config <path>). Because the CLI compares only the deciding layer, a .dalprc.json with another URL prints nothing while DALP_URL matches the stored instance. A DALP_URL loaded from a .env file by an external launcher still prints as DALP_URL, and URLs that differ only by a trailing slash count as the same instance.

No warning is printed when the resolved apiUrl matches the stored instance, when no layer sets one, or on dalp login, dalp logout, dalp config, dalp mcp and dalp skills. If .dalprc.json or the global file cannot be read or fails validation, the command still runs and only DALP_URL can trigger the warning.

The line changes neither standard output nor exit code, in agent mode or with any --format. Scripts parsing JSON, YAML or TOON must read standard output alone, because combining stderr with 2>&1 puts the warning ahead of the payload. Sign in with dalp login to switch instances, or remove the mismatching apiUrl or DALP_URL to silence the warning.

Every request the CLI makes acts in the organisation the stored API key belongs to. defaultOrg, which the DALP_ORG environment variable also sets, records the organisation the login is for. It does not move a request to another organisation.

The CLI creates the config directory with mode 0700 and writes config.json with mode 0600. A configuration file that fails validation stops dalp login and dalp config with kit.cli.CONFIG_INVALID, and a global file that fails validation also stops dalp org switch, so fix or delete the file. Credentials are stored separately, as the next section describes.

Credential storage

The CLI stores your API key by operating system:

Platform
Storage
macOS
The system keychain, under the service name dalp-cli.
Linux and Windows
credentials.json in the config directory, ~/.config/dalp unless DALP_CONFIG_DIR names another one, written with 0600 permissions.

On Linux and Windows, the CLI refuses to read a credentials file whose permissions have been loosened. It tells you to run chmod 600 on it, rather than silently trusting a world-readable file, because a shared machine can otherwise leak your API key to another account. The file is not encrypted. Its permissions keep the key from other accounts on the machine, not from programs that run as you, such as an agent with a shell.

Neither storage path writes credentials to shell history or logs. On Linux and Windows, the CLI writes the value directly to credentials.json.

On macOS, the CLI passes credentials to the system security tool over standard input rather than as command arguments, keeping them out of the process list. Because security reads each input line into a 4,096-byte buffer, a sign-in whose email contains a line break or whose payload exceeds that buffer fails with kit.cli.CREDENTIAL_STORE_FAILED and stores nothing.

Output format

Every command accepts --format to control output: toon (the compact text default), json, yaml, md, or jsonl for newline-delimited output. A terminal run without --format prints only the result to standard output and writes progress to standard error.

In agent mode, which activates when standard output is not a terminal or --format is passed, generated commands print progress events before the result:

  • With --format json, output is a JSON array of events ending in the response body, or an object with numbered keys and a cta key when linked CLI commands are suggested. Read the last numbered entry for the response body.
  • With --format jsonl, each event and the final response body appear on their own chunk line, followed by a done line. Read the last chunk line for the response body.

The format config key accepts toon, json, yaml and md, and it is read by dalp config only: the installed CLI selects its output format from --format alone, so pass the flag on every command whose output a script parses. jsonl is a per-call format and is not a stored value.

Next steps

  • CLI commands covers the generated command tree, how to discover a command you do not already know, and how to wait for on-chain settlement.
  • Using the CLI with AI agents covers running dalp from an MCP client or a coding agent's shell.

Was this page helpful?