Skip to main content

CLI and client library for the Wealthbox CRM API

Project description

Wealthbox CLI

PyPI version Python 3.11+ License

A command-line interface for interacting with the Wealthbox CRM API.

This tool provides structured access to contacts, households, tasks, events, notes, users, categories, and more — directly from your terminal.

Official API documentation: https://dev.wealthbox.com

Disclaimer: This is an unofficial, community-built tool. It is not affiliated with, endorsed by, or supported by Wealthbox or its parent company. "Wealthbox" is a trademark of its respective owner.


Features

  • Full CRUD support for:
    • Contacts (Person, Household, Organization, Trust)
    • Households (member management)
    • Tasks
    • Events
    • Notes (create, read, update — delete not supported by API)
  • Structured flag-based add and update commands — no raw JSON required
  • Type-specific contact creation subcommands: contacts add person|household|org|trust
  • --more-fields escape hatch on contacts/tasks/projects/opportunities/workflows for uncommon JSON fields
  • Multiple output formats via --format: json (default), table, csv, tsv
  • Nested API fields (linked_to, email_addresses, tags, etc.) automatically flattened for tabular output
  • Category and metadata lookups (resource-scoped and workspace-level)
  • Client-side filters for fields the API doesn't support server-side (e.g. --assigned-to on contacts)
  • Modular CLI structure with extensible client + model architecture

Installation

From PyPI (recommended)

pip install wealthbox-cli

From source (development)

git clone https://github.com/massive-value/wealthbox-cli
cd wealthbox-cli
python -m venv .venv
source .venv/bin/activate  # macOS/Linux
# OR
.venv\Scripts\activate     # Windows
pip install -e ".[dev]"

Configuration

Getting your API token

  1. Log in to Wealthbox
  2. Click the three dots menu (...) in the top right
  3. Go to Settings -> API Access
  4. Click Create Access Token

Storing your token

wbox config set-token

This prompts for your Wealthbox API token (input is masked) and stores it in ~/.config/wbox/config.json (Linux/macOS) or %APPDATA%\wbox\config.json (Windows).

Other configuration commands:

wbox config show     # display stored config (token masked)
wbox config clear    # remove stored config

Alternative methods (for CI, scripting, or containers):

# Environment variable
export WEALTHBOX_TOKEN="your_api_token_here"

# .env file in working directory
echo 'WEALTHBOX_TOKEN=your_api_token_here' > .env

# Per-command flag
wbox contacts list --token your_api_token_here

Token is resolved in this order: --token flag > WEALTHBOX_TOKEN env var > config file > .env file.


Usage

wbox <resource> <command> [options]
wb <resource> <command> [options]

For the full command reference see docs/cli-reference.md.

Local wrapper

For this workspace, the easiest entrypoint is:

./run-wbox.sh me --format json
./run-wbox.sh users list --format json
./run-wbox.sh contacts list --per-page 1 --format json
./run-wbox.sh contacts add person --first-name Jane --last-name Doe --format json

The wrapper:

  • loads .env
  • uses the repo-local .venv
  • runs the installed wbox CLI

Project Structure

src/
  wealthbox_tools/
    cli/        # Typer commands — user-facing, delegates to client
    client/     # Async HTTP client built from mixins
    models/     # Pydantic v2 models for input validation
tests/          # pytest integration tests (respx mocks)

Client mixin pattern: WealthboxClient inherits from resource mixins (ContactsMixin, TasksMixin, EventsMixin, etc.) plus _WealthboxBase (core HTTP, rate limiting, error handling). To add a new resource, create a mixin and register it in client/__init__.py.

Rate limiting: Sliding-window (300 req / 5-min window); state persists across processes via ~/.wbox_rate_limit.json. 429 responses trigger automatic retry.


Development

# Install with dev dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Run a single test
pytest tests/path/to/test_file.py::test_name

Recommended local workflow

cd ~/.openclaw/workspace/integrations/wealthbox-cli

# Sync latest code
git pull

# Refresh editable install
.venv/bin/pip install -e .

# Run the read-only smoke test
./smoke_test.sh

Smoke test coverage:

  • wbox me
  • wbox users list
  • wbox contacts list --per-page 1

This is intentionally read-only and meant to catch:

  • token/config issues
  • CLI install issues
  • basic Wealthbox API access issues

See CONTRIBUTING.md for the full contributor guide.


Troubleshooting

401 Unauthorized — Check your API token.

Date format errors — Datetime fields expect ISO 8601 format: "YYYY-MM-DDTHH:MM:SS±HH:MM" or "YYYY-MM-DDTHH:MM:SSZ" (e.g. "2026-04-01T10:00:00-07:00"). Date-only fields (birth dates, etc.) use "YYYY-MM-DD".

Add/Update appears to succeed but nothing changed — Some category-constrained writes can silently no-op (return success while leaving fields unchanged). Verify by inspecting the returned JSON — add and update commands print the full object on success. Treat unchanged intended fields as a failed write. Before category-constrained writes, discover valid values first (e.g. wbox contacts categories contact-types).

contacts add examples no longer work if they use Person/Household/Organization/Trust as a positional argument — Use the new type-specific subcommands instead: wbox contacts add person|household|org|trust ....


Disclaimer

This is an unofficial, community-built tool. It is not affiliated with, endorsed by, or supported by Wealthbox or its parent company. "Wealthbox" is a trademark of its respective owner. Use of this tool is subject to the Wealthbox API Terms of Service.

This CLI wraps the Wealthbox API. Behavior depends on API version and your account permissions. Test destructive operations carefully.


License

Apache 2.0 — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wealthbox_cli-1.0.1.tar.gz (38.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wealthbox_cli-1.0.1-py3-none-any.whl (56.4 kB view details)

Uploaded Python 3

File details

Details for the file wealthbox_cli-1.0.1.tar.gz.

File metadata

  • Download URL: wealthbox_cli-1.0.1.tar.gz
  • Upload date:
  • Size: 38.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for wealthbox_cli-1.0.1.tar.gz
Algorithm Hash digest
SHA256 ec78561797192303f3e75958af4c9ad0f90d53a5d60e0b89c1ecb9194a978f77
MD5 d2ba44c620c8b5aba734da1e9ac9f9a9
BLAKE2b-256 5f561d028dd8e9146001119d5ca155fdef12d57f6c6be6292e7778d30c6362aa

See more details on using hashes here.

Provenance

The following attestation bundles were made for wealthbox_cli-1.0.1.tar.gz:

Publisher: ci.yml on massive-value/wealthbox-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file wealthbox_cli-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: wealthbox_cli-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 56.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for wealthbox_cli-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 56fd18bc2acc8f968dfb40ae06022dc1011dfbfbdcff75f3b53e6e2e011126e7
MD5 d91bf401e376da05feb7009be6976049
BLAKE2b-256 6d71c229dcc41784df498ab1958482a61bb6ba65c2bbf3f3f5488c50c3ca386b

See more details on using hashes here.

Provenance

The following attestation bundles were made for wealthbox_cli-1.0.1-py3-none-any.whl:

Publisher: ci.yml on massive-value/wealthbox-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page