foxmayn-frappe-cli

How to use the ffc (Foxmayn Frappe CLI) tool to interact with Frappe/ERPNext sites from the command line. Use this skill whenever the user mentions "ffc", wants to query, list, get, create, update, or delete Frappe documents, check Sales Invoices, look up customers, fetch Purchase Orders, run reports, call server methods, or do anything involving Frappe REST API operations from the terminal. Also trigger when the user wants to automate Frappe data retrieval, pipe Frappe data into scripts, inspect DocType schemas, or troubleshoot ffc connection issues.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "foxmayn-frappe-cli" with this command: npx skills add nasroykh/foxmayn_frappe_cli/nasroykh-foxmayn-frappe-cli-foxmayn-frappe-cli

Foxmayn Frappe CLI (ffc)

A command-line tool for interacting with Frappe/ERPNext sites via the REST API. Supports full CRUD on documents, schema introspection, report execution, and RPC method calls.

Quick Setup

ffc init        # interactive wizard — creates ~/.config/ffc/config.yaml
ffc config      # TUI to change default site, number/date formatting

Config file: ~/.config/ffc/config.yaml

default_site: dev
number_format: french   # french | us | german | plain
date_format: yyyy-mm-dd # yyyy-mm-dd | dd-mm-yyyy | dd/mm/yyyy | mm/dd/yyyy

sites:
  dev:
    url: "http://mysite.localhost:8000"
    api_key: "your_api_key"
    api_secret: "your_api_secret"

Generate API keys on the Frappe site: User > API Access > Generate Keys.

Managing Config from the Terminal

# Read settings
ffc config get              # styled table
ffc config get --json       # JSON
ffc config get --yaml       # YAML

# Write settings (validates values before saving)
ffc config set --default-site prod
ffc config set --number-format us
ffc config set --date-format dd/mm/yyyy
ffc config set --default-site prod --number-format french --date-format yyyy-mm-dd

Valid --number-format values: french (1 000 000,00), us (1,000,000.00), german (1.000.000,00), plain (1000000.00). Valid --date-format values: yyyy-mm-dd, dd-mm-yyyy, dd/mm/yyyy, mm/dd/yyyy.

Environment variable overrides (useful in CI — also work without a config file):

export FFC_URL="https://erp.company.com"
export FFC_API_KEY="your_key"
export FFC_API_SECRET="your_secret"

IMPORTANT: Always Use --json / -j

MANDATORY for AI/LLM usage: Always append --json (or -j) to every ffc command that supports it. The default table output is formatted for human reading and is not reliably parseable. JSON output is structured, complete, and easy to process.

Commands that support --json: list-docs, get-doc, create-doc, update-doc, count-docs, get-schema, list-doctypes, list-reports, run-report, ping. (call-method always outputs JSON regardless. delete-doc has no data output — --json is not applicable to either.)

# Always do this:
ffc list-docs -d "Customer" --json
ffc get-doc -d "Sales Invoice" -n "SINV-0001" --json

# Never do this (table output — hard to parse):
ffc list-docs -d "Customer"
ffc get-doc -d "Sales Invoice" -n "SINV-0001"

Commands

Global Flags

FlagShortDescription
--site-sSelect a site from config (default: default_site)
--config-cCustom config file path
--json-jOutput raw JSON instead of a table

Document Operations (CRUD)

ffc get-doc — Get a single document

ffc get-doc -d "Company" -n "My Company" --json
ffc get-doc -d "User" -n "jane@example.com" -f "name,email,enabled" --json
FlagShortRequiredDescription
--doctype-dYesFrappe DocType
--name-nYesDocument name (ID)
--fields-fNoFields to fetch: '["name","email"]' or name,email

ffc list-docs — List documents

ffc list-docs -d "User" -f "name,email,enabled" --limit 10 --json
ffc list-docs -d "ToDo" --filters '{"status":"Open"}' -o "modified desc" --json
FlagShortRequiredDefaultDescription
--doctype-dYesFrappe DocType to query
--fields-fNoallFields: '["name","email"]' or name,email
--filtersNoJSON filter: '{"status":"Open"}' or '[["status","=","Open"]]'
--limit-lNo20Max records to return
--order-by-oNoSort: "modified desc", "name asc"

ffc create-doc — Create a document

ffc create-doc -d "ToDo" --data '{"description":"Fix bug","priority":"Medium"}' --json
FlagShortRequiredDescription
--doctype-dYesFrappe DocType
--dataYesJSON object of field values

ffc update-doc — Update a document

ffc update-doc -d "ToDo" -n "TD-0001" --data '{"status":"Closed"}' --json
FlagShortRequiredDescription
--doctype-dYesFrappe DocType
--name-nYesDocument name (ID)
--dataYesJSON object of fields to update

ffc delete-doc — Delete a document

Prompts for confirmation unless --yes is passed.

ffc delete-doc -d "ToDo" -n "TD-0001" --yes
FlagShortRequiredDescription
--doctype-dYesFrappe DocType
--name-nYesDocument name (ID)
--yes-yNoSkip confirmation prompt

ffc count-docs — Count documents

ffc count-docs -d "Sales Invoice" --filters '{"status":"Unpaid"}' --json
FlagShortRequiredDescription
--doctype-dYesFrappe DocType
--filtersNoJSON filter expression

Schema & Introspection

ffc get-schema — View DocType field definitions

Shows all fields: fieldname, label, type, required flag, options, and default.

ffc get-schema -d "Sales Invoice" --json
FlagShortRequiredDescription
--doctype-dYesDocType to inspect

ffc list-doctypes — List available DocTypes

ffc list-doctypes --module "Accounts" --json
FlagShortRequiredDefaultDescription
--module-mNoFilter by module name
--limit-lNo50Max records to return

Reports

ffc list-reports — List available reports

ffc list-reports --module "Accounts" --json
FlagShortRequiredDefaultDescription
--module-mNoFilter by module name
--limit-lNo50Max records to return

ffc run-report — Execute a report

ffc run-report -n "General Ledger" --filters '{"company":"Acme","from_date":"2025-01-01"}' --json
FlagShortRequiredDescription
--name-nYesReport name
--filtersNoJSON object of report filter values
--limit-lNoLimit rows displayed (0 = all)

RPC

ffc call-method — Call a whitelisted server method

Always outputs JSON (flag not needed).

ffc call-method --method "frappe.ping"
ffc call-method --method "frappe.client.get_count" --args '{"doctype":"ToDo","filters":{"status":"Open"}}'
FlagShortRequiredDescription
--methodYesFrappe method path, e.g. frappe.ping
--argsNoJSON object of method arguments

Connectivity

ffc ping — Check connectivity

ffc ping --json
ffc ping --site production --json

Common Recipes

Pipe JSON into jq

ffc list-docs -d "Customer" -f "name,customer_name" --json | jq '.[].customer_name'
ffc count-docs -d "Sales Invoice" --filters '{"status":"Unpaid"}' --json | jq '.count'

Query across sites

ffc --site dev list-docs -d "Item" -f "name,item_name" --json > dev_items.json
ffc --site production list-docs -d "Item" -f "name,item_name" --json > prod_items.json

Scripting with ffc

for inv in $(ffc list-docs -d "Sales Invoice" -f "name" --json | jq -r '.[].name'); do
  ffc get-doc -d "Sales Invoice" -n "$inv" --json > "invoices/$inv.json"
done

Filter expressions

# Object style (simple equality)
--filters '{"status":"Open","docstatus":1}'

# Array style (operators: =, !=, >, <, >=, <=, like, in, between, is)
--filters '[["grand_total",">",1000],["status","=","Unpaid"]]'

Troubleshooting

ErrorCauseFix
authentication failed (401)Bad API key/secretRegenerate keys: User > API Access
permission denied (403)User lacks read accessCheck role permissions for the DocType
doctype "X" not found (404)Typo or module not installedVerify the DocType name on the site
no config file foundMissing configRun ffc init or set FFC_* env vars
site "X" not found in configWrong --site valueCheck site names in config.yaml

Config Precedence

  1. Config file (~/.config/ffc/config.yaml)
  2. FFC_* environment variables
  3. --site / --config flags

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

openclaw-version-monitor

监控 OpenClaw GitHub 版本更新,获取最新版本发布说明,翻译成中文, 并推送到 Telegram 和 Feishu。用于:(1) 定时检查版本更新 (2) 推送版本更新通知 (3) 生成中文版发布说明

Archived SourceRecently Updated
Coding

ask-claude

Delegate a task to Claude Code CLI and immediately report the result back in chat. Supports persistent sessions with full context memory. Safe execution: no data exfiltration, no external calls, file operations confined to workspace. Use when the user asks to run Claude, delegate a coding task, continue a previous Claude session, or any task benefiting from Claude Code's tools (file editing, code analysis, bash, etc.).

Archived SourceRecently Updated
Coding

ai-dating

This skill enables dating and matchmaking workflows. Use it when a user asks to make friends, find a partner, run matchmaking, or provide dating preferences/profile updates. The skill should execute `dating-cli` commands to complete profile setup, task creation/update, match checking, contact reveal, and review.

Archived SourceRecently Updated
Coding

clawhub-rate-limited-publisher

Queue and publish local skills to ClawHub with a strict 5-per-hour cap using the local clawhub CLI and host scheduler.

Archived SourceRecently Updated