Skip to content
dwellir-publicPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Dwellir CLI

Dwellir CLI (dwellir) gives you terminal access to core Dwellir dashboard workflows:

  • authenticate and manage profiles
  • discover blockchain endpoints
  • create and manage API keys
  • inspect usage analytics and error logs
  • view account and subscription details

It is designed for both humans and agents, with consistent structured output on every command.

Install

Option 1: Homebrew

brew tap dwellir-public/homebrew-tap
brew install dwellir
dwellir version --json

Upgrade later:

brew update
brew upgrade dwellir

Option 2: AUR (Arch Linux)

yay -S dwellir-cli-bin
dwellir version --json

Option 3: Install latest release script

curl -fsSL https://raw.githubusercontent.com/dwellir-public/cli/main/scripts/install.sh | sh

Note: this requires published GitHub releases.

Option 4: Build from source

git clone git@github.com:dwellir-public/cli.git
cd cli
make build
./bin/dwellir --help

Option 5: Go install

go install github.com/dwellir-public/cli/cmd/dwellir@latest

Quickstart

1) Authenticate

Browser flow:

dwellir auth login

Headless/CI flow:

dwellir auth login --token <CLI_TOKEN>

You can also set a token directly:

export DWELLIR_TOKEN=<CLI_TOKEN>

2) Explore endpoints

dwellir endpoints list
dwellir endpoints search ethereum --protocol https
dwellir endpoints get base

--protocol accepts https, wss, and grpc. HTTPS and WSS URLs hold the API key in the path. A gRPC endpoint shows the dial target <host>:443, which holds no key. A gRPC client connects with TLS and sends the key in the x-api-key metadata header.

3) Search docs from the terminal

dwellir docs search authentication
dwellir docs get getting-started
dwellir docs get https://www.dwellir.com/docs/hyperliquid/historical-data

4) Manage keys

dwellir keys list
dwellir keys create --name ci-key --daily-quota 100000
dwellir keys copy ci-key
dwellir keys env ci-key
dwellir keys disable ci-key
dwellir keys rotate ci-key
dwellir keys delete ci-key --yes

The CLI never prints a full API key. Every output format shows keys masked, for example 9f1c****6789. Select a key by name, by masked value, or by full value. To use a key, copy it to the clipboard with keys copy, or write it to .env with keys env or project setup. keys copy uses pbcopy on macOS, clip.exe on Windows and WSL, wl-copy on Wayland, xclip or xsel on X11, and termux-clipboard-set on Termux. Over SSH or in CI there is no clipboard, so use keys env.

keys rotate gives a key a new value, for example after a leak. The old value stops working at once. The key keeps its name, quotas, enabled state and IP whitelists. Rotating needs confirmation: pass --yes, or pass --human in a terminal to be asked first. Without either, the command rotates nothing. After rotating, run keys copy or keys env <name> --replace to use the new value.

keys delete removes a key. Deleting cannot be undone, and every application that uses the key loses access at once. Deleting needs confirmation: pass --yes, or pass --human in a terminal to be asked first. Without either, the command deletes nothing.

5) Restrict keys to IP addresses

dwellir whitelists list
dwellir whitelists create --name office --ip 203.0.113.10 --ip 2001:db8::5 --key ci-key
dwellir whitelists create --name everyone --ip 198.51.100.7 --all-keys
dwellir whitelists assign office deploy-key
dwellir whitelists unassign office deploy-key
dwellir whitelists update office --ip 203.0.113.10 --ip 203.0.113.11
dwellir whitelists disable office
dwellir whitelists enable office
dwellir whitelists delete office --yes

An enabled IP whitelist limits its API keys to the listed addresses. Requests that use those keys from any other address fail. A whitelist applies to every key (--all-keys, which includes keys created later) or to the keys assigned to it. Select a whitelist by ID or by name, and a key by name or masked value. whitelist also works as the command name.

  • --ip takes single addresses only, as in the dashboard. IPv4 addresses become /32 and IPv6 addresses become /128. Ranges such as /24 are rejected.
  • create --key creates the whitelist disabled, assigns each key, then enables it. If a step fails, the error lists the commands that finish the setup. Running them again is safe.
  • update --ip replaces every address. update --all-keys=false makes an account-wide whitelist restrict only its assigned keys. Assign those keys first, so they stay restricted without a gap.
  • delete needs confirmation: pass --yes, or pass --human in a terminal to be asked first. Without either, the command deletes nothing.
  • Every write needs a token with the read-write scope, which dwellir auth login requests. A token with a lower scope gets a forbidden error (exit code 2).

6) Check usage and logs

dwellir usage summary
dwellir usage history --interval day
dwellir logs errors --status-code 429 --limit 100

logs errors returns meta.has_more and meta.next_cursor. Pass the cursor with --cursor to read the next page. Log rows show each key masked, with its name. Filter by key name with --api-key on usage and --key on logs.

Command Overview

Top-level commands:

  • dwellir auth — login/logout/status/token
  • dwellir docs — list/search/get public docs pages as markdown
  • dwellir endpoints — list/search/get chains and networks
  • dwellir keys — list/create/update/delete/rotate/enable/disable API keys; copy/env to use one
  • dwellir whitelists — list/create/update/enable/disable/assign/unassign/delete IP whitelists for API keys
  • dwellir usage — summary/history/rps analytics
  • dwellir logs — errors/stats/facets with filters
  • dwellir account — info/subscription
  • dwellir config — set/get/list CLI config
  • dwellir profiles — list/current/bind/unbind profile context
  • dwellir doctor — diagnose auth/profile/output state
  • dwellir feedback — send feedback to the Dwellir team (--human asks for each field)
  • dwellir version — build/version metadata
  • dwellir update — self-update from GitHub releases

For full command help:

dwellir --help
dwellir <command> --help

Status commands

dwellir status reads the public status API at https://status.dwellir.com. It needs no login.

dwellir status                                    # summary plus endpoints that are not operational
dwellir status --all                              # every endpoint
dwellir status --chain base --network ethereum/mainnet
dwellir status components                         # valid --chain, --network, and --endpoint values
dwellir status history --since 24h --status open
dwellir status uptime --chain ethereum --range 30d
dwellir status feed --chain base --slack          # prints "/feed subscribe <feed URL>"
dwellir status subscribe --url https://hooks.slack.com/services/T/B/X --chain base --min-severity outage
dwellir status unsubscribe 'https://status.dwellir.com/unsubscribe?token=...'
  • --chain takes a chain slug, --network takes <chain>/<network>, and --endpoint takes an FQDN or an endpoint URL.
  • Repeat a filter flag or separate values with commas. An endpoint matches when any value matches.
  • status feed checks filter values against status components and fails on unknown values. --no-validate skips the check.
  • status subscribe prints the signing secret and the unsubscribe URL once. Store both.
  • Status commands exit 3 when the API returns HTTP 404 or no subscription matches, and 4 on invalid input or HTTP 400.

Output Modes

Every command supports:

  • --human (default): readable output
  • --json: structured machine-readable output
  • --toon: TOON output (JSON-compatible shape)

Example:

dwellir keys list --json

JSON responses use a common envelope:

{
  "ok": true,
  "data": {},
  "meta": {
    "command": "keys.list",
    "timestamp": "..."
  }
}

Errors return ok: false and a non-zero exit code.

Auto-detected non-interactive/agent mode (for example non-TTY runs and environments like Codex/Claude agents) defaults to TOON when no explicit output config is present, even if config.json exists for unrelated settings. Set DWELLIR_AGENT=1 to force agent-mode auto selection, or DWELLIR_AGENT=0 to disable agent detection for the current shell.

JSON remains supported and is recommended for strict machine pipelines (for example heavy jq-first shell automation).

Recent local benchmark runs (Codex + Claude, JSON vs TOON) showed equal task success with fewer tool calls and lower output-token footprint in TOON mode. See Agent Output Benchmark (2026-03-03). For TOON upstream guidance and broader published benchmarks, see:

Profiles and Config

Config is stored in:

  • ~/.config/dwellir/config.json
  • ~/.config/dwellir/profiles/<name>.json

Per-project profile binding is supported via .dwellir.json:

{ "profile": "work" }

Config commands

dwellir config list
dwellir config set output json
dwellir config set output toon
dwellir config set default_profile work
dwellir config get output

dwellir profiles list
dwellir profiles current
dwellir profiles bind work
dwellir profiles unbind

dwellir doctor
dwellir doctor --verify-api

Resolution Rules

Token resolution order

  1. DWELLIR_TOKEN
  2. --token flag
  3. Resolved profile token (from profile resolution below)

Profile resolution order

  1. --profile
  2. DWELLIR_PROFILE
  3. nearest .dwellir.json
  4. default_profile in config
  5. default

Environment Variables

  • DWELLIR_TOKEN — explicit auth token override
  • DWELLIR_PROFILE — default profile override
  • DWELLIR_AGENT — force/disable agent-environment detection (1 or 0)
  • DWELLIR_CONFIG_DIR — custom config directory
  • DWELLIR_API_URL — override API base URL (default: https://dashboard.dwellir.com/marly-api)
  • DWELLIR_DASHBOARD_URL — override dashboard URL for browser auth
  • DWELLIR_DOCS_BASE_URL — override docs base URL (default: https://www.dwellir.com/docs)
  • DWELLIR_DOCS_INDEX_URL — override docs index URL (default: <docs-base>/llms.txt)
  • DWELLIR_POSTHOG_KEY — override PostHog project API key for telemetry
  • DWELLIR_POSTHOG_HOST — override PostHog ingestion host (defaults to https://eu.i.posthog.com; useful for self-hosted PostHog)
  • DWELLIR_STATUS_URL — override the status API base URL (default: https://status.dwellir.com). The --status-url flag takes precedence.
  • DWELLIR_ADDONS — enable the in-progress dwellir addons commands (1 or 0, default 0). Off by default and unsupported: the surface is incomplete and depends on API changes that have not shipped. dwellir doctor reports the resolved state.

Telemetry runs only against the production dashboard or Marly API. Custom and staging API URLs disable telemetry. Organization grouping uses the backend organization_id; cached Outseta IDs and names are never used as group keys.

Development

make build
make test
make test-e2e
make lint
make check

Core paths:

  • cmd/dwellir/ — entrypoint
  • internal/cli/ — Cobra commands
  • internal/api/ — API client and domain APIs
  • internal/auth/ — token resolution and login flow
  • internal/config/ — config/profile management
  • internal/output/ — formatter and envelope
  • internal/telemetry/ — PostHog integration
  • test/e2e/ — end-to-end tests

Releases

  • Version source of truth: VERSION (SemVer, e.g. 0.1.0).
  • Every PR merged to main must bump VERSION.
  • A merge to main automatically:
    1. creates/pushes v<VERSION> tag
    2. runs GoReleaser on that tag
    3. publishes GitHub release artifacts

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages