Scaffolding Commands (Make)

The make commands generate boilerplate code and scaffold new files for your Stacks application.

Overview

buddy make:action       # Create a new action
buddy make:command      # Create a new CLI command
buddy make:component    # Create a new component
buddy make:model        # Create a new model
buddy make:migration    # Create a new migration
buddy make:notification # Create a new notification
buddy make:policy       # Create a new authorization policy
buddy make:resource     # Create a new API resource
buddy make:job          # Create a new job
buddy make:factory      # Create a new factory
buddy make:database     # Create a new database
buddy make:lang         # Create a new language file
buddy make:stack        # Create a new stack project
buddy make:view         # Create a new page/view
buddy make:function     # Create a new function
buddy make:certificate  # Create a new SSL certificate

Create Component

buddy make:component <name>

Creates a new Vue/Stacks component.

Options

OptionAliasDescription
--name-nThe name of the component
--project-pTarget a specific project
--verboseEnable verbose output

Example

buddy make:component HelloWorld
buddy make:component UserCard
buddy make:component Dashboard/Stats

Create Model

buddy make:model <name>

Creates a new database model with TypeScript types.

Options

OptionAliasDescription
--name-nThe name of the model
--project-pTarget a specific project
--verboseEnable verbose output

Example

buddy make:model User
buddy make:model Post
buddy make:model Comment

Create Migration

buddy make:migration <name>

Creates a new database migration file.

Options

OptionAliasDescription
--name-nThe name of the migration
--project-pTarget a specific project
--verboseEnable verbose output

Example

buddy make:migration create_users_table
buddy make:migration add_email_to_users
buddy make:migration create_posts_table

Create Action

buddy make:action <name>

Creates a new action file. Actions are reusable pieces of business logic.

Options

OptionAliasDescription
--name-nThe name of the action
--project-pTarget a specific project
--verboseEnable verbose output

Example

buddy make:action SendWelcomeEmail
buddy make:action ProcessPayment
buddy make:action GenerateReport

Create CLI Command

buddy make:command <name>

Creates a new CLI command that can be run with Buddy.

Options

OptionAliasDescription
--name-nThe name of the command
--signature-sThe command signature (CLI name)
--description-dThe command description
--no-registerDo not register in Commands.ts
--project-pTarget a specific project
--verboseEnable verbose output

Example

buddy make:command SendEmails
buddy make:command SendEmails --signature=send-emails
buddy make:command ProcessQueue --description="Process the job queue"

Create Notification

buddy make:notification <name>

Creates a new notification (email, SMS, or chat).

Options

OptionAliasDescription
--name-nThe name of the notification
--email-eIs it an email notification? (default: true)
--chat-cIs it a chat notification?
--sms-sIs it an SMS notification?
--project-pTarget a specific project
--verboseEnable verbose output

Example

buddy make:notification WelcomeEmail
buddy make:notification OrderShipped --email
buddy make:notification PasswordReset --sms

Create Policy

buddy make:policy <name>

Creates a new authorization policy for controlling access to resources.

Options

OptionAliasDescription
--name-nThe name of the policy
--model-mThe model this policy is for
--no-registerDo not register in Gates.ts
--project-pTarget a specific project
--verboseEnable verbose output

Example

buddy make:policy PostPolicy
buddy make:policy CommentPolicy --model=Comment

Create Resource

buddy make:resource <name>

Creates a new API resource for transforming model data.

Options

OptionAliasDescription
--name-nThe name of the resource
--model-mThe model this resource is for
--collection-cCreate a collection resource
--project-pTarget a specific project
--verboseEnable verbose output

Example

buddy make:resource UserResource
buddy make:resource PostResource --model=Post
buddy make:resource PostCollection --collection

Create Job

buddy make:job <name>

Creates a new background job for queue processing.

Options

OptionAliasDescription
--name-nThe name of the job
--queue-qThe queue to dispatch to (default: "default")
--class-cCreate a class-based job
--tries-tNumber of retry attempts (default: 3)
--backoff-bBackoff delay in seconds (default: 3)
--project-pTarget a specific project
--verboseEnable verbose output

Example

buddy make:job SendWelcomeEmail
buddy make:job ProcessPayment --queue=payments
buddy make:job GenerateReport --tries=5 --backoff=10

Create Database

buddy make:database <name>

Creates a new database.

Options

OptionAliasDescription
--name-nThe name of the database
--project-pTarget a specific project
--verboseEnable verbose output

Example

buddy make:database my-cool-database
buddy make:database analytics

Create Language File

buddy make:lang <locale>

Creates a new language/translation file.

Options

OptionAliasDescription
--name-nThe locale code
--project-pTarget a specific project
--verboseEnable verbose output

Example

buddy make:lang de      # German
buddy make:lang fr      # French
buddy make:lang es      # Spanish
buddy make:lang zh-CN   # Chinese (Simplified)

Create View/Page

buddy make:view <name>

Creates a new page/view component.

Aliases: buddy make:page

Options

OptionAliasDescription
--name-nThe name of the view
--project-pTarget a specific project
--verboseEnable verbose output

Example

buddy make:view home
buddy make:view about
buddy make:view dashboard/settings

Create Function

buddy make:function <name>

Creates a new function.

Options

OptionAliasDescription
--name-nThe name of the function
--project-pTarget a specific project
--verboseEnable verbose output

Example

buddy make:function hello-world
buddy make:function calculate-tax

Create Stack

buddy make:stack <name>

Creates a new Stacks project. This is similar to running bunx stacks new <name>.

Options

OptionAliasDescription
--name-nThe name of the stack
--project-pTarget a specific project
--verboseEnable verbose output

Example

buddy make:stack my-project
buddy make:stack my-awesome-app

Create Certificate

buddy make:certificate

Creates a new SSL certificate for local development.

Aliases: buddy make:cert

Example

buddy make:certificate

Create Queue Table

buddy make:queue-table

Creates the migration for the queue jobs table.

Options

OptionAliasDescription
--project-pTarget a specific project
--verboseEnable verbose output

Tips

Naming Conventions

  • Components: Use PascalCase (e.g., UserCard, DashboardStats)
  • Models: Use PascalCase singular (e.g., User, Post, Comment)
  • Migrations: Use snake_case with descriptive names (e.g., create_users_table)
  • Actions: Use PascalCase with verb (e.g., SendEmail, ProcessPayment)
  • Commands: Use PascalCase (e.g., SendEmails, ProcessQueue)

File Locations

Generated files are placed in their appropriate directories:

  • Components: resources/components/
  • Models: app/Models/
  • Migrations: database/migrations/
  • Actions: app/Actions/
  • Commands: app/Commands/
  • Notifications: app/Notifications/
  • Policies: app/Policies/
  • Resources: app/Resources/
  • Jobs: app/Jobs/