Link Search Menu Expand Document

Puko CLI

Table of contents

  1. Available Commands
  2. Command Breakdown
    1. Setup
    2. Routes
    3. Generate
    4. Serve
    5. Tests
    6. Element
    7. CLI
    8. Help
    9. Version

The Puko Framework is bundled with a Command Line Interface (CLI) named Puko Console. This tool serves as a development helper to streamline your workflow. You can view all available commands by running:

php puko help

Available Commands

setup    Installation & Configuration
         [db]
         [secure]
         [auth] [name]
         [controller] [view/service] [name]
         [model] [add/update/remove] [name] [schema]
         
routes   Routing Management
         [view/service/console/list/error/lost] [add/update/delete/crud] [url]

generate Automatic Schema Generation
         [db]

serve    Start the development server on localhost
         [port]
         
tests    Run unit tests (Preview)

element  Generate or download view elements (Beta)
         <name> [add/download]
         
cli      Execute code directly from the console
         <router path>
         
help     Show the help menu

version  Show the console version

Command Breakdown

Setup

Routes

  • routes view: Refer to the View documentation.
  • routes service: Refer to the Service documentation.

Generate

The php puko generate db command creates database tables based on the model schemas defined in plugins\model.

Serve

You can run your Puko project without a standalone web server using the built-in development server:

php puko serve [PORT_NUMBER]

Tests

The php puko tests command is used to run all unit tests in your project. It automatically scans the tests/unit/ directory and executes test cases to verify your controller and model logic.

Element

The php puko element command allows you to manage modular view components. You can create new elements locally or download them from the official Puko elements repository.

Example usage:

php puko element download adminlte_description
php puko element add user_profile

For more details, see the Elements section.

CLI

The php puko cli [ROUTE_URL] command allows you to execute controllers directly from the command line, which is useful for background tasks and automation.

Help

Displays the full list of available commands and their usage.

Version

Displays the current version of the Puko Console: php puko version.