/frappe-fullstack:frappe-bench <command> [--site <sitename>]from frappe-fullstack
Executes Frappe Bench CLI commands with site context and safety checks. Supports migrate, build, clear-cache, console, start, update, backup, restore, and more.
Ships in frappe-fullstack. Installing the plugin adds it to Claude Code.
Safely execute Frappe Bench CLI commands with proper site context and validation.
Parse the user's input: $ARGUMENTS
Common commands:
migrate - Run database migrationsbuild - Build JavaScript/CSS assetsclear-cache - Clear Redis cacheconsole - Open Python consolestart - Start development serverupdate - Update apps and migratebackup - Backup siterestore - Restore from backupFind the frappe-bench directory:
# Check if we're in a bench directory
if [ -f "sites/apps.txt" ]; then
echo "Bench directory found: $(pwd)"
else
# Try to find bench directory
find ~ -name "frappe-bench" -type d 2>/dev/null | head -3
fi
# List available sites
ls sites/ | grep -v "apps.txt\|common_site_config.json\|assets"
# Check default site
cat sites/currentsite.txt 2>/dev/null || echo "No default site set"
Based on the requested operation:
bench --site <sitename> migrate
Safety checks:
# Build all apps
bench build
# Build specific app
bench build --app <app_name>
# Build with verbose output
bench build --verbose
# Production build
bench build --production
bench --site <sitename> clear-cache
bench --site <sitename> console
# Example usage in console:
# >>> doc = frappe.get_doc("Customer", "CUST-001")
# >>> frappe.db.sql("SELECT * FROM tabCustomer LIMIT 5", as_dict=True)
bench start
Note: This will occupy the terminal. Use Ctrl+C to stop.
# Full update
bench update
# Update without backup
bench update --no-backup
# Update specific apps
bench update --apps frappe,erpnext
# Update without migrations
bench update --no-migrations
Safety checks:
# Basic backup
bench --site <sitename> backup
# With files
bench --site <sitename> backup --with-files
Output location: sites/<sitename>/private/backups/
bench --site <sitename> restore <path_to_backup.sql.gz>
# With files
bench --site <sitename> restore <backup.sql.gz> \
--with-private-files <private.tar> \
--with-public-files <public.tar>
Safety checks:
# Set admin password
bench --site <sitename> set-admin-password <newpassword>
# Add system manager
bench --site <sitename> add-system-manager <email>
# Enable/disable scheduler
bench --site <sitename> enable-scheduler
bench --site <sitename> disable-scheduler
# Show pending jobs
bench --site <sitename> show-pending-jobs
# Doctor - check site health
bench --site <sitename> doctor
# MariaDB console
bench --site <sitename> mariadb
# Export fixtures
bench --site <sitename> export-fixtures
# Run tests
bench --site <sitename> run-tests --app <app_name>
drop-site - Deletes entire sitereinstall - Drops and recreates databaserestore - Overwrites current datareset - Resets to fresh installBefore running on production:
For any command, check:
Common issues:
# Check available sites
ls sites/
# Rebuild environment
bench setup env
pip install -e apps/frappe -e apps/erpnext
# Check error logs
tail -100 logs/frappe.log
# Skip failing patches
bench --site <sitename> migrate --skip-failing
# Clear node modules and rebuild
rm -rf node_modules
yarn install
bench build
After command execution:
| Task | Command |
|---|---|
| Start dev server | bench start |
| Migrate database | bench --site <site> migrate |
| Clear cache | bench --site <site> clear-cache |
| Build assets | bench build |
| Backup site | bench --site <site> backup |
| View logs | tail -f logs/frappe.log |
| Python console | bench --site <site> console |
| MySQL console | bench --site <site> mariadb |
| Run tests | bench --site <site> run-tests |
| Check health | bench --site <site> doctor |
What the command file sets; muted values are Claude Code's defaults
7-day visitors to each command page
9 commands in this plugin
/frappe-appScaffold New Frappe AppCreate a new Frappe application with complete scaffolding including modules, hooks, and initial structure/frappe-doctype-createCreate Frappe DocTypeCreate a new Frappe DocType with complete scaffolding including JSON definition, Python controller, JavaScript client script, and tests/frappe-doctype-fieldManage DocType Fieldsnpx claudepluginhub unityappsuite/frappe-claude --plugin frappe-fullstackOther plugins' commands for the same job