# Getting started

Source: https://docs.settlemint.com/docs/developer-guides/cli/getting-started
Install the DALP CLI, authenticate with your platform instance, and run your first commands.



The DALP CLI (`@settlemint/dalp-cli`) provides full programmatic access to the Digital Asset Lifecycle Platform from your terminal. It supports interactive use, scripting, CI/CD pipelines, and AI agent integration.

## Installation [#installation]

Install the CLI globally:

```bash
npm install -g @settlemint/dalp-cli
```

Or with Bun:

```bash
bun add -g @settlemint/dalp-cli
```

After installation, the `dalp` command is available in your terminal.

## Authentication [#authentication]

The CLI uses the **OAuth 2.0 Device Authorization Grant** (RFC 8628) for secure, browser-based login. No passwords are entered in the terminal.

### Login [#login]

```bash
dalp login --url https://your-platform.example.com
```

Or set the URL via environment variable:

```bash
export DALP_URL=https://your-platform.example.com
dalp login
```

**What happens:**

1. The CLI requests a device code from the platform
2. Your browser opens to the verification page (or displays a URL to visit)
3. You enter the displayed user code and authorize the CLI
4. The CLI receives an access token and creates a long-lived API key
5. Credentials are stored securely (macOS Keychain or encrypted file)

### Verify your session [#verify-your-session]

```bash
dalp whoami
```

Returns your user ID, email, wallet address, and active organization.

### Logout [#logout]

```bash
dalp logout
```

Revokes the API key on the server and removes local credentials.

***

## Configuration [#configuration]

The CLI resolves configuration from multiple sources (highest priority first):

1. **CLI flags** – `--url`, `--org`, `--format`
2. **Environment variables** – `DALP_URL`, `DALP_ORG`
3. **Project config** – `.dalprc.json` in the current directory
4. **Global config** – `~/.config/dalp/config.json`

### Manage config [#manage-config]

```bash
## View all config
dalp config get

## View a single key
dalp config get apiUrl

## Set a value
dalp config set format json
dalp config set defaultOrg my-org-slug
```

### Output formats [#output-formats]

The CLI supports multiple output formats:

| Format | Flag            | Use case                         |
| ------ | --------------- | -------------------------------- |
| `toon` | `--format toon` | Human-readable tables (default)  |
| `json` | `--format json` | Machine-readable, piping to `jq` |
| `yaml` | `--format yaml` | Configuration files              |
| `md`   | `--format md`   | Documentation, reports           |

Set the default globally:

```bash
dalp config set format json
```

***

## Credential storage [#credential-storage]

Credentials are stored securely based on your operating system:

| Platform        | Storage         | Details                                                   |
| --------------- | --------------- | --------------------------------------------------------- |
| macOS           | System Keychain | Via `security` command, service `dalp-cli`                |
| Linux / Windows | File            | `~/.config/dalp/credentials.json` with `0600` permissions |

The CLI validates file permissions on load and refuses to read credentials with insecure permissions.

***

## Your first commands [#your-first-commands]

After logging in, try these to explore the platform:

```bash
## View your user profile
dalp whoami

## List tokens in the system
dalp tokens list

## List users
dalp users list

## View system information
dalp system list

## Search across the platform
dalp search-results "bond"
```

***

## Environment variables [#environment-variables]

| Variable   | Description                                          |
| ---------- | ---------------------------------------------------- |
| `DALP_URL` | Platform URL (alternative to `--url` or config)      |
| `DALP_ORG` | Organization slug (alternative to `--org` or config) |

***

## Shell completions [#shell-completions]

Enable tab completion for your shell:

```bash
dalp completions
```

This generates and installs a completion script for your detected shell (bash, zsh, fish).

***

## Next steps [#next-steps]

* **[Command reference](/docs/developer-guides/cli/command-reference)** – Full list of commands and options
* **[Scripting and automation](/docs/developer-guides/cli/scripting)** – Use the CLI in scripts and CI/CD
* **[AI agent integration](/docs/developer-guides/cli/ai-agents)** – Use the CLI with LLMs, MCP servers, and AI coding agents
