Skip to main content

frappe-remote-cli

PyPI version Python License: MIT Tests

  ███████╗██████╗  █████╗ ██████╗ ██████╗ ███████╗     ██████╗██╗     ██╗
  ██╔════╝██╔══██╗██╔══██╗██╔══██╗██╔══██╗██╔════╝    ██╔════╝██║     ██║
  █████╗  ██████╔╝███████║██████╔╝██████╔╝█████╗      ██║     ██║     ██║
  ██╔══╝  ██╔══██╗██╔══██║██╔═══╝ ██╔═══╝ ██╔══╝      ██║     ██║     ██║
  ██║     ██║  ██║██║  ██║██║     ██║     ███████╗    ╚██████╗███████╗██║
  ╚═╝     ╚═╝  ╚═╝╚═╝  ╚═╝╚═╝     ╚═╝     ╚══════╝     ╚═════╝╚══════╝╚═╝

                     Frappe Remote CLI  ·  frappe-cli  ·  v0.1.9
              Query · Format · Merge · Automate — all via REST & MCP

A professional, feature-rich Python CLI and Model Context Protocol (MCP) server to query, inspect, and update remote Frappe sites directly from the terminal or your favorite AI agent.

Built with Python, Click, Requests, and Tabulate. Fully isolated, robustly tested, and developer-friendly.


Two Interfaces in One

┌─────────────────────────────────────────────────────────────────────┐
│                          frappe-cli                                 │
├──────────────────────────────┬──────────────────────────────────────┤
│   💻  TERMINAL CLI COMMANDS  │   🤖  MODEL CONTEXT PROTOCOL (MCP)   │
│                              │                                      │
│  config set/show/use/remove  │  doc_list / doc_get / doc_count      │
│  doc list/get/create/delete  │  get_schema / run_report / call_method│
│  doc count                   │  bulk_create / bulk_update / bulk_del│
│  bulk create/update/delete   │  stdio / background HTTP daemon      │
│  schema <doctype>            │  exposes all remote site tools to LLMs│
│  report <name>               │  seamless Cursor/Claude integration  │
└──────────────────────────────┴──────────────────────────────────────┘

Highlights

  • Multi-Profile Configuration Manager: Securely store connection credentials for multiple remote sites in ~/.frappe-cli.json (enforced with strict 0600 file permissions).
  • Regional Formatting Engine: Automatically formats date strings (us, french, german, plain) and float cells in terminal output tables on-the-fly.
  • Dynamic 3-Pass Schema Resolution: Fetches standard fields, splices in Custom Fields at their correct layout indices, and overrides Select dropdown choices using Property Setter data directly from the live database.
  • Sequential Client-Side Bulk Actions: Automate imports and mass deletions using JSON inline strings or @filepath references, featuring real-time spinner feedback and success tables.
  • Desk Reports in Terminal: Run server-side SQL query or script reports, zip matching columns, and output clean formatted tables.
  • Built-in PyPI Update Checker: Automatically checks for library upgrades once a day in the background, printing helpful upgrade instructions without slowing down commands.
  • Full Model Context Protocol (MCP) Server: Exposes 15 tools to AI coding agents (Claude Desktop, Cursor, etc.) via stdio or a detached HTTP/SSE background daemon.

Installation

# Install tool globally
uv tool install frappe-remote-cli

# Verify installation
frappe-cli --help

Globally via pipx or standard pip

# Using pipx
pipx install frappe-remote-cli

# Using standard pip
pip install --user frappe-remote-cli

Local Development

To set up a local virtual environment for development or custom builds:

git clone https://github.com/vanbaopham160-clnp/frappe-remote-cli.git
cd frappe-remote-cli
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"

Configuration

# Set up a new profile (runs an interactive step-by-step TUI wizard when connection details are omitted)
frappe-cli config set

# Set up a new profile with partial command line flags (prompts interactively for the missing ones)
frappe-cli config set --profile dev

# Set configuration with specific regional formatting layouts
frappe-cli config set \
  --site-url "https://my-frappe-site.com" \
  --api-key "ab12cd34ef56" \
  --api-secret "gh78ij90kl12" \
  --date-format french \
  --number-format german \
  --profile production

# List all configured profiles
frappe-cli config list

# Select default profile (presents a list of configured profiles interactively when no profile name is provided)
frappe-cli config use

# Select default profile explicitly
frappe-cli config use staging

# Show configuration details (prints text, JSON, or YAML)
frappe-cli config show
frappe-cli config show --format json
frappe-cli config show --format yaml

# Verify remote site connection diagnostic
frappe-cli config check

# Remove a connection profile (presents a list of configured profiles and a confirmation prompt when no profile name is provided)
frappe-cli config remove

# Remove a connection profile explicitly (bypasses safety confirmation prompts when in scripts/non-interactive environments)
frappe-cli config remove production

# Remove a connection profile explicitly and skip confirmation in interactive mode
frappe-cli config remove production -y

Supported Date Formats: plain (ISO default), us (MM/DD/YYYY), french (DD/MM/YYYY), german (DD.MM.YYYY)
Supported Number Formats: plain (1234567.89), us (1,234,567.89), french (1 234 567,89), german (1.234.567,89)


Usage Guide

1. Document CRUD Commands (doc)

Perform operations on individual document records. Toggle table output with --table / -t.

# List documents with filtering, field subsetting, and sorting
frappe-cli doc list Customer --fields "name,customer_name,creation" --table

# Get document count matching filters
frappe-cli doc count Customer -q '[["disabled", "=", "0"]]'

# Fetch specific document detail
frappe-cli doc get Customer CUST-0001 --table

# Create a new document record
frappe-cli doc create Customer -d '{"customer_name": "Alice", "customer_type": "Individual"}'

# Update fields on a document
frappe-cli doc update Customer CUST-0001 -d '{"phone": "+1234567890"}'

# Delete a document record
frappe-cli doc delete Customer CUST-0001

2. Client-Side Bulk Operations (bulk)

Create, update, or delete batches of documents sequentially with progress spinners.

# Bulk create from inline JSON
frappe-cli bulk create ToDo -d '[
  {"description": "Task A", "priority": "High"},
  {"description": "Task B", "priority": "Medium"}
]'

# Bulk create from a local JSON file path
frappe-cli bulk create ToDo -d @tasks.json

# Bulk update (each record must contain the 'name' field)
frappe-cli bulk update ToDo -d @updates.json

# Bulk delete by list of document names
frappe-cli bulk delete ToDo --names '["TD-0001", "TD-0002"]'

3. Server Reports Execution (report)

Execute whitelisted Frappe query or script reports.

# Run report with multiple key-value parameters and output table
frappe-cli report "Accounts Payable" \
  -p company "My Company" \
  -p report_date "2026-05-31" \
  --table

4. Live Schema Introspection (schema)

Query the live merged fields dictionary of a DocType.

# Display formatted fields schema table (standard + custom fields + property setters)
frappe-cli schema Customer --table

# Output complete raw JSON schema response
frappe-cli schema Customer --full

5. Remote RPC Execution (call)

Invoke whitelisted Python method APIs on the site:

frappe-cli call frappe.auth.get_logged_user --table
frappe-cli call my_app.api.calculate -p a 10 -p b 20

6. CLI Self-Upgrade (update)

Check for package updates and upgrade the local installation directly in place:

# Check if a new version is available on PyPI
frappe-cli update --check

# Upgrade the CLI to the latest version immediately (without confirmation prompt)
frappe-cli update --yes

Model Context Protocol (MCP) Server Setup

Bridge your Frappe sites to LLM environments seamlessly.

Stdio Transport Mode (Claude Desktop, Cursor)

Expose tools via standard input/output. Add the following to your claude_desktop_config.json:

{
  "mcpServers": {
    "frappe": {
      "command": "frappe-cli",
      "args": ["mcp", "start"]
    }
  }
}

Detached HTTP Daemon Mode

Run a persistent server in the background for remote HTTP SSE clients:

# Start background server daemon on port 8765
frappe-cli mcp start --transport http --port 8765 --detach

# Check daemon PID, port, logs, and uptime
frappe-cli mcp status

# Shut down the background process group cleanly
frappe-cli mcp stop

Daemon configuration and pid states are written to ~/.config/frappe-cli/mcp.json.


Running Tests

Run the full pytest suite (unit tests + request mocking):

# Run all tests
pytest

# Verbose test runner
pytest -v

Metadata

Release files for frappe-remote-cli 0.1.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for frappe-remote-cli 0.1.9
File Size Uploaded Provenance
frappe_remote_cli-0.1.9.tar.gz 32.2 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for frappe-remote-cli 0.1.9
File Interpreter ABI Platform
frappe_remote_cli-0.1.9-py3-none-any.whl Python 3 none any Details

Total release size: 59.4 kB

Release files / frappe_remote_cli-0.1.9.tar.gz

Download URL frappe_remote_cli-0.1.9.tar.gz
Size 32.2 kB
Tags Source
SHA-256 checksum
How to use checksums
ed94a1a4ec97b3cd76521d275aae409b1ef4e5fab51a5ee0d365d97361b22b1f
BLAKE2b-256 checksum
How to use checksums
7fe9a33733c58497581cc146e045e104937d1f5de317beea730de692164cb175
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 29, 2026.

Transparency log

Release files / frappe_remote_cli-0.1.9-py3-none-any.whl

Download URL frappe_remote_cli-0.1.9-py3-none-any.whl
Size 27.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9df9063ae30e30bafcf604ca80a29aacd25a3c36a976cdb564a3a7d5d62c9e90
BLAKE2b-256 checksum
How to use checksums
fa577403e923919c8998137e706bbe71e3d3969405b38c7690a3227df9f1194d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 29, 2026.

Transparency log

Security for frappe-remote-cli 0.1.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for frappe_remote_cli-0.1.9.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 29, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page