GUIDE / QUALITY AND DELIVERY

CLI and tooling

Scaffold, reload, validate, inspect generated output, and test application behavior.

Core janelkit Included with janelkit. Nothing extra to install.
CHAPTER 28 / 29~4 min read · try examples at your own pace
Alpha / 0.2 — These pages document JanelKit 0.2 and its packages. Each series (0.1, 0.2…) may change the public API, always with migration notes: see Changes and migration. The website uses Svelte; the desktop examples use Python and JanelKit, not JavaScript.

What you will learn

  • Choose the right command for development or diagnosis.
  • Distinguish parsing, compilation, startup checks and executable packaging.
  • Understand reload boundaries and preserve actionable diagnostics.

The everyday commands

janel new scaffolds a project and accepts --path DIR. janel dev optionally accepts a project folder. janel build validates every .janel file, including unused components, writes generated QML to build/qml by default, and exits with code 1 on compilation errors. build accepts -o DIR. janel migrate updates a project to the installed version of JanelKit: without --write it shows the changes as a diff, with --write it applies them, and with --tests it also updates your tests. Every command accepts --help. Build does not create an executable or installer.

janel build does not load the generated QML in Qt. It can succeed even when Qt rejects a color at startup. Follow it with a startup or mount check and application tests.

shell
janel new my-app
cd my-app
janel dev
janel build
janel compile src/App.janel
janel parse src/App.janel
janel migrate --write --tests
Copy

How it works

  1. new creates the application scaffold; dev runs the development edit loop.
  2. migrate moves a project to a new version, such as the lowercase elements and package imports of 0.2.
  3. build compiles all project components; compile and parse help isolate a single-file problem.

What you should see

The scaffold is created, dev runs the application, and build writes generated QML. None of these commands creates a standalone executable.

Common mistakes

  • Do not edit generated QML as application source or treat build success as proof of startup.

Diagnose source, not generated internals

Diagnostics include file, line, column, and suggestions when available. parse exposes the AST; compile exposes generated QML. Treat those outputs as debugging aids, not stable runtime interfaces.

janel dev reloads the view when you save a .janel file, in the same process, keeping the window's position and size and the state of every component whose script did not change: what was typed in a form, the page of a list. A component whose script changed starts from zero, and the console says which. Adding lines or styles does not lose state. Invalid edits show the errors in the console and in an error window, and keep the last working view open. Saving a .py or a .qml file of the project restarts the process. Reload does not preserve focus, text selection, or windows opened with open_window.

Choose the check for the failure stage

Use the smallest check that addresses your question, then widen validation. Passing an earlier stage does not prove the later stages work.

QuestionCommand or checkWhat it does not prove
Is the file structurally valid?janel parse src/App.janelElement names and runtime behavior
Can the component compile?janel compile src/App.janelQt startup or user interactions
Can every project component compile?janel buildQt startup, service results or packaging
Does the view load and respond?Headless mount and application testsNative desktop appearance or installer behavior
Does the distributed application work?Run the packaged application on each supported platformOther platforms you did not test

Learn moreTesting your application ↗Errors and troubleshooting ↗

Use explicit paths and keep output separate

The core CLI provides these command forms. Every command accepts --help; janel --version prints the installed framework version. CLI diagnostics and help are currently in Spanish. Packages can register additional commands, so inspect your installed help before assuming a plugin command exists.

shell
janel --version
janel --help
janel new my-app --path .
janel dev my-app
janel build my-app -o generated-qml
janel compile my-app/src/App.janel -o App.qml
janel parse my-app/src/App.janel
janel migrate my-app --write
Copy

Common mistakes

  • The destination passed to compile -o is a file; build -o takes a directory.
  • A successful command can still print warnings. Read stderr as well as the exit code.

Keep development, testing and distribution separate

A reliable release sequence compiles the project, runs application tests, launches the application, and then exercises the packaged artifact. janel build is the compilation step only. Distribution needs an external packager and explicit inclusion of application resources and the Qt runtime; the next section gives a recipe with PyInstaller.

  1. Use dev while editing; check the terminal when an update fails.
  2. Run build from a known project directory and read its warnings.
  3. Run python -m pytest in the application environment.
  4. Review the running application with keyboard and representative data.
  5. Verify the packaged artifact on each platform you actually support.

Learn moreTesting your application ↗Errors and troubleshooting ↗

Distribute an executable with PyInstaller

PyInstaller builds a folder with an executable that runs without Python installed. This recipe was tested on Windows 11 with Python 3.10, PySide6 6.8 and PyInstaller 6.22, packaging the files example of the repository; on Linux and macOS the steps are the same, with : instead of ; in --add-data. Run it from the project folder, the one with main.py and src, with the application's environment active. The result is dist/MyApp/: distribute the whole folder, the executable plus _internal/.

OptionWhy
--add-data "src;src"Copies the .janel files (and your own .qml) into the package. main.py looks for them in src next to itself, as in development.
--collect-data janelkitIncludes the Janel QML module and the other resources of the janelkit package.
--collect-submodules janelkitJanelKit imports parts of itself on demand; PyInstaller does not see them when it analyzes main.py.
--paths src + --hidden-import services.xModules imported only from your .janel files are invisible to PyInstaller: name them, one per module, so they are included with their dependencies.
--windowedNo console window on Windows and macOS. Leave it out while you test the package, to see errors.
shell
pip install pyinstaller

# Windows (";" separates --add-data). On Linux and macOS use "src:src" and \ for line breaks.
pyinstaller --noconfirm --windowed --name MyApp ^
  --add-data "src;src" ^
  --collect-data janelkit --collect-submodules janelkit ^
  --paths src ^
  --hidden-import services.storage ^
  main.py
Copy

Common mistakes

  • Check the package before shipping it: with QT_QPA_PLATFORM=offscreen and JANELKIT_EXIT_AFTER_MS=1500 the executable starts, mounts the view and exits by itself; exit code 0 means it worked, 1 that a .janel file, a module or a QML type is missing.
  • --onefile, a single executable, starts more slowly: it unpacks everything at each start.
  • Signing the executable and building installers (MSI, DMG, AppImage) are outside this recipe.

Key points

  • Use dev for the edit loop and build for project-wide compilation.
  • parse and compile expose different stages; neither is a complete application test.
  • Generated QML is output, not an executable or a stable application API.

English documentation based on the JanelKit source. For additional details, browse the source docs ↗.