A Python CLI tool for managing Frappe instances via REST API.
β MVP Complete! All core features implemented (Phases 1-4).
Ready for production use. Only polish/release tasks remaining (Phase 5).
See FINAL_STATUS.md for complete summary.
frappecli provides command-line access to Frappe Framework's REST API, enabling:
- CRUD Operations: Create, read, update, delete documents across all doctypes β
- File Management: Upload, download, and manage files (private by default) β
- Reports: Execute and export Frappe reports (JSON/CSV) β
- RPC Methods: Call custom server methods β
- Multi-Site: Manage multiple Frappe sites from one config β
# Add the tap
brew tap pasogott/tap
# Install stable release (recommended)
brew install pasogott/tap/frappecli
# Or install latest development version
brew install --HEAD pasogott/tap/frappecliUpdate to latest version:
# Stable: automatic updates with brew upgrade
brew upgrade frappecli
# HEAD: reinstall to get latest commit
brew reinstall --HEAD pasogott/tap/frappecligit clone https://github.com/pasogott/frappecli.git
cd frappecli
uv sync
uv pip install -e .Note: PyPI package not yet published. Will be available with v0.1.0 release.
Create ~/.config/frappecli/config.yaml:
sites:
production:
url: https://erp.company.com
api_key: your_api_key
api_secret: your_api_secret
staging:
url: https://staging.company.com
api_key: your_staging_key
api_secret: your_staging_secret
default_site: productionfrappecli site doctypes # List all doctypes
frappecli site doctypes --module "Core" # Filter by module
frappecli site doctypes --custom # Only custom doctypes
frappecli site info "User" # Get doctype details
frappecli site info "User" --fields # Detailed field list
frappecli site status # Site status & version
frappecli site status --detailed # With installed apps# List documents
frappecli doc list "User" --limit 10
frappecli doc list "ToDo" --filters '{"status": "Open"}'
# Get a document
frappecli doc get "User" "administrator@example.com"
# Create a document
frappecli doc create "ToDo" --data '{"description": "Review PR"}'
frappecli doc create "ToDo" --data @todo.json
# Update a document
frappecli doc update "ToDo" "TODO-001" --data '{"status": "Closed"}'
# Delete a document
frappecli doc delete "ToDo" "TODO-001"
frappecli doc delete "ToDo" "TODO-001" --yes # Skip confirmation# Upload file (private by default)
frappecli upload document.pdf
frappecli upload report.pdf --attach "Project" "PROJ-001"
frappecli upload logo.png --public --folder "Assets"
# Download file
frappecli download /files/document.pdf -o local.pdf
# List and search files
frappecli files list --folder "Home"
frappecli files search "invoice"
# Bulk upload
frappecli bulk-upload ./documents/*.pdf --folder "Reports"# List available reports
frappecli reports list
frappecli reports list --module "Accounts"
# Run a report
frappecli report "System Report" --filters '{"from_date": "2026-01-01"}'
frappecli report "Sales Report" --output report.csv
# Call custom RPC method
frappecli call frappe.client.get_count --args '{"doctype": "User"}'
frappecli call custom.method.name --args @params.json# Override config file location
export FRAPPECLI_CONFIG=~/.config/frappecli/config.yaml
# Site credentials (if not using config file)
export FRAPPE_URL=https://erp.example.com
export FRAPPE_API_KEY=your_api_key
export FRAPPE_API_SECRET=your_api_secretsites:
site_name:
url: https://frappe-site.com
api_key: ${FRAPPE_API_KEY} # Environment variable
api_secret: ${FRAPPE_API_SECRET} # Environment variable
default_site: site_name
# Upload defaults
upload:
default_private: true
default_folder: "Home"
auto_optimize_images: falseAll file uploads are private by default for security. Use --public flag explicitly:
frappecli upload sensitive.pdf # Private (default) π
frappecli upload marketing-asset.png --public # Public (explicit) π- Store API keys in environment variables
- Never commit API keys to version control
- Use separate keys for production/staging
- Rotate keys regularly
In Frappe UI:
- Go to User β API Access
- Generate API Key + API Secret
- Store securely in environment variables
Always use quotes for doctype and document names, especially with spaces:
# Correct β
frappecli get "User" "admin@example.com"
frappecli list "Email Queue"
frappecli upload file.pdf --attach "Custom DocType" "DOC-001"
# Wrong β (will fail)
frappecli get User admin@example.com
frappecli list Email QueueSwitch sites using --site flag:
frappecli --site staging list "User"
frappecli --site production upload file.pdfFrappe file system:
- Private files:
/private/files/(requires auth) - Public files:
/files/(no auth required) - Files are deduplicated by content hash
# Batch create users
cat users.json | jq -c '.[]' | while read user; do
frappecli create "User" --data "$user"
done
# Sync data between sites
frappecli --site production list "Custom DocType" --json > data.json
frappecli --site staging create "Custom DocType" --data @data.json
# Backup files
frappecli files list --json | jq -r '.[] | .file_url' | while read url; do
frappecli download "$url" -o "backup/$(basename $url)"
done# Export data for external processing
frappecli list "Sales Order" --filters '{"status": "Pending"}' --json > pending_orders.json
# Import processed data
frappecli bulk-upload ./processed/*.csv --folder "Imports"
# Webhook automation
frappecli call custom.webhook.handler --args '{"event": "order_received"}'Works with any Frappe app:
- ERPNext (business management)
- Healthcare (hospital management)
- Education (school management)
- Custom applications
# List doctypes from specific module
frappecli doctypes --module "Healthcare"
frappecli doctypes --module "Custom App"
# Work with app-specific doctypes
frappecli list "Patient"
frappecli get "Appointment" "APT-001"git clone https://github.com/pasogott/frappecli.git
cd frappecli
uv syncuv run pytest tests/ -v
uv run pytest tests/ --cov=frappecliuv run ruff check src/
uv run ruff format src/uv run frappecli --help
uv run frappecli doctypes# Verify credentials
curl -H "Authorization: token api_key:api_secret" https://site.com/api/method/frappe.auth.get_logged_user
# Check site configuration
frappecli sites# Test site connectivity
curl https://your-frappe-site.com/api/method/version
# Check site status
frappecli status- Check max file size:
frappecli call frappe.core.api.file.get_max_file_size - Verify file permissions
- Check disk space on Frappe server
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Add tests for new features
- Run
uv run pytestanduv run ruff check - Submit a pull request
See AGENTS.md for development guidelines.
MIT License - see LICENSE file for details.
- Frappe Framework
- Frappe Documentation
- Frappe API Documentation
- frappecli GitHub Repository
- Issue Tracker
pasogott - Pascal Schott
Note: This is a community tool and is not officially affiliated with Frappe Technologies.