Repository navigation
Add the headless print engine: rotula CLI and REST API - #13
Merged
Merged
Conversation
rotula.exe prints .rotula labels without the designer, for scripts and warehouse systems, through the app's own print path (DPI conversion, darkness/speed, variables, questions, data merge, serial numbers used once). - rotula print / status / printers with JSON output and exit codes - rotula serve: REST API (/api/v1/jobs, printer status and lists, OpenAPI), API keys stored as SHA-256 hashes, label-folder and printer allow-lists, size limits, strict settings and request bodies, Windows service hosting - ~HS status check before every job and verification after the last; one job at a time per printer - PrintEngine policy (ADMX/ADML) to switch it off - 52 new strings in en, es, pt-BR and fr-CA - docs/print-engine.md, README, CHANGELOG, notices, deployment, decisions
The request path, reference and printer name are written to the audit log; control characters (CR, LF and others) now become spaces and long values are cut, so a caller cannot start a fake log entry.
The tests now also reference rotula.exe, which runs on ASP.NET Core, so the build leaves the Microsoft.Extensions.* files that framework provides out of the test folder. Rotula.Mcp.exe runs on plain .NET and could not start from there; the tests now use src/Rotula.Mcp/bin first.
…-4ng9io-print-engine
3 tasks done
glenntosco
added a commit
that referenced
this pull request
Oct 27, 2026
Add the headless print engine: rotula CLI and REST API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Glenn · project thread
What changed and why
This implements the top roadmap item: unattended printing for WMS, ERP and scripts, with the
~HSprinter status from #5.src/Rotula.Engine(net10.0 library, no UI). It turns a print request into a print through the app's own pieces:IPrintService,LabelPrintRun/VariableJob,PromptSet,LabelDpiConverterandPrinterSetup. Output is byte-identical to the designer's Print dialog and data merge.~HScheck before every job, and verification after the last one.SemaphoreSlimper queue or host:port).src/Rotula.Clibuildsrotula.exe:print:--setfor values,--datafor CSV, xlsx or JSON,--answer,--dry-run/--output,--json.status,printers,new-key,helpandversion.rotula serve, an ASP.NET Core minimal API:GET /api/v1/health,GET /api/v1/printers,GET /api/v1/printers/{name}/status,POST /api/v1/printers/status,POST /api/v1/jobs, and OpenAPI at/openapi/v1.json.X-Api-Keyor a Bearer header. They are stored only as SHA-256 hashes and compared in constant time...or UNC, and inline labels are off by default.127.0.0.1:9180by default and can run as a Windows service.counterFilesetting shares the designer's serial numbers with a service account.PrintEnginepolicy, in the ADMX and in the en/es ADML files, switches the engine off.Engine.*strings in en, es, pt-BR and fr-CA. The engine embeds the app's resx files, so there is one source of text.docs/print-engine.md.Not in this PR: adding
rotula.exeto the installer, MSI and release workflow. That is a follow-up, and the README says it is built from source for now.How it was tested
EngineTests.csandEngineCliTests.cs. They cover:serve --init,counterFile);Engine.*key in all four languages.dotnet build Rotula.sln -c Release -p:EnableWindowsTargeting=truegives 0 warnings and 0 errors.~HScheck over USB and over the network, and installing the Windows service withsc.exe.Checklist
🤖 Generated with Claude Code
https://claude.ai/code/session_01C3aU29K6sbAADYvWLjb7hB