A command-line tool for Frappe/ERPNext development environment management
Project description
WS Frappe CLI
A command-line tool for Frappe/ERPNext development environment management.
Overview
WS Frappe CLI simplifies the setup, configuration, and management of Frappe/ERPNext development environments. It provides an intuitive command-line interface for common development tasks.
Features
- 🚀 Quick Setup: Initialize Frappe development environment with a single command
- 🌐 Site Management: Create and configure new sites interactively
- 📦 App Management: Install predefined or custom Frappe apps easily
- 🎨 Interactive Interface: User-friendly prompts and colored output
- ⚡ Efficient Workflow: Streamlined commands for common development tasks
Installation
From PyPI (Recommended)
pip install ws-frappe-cli
From Source
git clone https://github.com/whitestork-erp/ws-frappe-cli.git
cd ws-frappe-cli
pip install -e .
Quick Start
1. Setup Development Environment
Initialize a new Frappe development environment:
ws-frappe-cli setup
This command will:
- Create a Python virtual environment
- Install frappe-bench
- Initialize a new bench with Frappe
2. Create a Site
Create a new Frappe site:
ws-frappe-cli create-site
Follow the interactive prompts to configure your site.
3. Install Apps
Install Frappe apps on your site:
# List available predefined apps
ws-frappe-cli fetch-app --list-predefined
# Install a predefined app
ws-frappe-cli fetch-app --app-name erpnext
# Install a custom app
ws-frappe-cli fetch-app --app-name myapp --github-url https://github.com/user/myapp
Command Reference
ws-frappe-cli setup
Initialize Frappe development environment.
Options:
--project-name TEXT: Name of the project (default: current directory name)--frappe-version TEXT: Frappe version to install (default: v15.78.1)--python-path TEXT: Path to Python executable (default: python3)--force: Force setup even if virtual environment exists
Example:
ws-frappe-cli setup --project-name myproject --frappe-version v15.78.1
ws-frappe-cli create-site
Create a new Frappe site.
Options:
--site-name TEXT: Name of the site to create--admin-password TEXT: Administrator password--db-name TEXT: Database name--db-port TEXT: Database port (default: 3306)--db-root-username TEXT: Database root username (default: root)--db-root-password TEXT: Database root password--set-default: Set this site as the default site--install-apps: Install apps after site creation--apps TEXT: Specific apps to install (can be used multiple times)--no-interactive: Skip interactive prompts
Example:
ws-frappe-cli create-site \\
--site-name mysite.localhost \\
--admin-password mypassword \\
--set-default \\
--install-apps \\
--apps erpnext
ws-frappe-cli fetch-app
Fetch and install Frappe apps.
Options:
--app-name TEXT: Name of the app to install--github-url TEXT: GitHub URL of the app--branch TEXT: Branch to install (default: develop)--site TEXT: Site to install the app on--list-predefined: List predefined apps available for installation--no-install: Only fetch the app, do not install on any site--force: Reinstall if app already exists
Examples:
# List predefined apps
ws-frappe-cli fetch-app --list-predefined
# Install ERPNext
ws-frappe-cli fetch-app --app-name erpnext
# Install custom app
ws-frappe-cli fetch-app \\
--app-name custom-app \\
--github-url https://github.com/user/custom-app \\
--branch main \\
--site mysite.localhost
Predefined Apps
The CLI comes with several predefined apps that can be installed easily:
- ERPNext: Enterprise Resource Planning
- HRMS: Human Resource Management System
- Payments: Payment Gateway Integration
- E-commerce Integrations: E-commerce Platform Integrations
Development Workflow
A typical development workflow with WS Frappe CLI:
-
Initialize Environment:
mkdir my-frappe-project cd my-frappe-project ws-frappe-cli setup
-
Create Development Site:
source env/bin/activate ws-frappe-cli create-site --site-name dev.localhost --set-default
-
Install Required Apps:
ws-frappe-cli fetch-app --app-name erpnext ws-frappe-cli fetch-app --app-name hrms
-
Start Development Server:
bench start
Configuration
Environment Variables
FRAPPE_CLI_DEFAULT_BRANCH: Default branch for Frappe (default: v15.78.1)FRAPPE_CLI_DEFAULT_PYTHON: Default Python executable (default: python3)
Config File
You can create a .frappe-cli.yaml file in your project root:
default_frappe_version: "v15.78.1"
default_python: "python3"
default_apps:
- erpnext
- hrms
Requirements
- Python 3.8+
- Git
- MariaDB/MySQL
- Redis
- Node.js (for building assets)
Troubleshooting
Common Issues
- Permission Errors: Ensure you have proper permissions for the directory
- Database Connection: Verify MariaDB/MySQL is running and accessible
- Python Version: Ensure you're using Python 3.8 or higher
Getting Help
- Check the documentation
- Report issues on GitHub
- Use
ws-frappe-cli --helpfor command-specific help
Contributing
Contributions are welcome! Please read our Contributing Guide for details.
Development Setup
-
Clone the repository:
git clone https://github.com/whitestork-erp/ws-frappe-cli.git cd ws-frappe-cli
-
Install in development mode:
pip install -e ".[dev]"
-
Run tests:
pytest
-
Run linting:
black src tests isort src tests flake8 src tests
License
This project is licensed under the MIT License - see the LICENSE file for details.
Changelog
See CHANGELOG.md for a list of changes and releases.
Credits
- Built for the Frappe Framework
- Inspired by the official bench tool
- Uses Click for the CLI interface
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ws_frappe_cli-0.3.0.tar.gz.
File metadata
- Download URL: ws_frappe_cli-0.3.0.tar.gz
- Upload date:
- Size: 20.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1fe740655ca9fec100c251b9638f3cde49dfdf96f8cd79b83192511320238a50
|
|
| MD5 |
af9cfb6a686f6e676927d7f06dc8dbe0
|
|
| BLAKE2b-256 |
169bf711844cbd4bec8d91a81bf617e795686ca87dd6cb6f4f6045555b9c1bde
|
File details
Details for the file ws_frappe_cli-0.3.0-py3-none-any.whl.
File metadata
- Download URL: ws_frappe_cli-0.3.0-py3-none-any.whl
- Upload date:
- Size: 17.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
09163089229ed70cdd0fe0cbc24e690a0f4168dbaded3ebc6329c961adc265ca
|
|
| MD5 |
35ca4b7f635b676bf4ae59bcbe204080
|
|
| BLAKE2b-256 |
ba10f205e73cca2d53ed016f470090ee562a994661681071a55a932947d8d141
|