Manage Odoo CRM from the command line. No UI needed.
A single bash script that talks to Odoo via XML-RPC. Manage users, contacts, CRM pipeline, follow-ups, modules, and OAuth — all from your terminal.
Works with Odoo 16, 17, and 18.
# Copy the script somewhere in your PATH
curl -o /usr/local/bin/odoo-cli https://raw.githubusercontent.com/Cooperation-org/odoo-cli/main/odoo-cli
chmod +x /usr/local/bin/odoo-cli
# Set your credentials
export ODOO_URL="http://localhost:8069"
export ODOO_DB="mydb"
export ODOO_API_KEY="your-api-key"
# Test it
odoo-cli statusOr create ~/.odoo-cli.conf:
ODOO_URL="http://localhost:8069"
ODOO_DB="mydb"
ODOO_API_KEY="your-api-key"- Bash
- Python 3 (uses only stdlib
xmlrpc.client— no pip installs) psycopg2andpasslib(only foruser-passwordcommand)
odoo-cli status # Check if Odoo is running
odoo-cli setup # Create custom fields for follow-up trackingodoo-cli user-list # List all active users
odoo-cli user-create "Jane" "jane@co.com" "s3cret"
odoo-cli user-password jane "newpass"
odoo-cli user-disable janeodoo-cli contact-list # List all contacts
odoo-cli contact-list "acme" # Search by name or email
odoo-cli contact-search "jane" # Detailed search (name, email, phone)
odoo-cli contact-create "Jane Doe" "jane@example.com"
odoo-cli contact-export # Export all contacts as JSON
odoo-cli contact-export "acme" # Export matching contacts as JSON
odoo-cli contact-tag "Jane" ally # Add a tag (creates tag if new)
odoo-cli contact-untag "Jane" ally # Remove a tagTrack when you last talked to someone and when to follow up. Requires CRM module and odoo-cli setup.
# Set a follow-up date — accepts YYYY-MM-DD, day names, month names, or +Nd
odoo-cli follow-up set "Jane" tuesday
odoo-cli follow-up set "Jane" april "wait for Q2 budget"
odoo-cli follow-up set "Jane" 2025-03-15 "send proposal"
odoo-cli follow-up set "Jane" +7d
# List all upcoming follow-ups, sorted by date
odoo-cli follow-up list
# Log when you last contacted someone (defaults to today)
odoo-cli contacted "Jane"
odoo-cli contacted "Jane" 2025-02-10odoo-cli module-list # List installed modules
odoo-cli module-list "sale" # Search modules
odoo-cli module-install crm # Install a moduleodoo-cli oauth-status # Show configured providers
odoo-cli oauth-setup <client_id> <client_secret> # Configure Google OAuthodoo-cli shell # Interactive Python shell with Odoo API| Variable | Default | Description |
|---|---|---|
ODOO_URL |
http://localhost:8069 |
Odoo server URL |
ODOO_DB |
odoo |
Database name |
ODOO_API_KEY |
— | API key (preferred auth method) |
ODOO_PASSWORD |
— | Admin password (fallback) |
ODOO_PYTHON |
python3 |
Python 3 interpreter path |
ODOO_CONF |
/etc/odoo/odoo.conf |
Odoo config file (for user-password) |
Config can be set as environment variables or in a config file. The script checks these locations in order:
./.odoo-cli.conf(current directory)~/.odoo-cli.conf(home directory)/etc/odoo-cli.conf(system-wide)
Uses Odoo's built-in XML-RPC API (/xmlrpc/2/common and /xmlrpc/2/object). No custom Odoo modules required. The setup command creates a custom field (x_last_contacted) on CRM leads for tracking contact dates.
The user-password command connects directly to PostgreSQL (requires psycopg2 and read access to the Odoo config file) because Odoo's XML-RPC API doesn't support password changes.
MIT