Getting started

Quickstart

One page, one config file, two commands. Five minutes.

  1. Install

    
                                            npm install -D @kirigami/cli
                                        
  2. Add a kirigami.yaml

    At the root of your project:

    
                                            kirigami:
                                              project:  My Site
                                              baseurl:  https://example.com
                                              root:     src
                                            
                                            prepros: {}
                                        

    prepros: {} — even empty — is what turns on the PHP → HTML compiler for every _*.php file under root.

  3. Write a page

    src/_index.php:

    
                                            /**
                                             * @title Home
                                             */
                                            
                                            echo '<h1>Hello, Kirigami.</h1>';
                                        

    A file named _name.php compiles to name.html in the same folder — _index.php becomes index.html.

  4. Serve it

    
                                            npx kiri serve
                                        

    Rebuilds src/index.html every time you save, serves src/ at http://127.0.0.1:4321, and reloads the open tab once the rebuild finishes — nothing to open by hand. (kiri watch does the same rebuild with no server, if that's all you need.)

  5. Ship it

    
                                            npx kiri export
                                        

    Writes a fully static, dependency-free site into dist/ — ready for GitHub Pages or any static host.


That's the whole loop. For a site with more than one page, real content, styling and a deploy workflow, the full tutorial builds one from scratch, one concept at a time.