Skip to content

Fallback CLI

The CLI is a lightweight XML-RPC client (Node.js only, no Python). Use it when the MCP server cannot run in your environment, or for batch access from scripts. The MCP server remains the primary and most complete surface.

When to use it

  • You do not have python3 3.9+ available (on Claude Code with Docker, you can also use the MCP server as a container: see Local deployment).
  • You need scriptable/batch access from a terminal or pipeline.
  • A restricted environment where only Node is available.
  • Cowork, where the MCP server's tools do not load (see Where it works): the CLI can work when the session can run Node, reach your Odoo, and you can edit the CLI's .env yourself. Use a dedicated, least-privilege, short-lived API key. Not for Claude chat, which has no safe place to enter the key.

Installation

Inside Claude Code:

/odoo-tools:odoo-setup-cli

Requires Node.js 18+:

node --version   # 18+

If missing: nodejs.org (LTS), brew install node or apt install nodejs npm. The command installs the CLI in ~/.claude/tools/odoo-cli and creates a local .env there, readable only by your user, with placeholders.

This .env stores your credentials on disk

Unlike the MCP server (which does not persist secrets), the CLI does leave your credentials in ~/.claude/tools/odoo-cli/.env. The setup fills in the URL, database and login with you and leaves a placeholder for the API key (or the password): open the file in your own editor and paste the secret there yourself. Claude never asks for it in the chat. Keep the permissions it is created with (your user only, chmod 600), do not commit it to version control, and delete it when you stop using the CLI. See Security.

Usage

node ~/.claude/tools/odoo-cli/dist/cli.js <command> '<input-json>'

Example:

node ~/.claude/tools/odoo-cli/dist/cli.js contacts '{"limit": 1}'

Available commands

The CLI includes 13 commands geared toward the most common Odoo flows:

Command What it does
contacts Query contacts (res.partner)
invoices Query invoices
products Query products
stock Query inventory
subscriptions Query subscriptions
payments Query payments
account-lines Accounting lines
bank-journals Bank journals
bank-statements Bank statements
chart-of-accounts Chart of accounts
search Generic search by model/domain
fields Field introspection of a model
write Generic write (create/update)

Write

The write command modifies data. Just as in the MCP server, use a least-privilege Odoo user and review the operation. The CLI has no equivalent of Read-only mode, nor the MCP server's permission policy (v1.5.0): write always attempts the call, and only the Odoo user's rights limit it.

Parity with the MCP server

The CLI covers the frequent flows via XML-RPC, but does not include the full cross-version compatibility layer or the automatic model/field resolution of the MCP server. For cross-version work or Enterprise instances, prefer the MCP server.

XML-RPC on Odoo 19 and later

The CLI speaks XML-RPC. Odoo 19 deprecates /xmlrpc, and Odoo 22 and Odoo Online saas~21.1 remove it. On those versions use the MCP server, which moves to JSON-2 with an API key (see Compatibility).

Skill reference: /odoo-tools:odoo-setup-cli.