Overview
Thebench new-app command scaffolds a new Frappe application with the standard directory structure, boilerplate code, and configuration files needed to start developing a custom Frappe app.
Syntax
Arguments
The name of the app to create. Should be lowercase and use underscores for spaces (e.g.,
my_custom_app).Options
Do not initialize a Git repository for the app. By default, a Git repository is created and an initial commit is made.
This option is only available in Frappe v14 and later versions.
Usage Examples
Create a Basic App
Create a new app with default settings:- App Title (displayed in UI)
- App Description
- App Publisher
- App Email
- App License
Create App Without Git
Create an app without initializing Git:Non-Interactive Creation
While the command is interactive by default, you can prepare answers in advance by setting environment variables or using a script.What Gets Created
When you runbench new-app, the following structure is created in apps/[app_name]/:
Interactive Prompts
During app creation, you’ll be asked for the following information:App Title
The human-readable name displayed in the UI:App Description
A brief description of what your app does:App Publisher
Your name or organization name:App Email
Contact email for the app:App License
The software license (e.g., MIT, GPL-3.0, Proprietary):After Creation
After creating a new app, follow these steps:1. Install the App on a Site
2. Start Development
Create your first DocType, Page, or Module:3. Version Control
If Git was initialized, make your first changes and commit:Development Best Practices
Naming Conventions
- App Name: Use lowercase with underscores (e.g.,
library_management) - Module Names: PascalCase (e.g.,
Library Management) - DocType Names: PascalCase with spaces (e.g.,
Library Member)
Directory Structure
Organize your app with clear module separation:Dependencies
Add Python dependencies torequirements.txt:
package.json:
hooks.py Configuration
Thehooks.py file is the central configuration file for your app. Key configurations include:
Common Patterns
Creating a Standalone App
For an app that will be distributed:Creating a Site-Specific Customization
For client-specific customizations:Troubleshooting
App Name Already Exists
If an app with the same name exists:Permission Issues
Ensure you have write permissions in the bench directory:Related Commands
bench get-app- Install an existing app from a repositorybench install-app- Install an app on a sitebench remove-app- Remove an app from the benchbench build- Build app assets