Command Line Interface
You can use the Command-Line Interface (CLI) provided by Peachy to develop, build, and preview your project from a terminal window.
peachy commands
Section titled “peachy commands”Use the CLI by running one of the commands documented on this page with your preferred package manager, optionally followed by any flags. Flags customize the behavior of a command.
One of the commands you’ll use most often is peachy dev. This command starts the development server and gives you a live, updating preview of your site in a browser as you work:
# start the development servernpx peachy devpackage.json scripts
Section titled “package.json scripts”You can also use scripts in package.json for shorter versions of these commands. Using a script allows you to use the same commands that you may be familiar with from other projects, such as npm run build.
The following scripts for the most common peachy commands (peachy dev and peachy build) are added for you automatically when you create a project using the [create peachy wizard][./getting-started].
You can also add more scripts to this list manually for any commands you use frequently.
{ "scripts": { "dev": "peachy dev", "build": "peachy build", // example extra script "rebuild": "rm -rf dist && peachy build" }}This means that when you run npm run dev, it will execute the peachy dev command.
peachy dev
Section titled “peachy dev”This command will start the development server and start a live, updating preview of your application as you work.
Any changes you make to your application code will be automatically reflected in the running application, without needing to rebuild and restart the app.
peachy build
Section titled “peachy build”This command will build your application for production. After successful build, it will output the code to the dist directory.
To run the compiled application, you can use the gjs -m dist/index.js command.