npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@manfred-kunze-dev/dolibarr-cli

v0.1.0

Published

CLI for the Dolibarr ERP/CRM REST API

Readme

Dolibarr CLI

A command-line interface for the Dolibarr ERP/CRM REST API.

The command tree is built from your instance's own API description, so the CLI shows exactly the modules that instance exposes — including endpoints from custom modules you wrote yourself.

Install

npm install -g @manfred-kunze-dev/dolibarr-cli

Also available as doli.

Quick start

# Base URL must end in /api/index.php
dolibarr auth login --base-url https://erp.example.com/api/index.php --api-key <key>

# Fetch this instance's API description and build the command tree
dolibarr sync

# See what this instance actually exposes
dolibarr modules

dolibarr thirdparties list --limit 10
dolibarr invoices get 42

Get an API key from Dolibarr under Setup → Users & Groups → user → API key.

Until you run sync, only the built-in commands (auth, context, config, sync, modules, api) exist — there is nothing to derive module commands from yet.

Why sync?

Dolibarr only registers a REST endpoint when its module is enabled, so no two instances expose the same API. Two real examples measured during development: one exposes 30 modules and 428 operations, another 38 and 440 — and neither is a subset of the other. A hardcoded command tree would misrepresent both, so the CLI reads the instance instead.

Re-run sync after enabling or disabling modules, or after a Dolibarr upgrade.

Working with several instances

Contexts work like kubectl's, which matters if you operate Dolibarr for more than one customer.

dolibarr context create acme --base-url https://acme.example.com/api/index.php --api-key <key>
dolibarr context use acme
dolibarr sync            # each context caches its own command tree
dolibarr context list

Reading and writing data

# Server-side filtering with Dolibarr's own filter syntax
dolibarr thirdparties list --sqlfilters "(t.nom:like:'ACME%')"

# Narrow the fields the server returns
dolibarr thirdparties list --properties id,name,email

# Choose table columns locally
dolibarr invoices list --columns ref,total_ttc,date

# Create: --set repeats, dot paths nest, --data takes JSON or @file.json
dolibarr thirdparties create --set name="ACME GmbH" --set client=1
dolibarr thirdparties create --data @acme.json --set name="Override"

# Custom fields land in array_options
dolibarr thirdparties create --set name="ACME" --extrafield colour=red

Dolibarr create/update endpoints accept any property of the underlying record, so the CLI does not restrict which fields you may send. Fields that are mandatory on create are checked locally first, giving an immediate error instead of a server round trip.

Anything not covered

api reaches any endpoint directly — useful for a path a stale manifest does not know about:

dolibarr api GET /status --json
dolibarr api POST /thirdparties --data '{"name":"ACME"}'

Global options

| Flag | Description | |---|---| | --api-key <key> | Override the API key | | --base-url <url> | Override the base URL (must end in /api/index.php) | | --entity <id> | Entity id for multi-company instances (DOLAPIENTITY) | | --timeout <seconds> | Request timeout, default 60 | | --json | Raw JSON on stdout | | --no-color | Disable colour |

Global options work before or after the subcommand. Two Dolibarr endpoints have their own query parameter named entity, which is exposed as --query-entity so it stays distinct from the global --entity.

Deletions prompt for confirmation. Pass --yes to skip it; without a terminal, --yes is required rather than assumed.

Configuration resolves in this order: CLI flags → environment (DOLIBARR_API_KEY, DOLIBARR_BASE_URL, DOLIBARR_ENTITY) → a .dolibarr JSON file in the working directory → the active context.

Scripting

--json prints unmodified JSON on stdout; warnings and errors always go to stderr, so pipelines stay clean. Commands exit non-zero on failure.

dolibarr thirdparties list --properties id,email --json | jq -r '.[].email'

One Dolibarr quirk worth knowing when scripting: list endpoints return a bare array with no total count, so the CLI reports only what it received and never invents a total. Paginate with --limit and --page until you get a short page.

Custom modules

Endpoints from your own Dolibarr modules appear automatically — run sync after enabling the module. Nothing needs to be added to this CLI. The command group is named after the module's API class, so a class WidgetsApi becomes dolibarr widgetsapi.

Supported Dolibarr versions

Three majors at a time: previous, current, next — currently 22, 23 and 24 (develop). When a new major ships stable the window rolls and the oldest is dropped. Other versions may well work, since the CLI adapts to whatever the instance reports, but they are not tested.

Local development

npm install
npm run build

docker compose --profile current up -d    # Dolibarr 23 on http://localhost:8023
npm run test:run                          # unit + contract tests
npm run test:unit                         # unit only, no Docker needed

The compose stack provides all three supported versions (--profile previous|current|next|all), each seeded with the API module enabled and a fixed dev API key, so no UI clicks are needed.

Contract tests create and delete records. They refuse to run against a non-local target unless DOLIBARR_ALLOW_CONTRACT_TESTS=1 is set, and skip cleanly when no instance is reachable.

Licence

Proprietary.