• Sign In



  • Categories

    Extension Details



    Readme

    Kirby Completions for Nova

    Static PHP and YAML completions for Nova, generated from the Kirby CMS reference. Version 2 targets Kirby 6.

    What's included

    • Kirby template helpers such as page(), snippet(), and kirby()
    • Kirby's bundled icon names after an icon: key in YAML blueprints
    • Kirby 6 field types such as pagelist, filelist, and buttons after type: keys in YAML. Nova can offer these values in other YAML files as well.
    • Contextual methods for documented variables such as $page->, $site->, $file->, and $field->
    • Kirby 6 PHP field suggestions from your project's YAML blueprints
    • Static methods such as Str::, Html::, F::, and A::
    • Documented Kirby class names after new
    • Support for Nova's PHP syntaxes, including PHP blocks embedded in HTML
    • Support for plain and quoted icon values in Nova's built-in yaml syntax

    Package and install

    Run the packaging command from the project root.

    npm ci
    python3 Tools/package_extensions.py
    

    This creates dist/Kirby 6.novaextension and dist/Kirby 5.novaextension. Use --output-dir with a fresh directory to build another copy.

    Enable extension development in Nova, then activate the bundle that matches your project. For example, to load Kirby 6 locally:

    nova extension activate "dist/Kirby 6.novaextension"
    

    In Nova's Extensions Library, use the Installed tab to enable one Kirby completion bundle at a time. Deactivate a development bundle from the Extensions menu before testing the other one.

    With Kirby 6 enabled, try typing sta in PHP and $page->gua in a Kirby template. In a YAML blueprint, try icon: finger, type: pag, and "type": "file. With Kirby 5 enabled, try snippet, $page->child, and icon: home. Field-type suggestions from this extension are available in the Kirby 6 bundle.

    In Nova, choose Editor → Show Completions and press Return to check what the selected suggestion inserts. The bundle initializes when Nova opens a PHP or YAML editor, so allow it to load before the first check.

    Blueprint fields in PHP

    Open the Kirby project folder in Nova. In site/templates/article.php, $page-> suggests content fields from site/blueprints/pages/article.yml. $site-> uses site/blueprints/site.yml in PHP files throughout the project. The extension also accepts .yaml files and picks up saved edits to blueprints and their local YAML mixins.

    You can select image (field) to insert $page->content()->get('image') when an image field shares its name with a Kirby method. The normal image() method remains available.

    The Kirby 6 bundle requests read-only filesystem access to read local YAML. Page field suggestions are tied to the matching template filename. Shared snippets, custom blueprint roots, and blueprints registered in PHP are outside this version's scope.

    Update from the Kirby reference

    Generator uses Python's standard library:

    python3 Tools/generate_completions.py
    

    For offline generation, save source pages and pass them to the script:

    python3 Tools/generate_completions.py \
      --reference-input reference.html \
      --objects-input objects.html \
      --fields-input fields.html
    

    The generated XML remains available for standalone use. The packaged bundles read the same catalog through Nova's completion assistant API. Methods are offered after the corresponding variable or static class prefix.

    Release Notes

    Version 2.1.0

    • Complete Kirby 6 page and site field names in PHP from local YAML blueprints, including reused definitions and fields that overlap native methods.

    Version 2.0.1

    • Register completions through Nova's completion assistant API when packaging the catalog.
    • Match Nova's embedded PHP syntax in the bundle and offer methods immediately after PHP method operators.

    Version 2.0.0

    • Refresh PHP completions and YAML icons for Kirby 6.0.0.
    • Add Kirby 6 blueprint field-type completions in YAML.

    License

    MIT License

    Copyright (c) 2026 Scott Boms

    Permission is hereby granted, free of charge, to any person obtaining a copy
    of this software and associated documentation files (the "Software"), to deal
    in the Software without restriction, including without limitation the rights
    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    copies of the Software, and to permit persons to whom the Software is
    furnished to do so, subject to the following conditions:

    The above copyright notice and this permission notice shall be included in all
    copies or substantial portions of the Software.

    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
    SOFTWARE.