r/ada • u/_Heziode • 9h ago
New Release Aclida: a full-featured command-line framework for Ada, aiming at SPARK proof (work in progress, feedback welcome)
Hi all,
I've just made Aclida public: https://github.com/adarium-labs/aclida I've been working alone on it, in my spare time, since May 2025 (a year and a half now 😱).
Why. Ada/SPARK keeps losing ground partly because the building blocks are missing (it's my PoV). Rust rewrote coreutils and sudo; I'd like to do something similar in Ada, but a real tool needs a serious CLI layer first. So I started with one. The name is CLI set inside Ada: a·CLI·da.
What it is. A CLI framework for Ada, inspired by Clap (Rust), Cobra (Go), Click (Python), picocli (Java) and optparse-applicative (Haskell), designed for Ada/SPARK. You declare an argument once and read its typed value through the same handle (no lookup by name).
What it does today:
- constrained integer, float, enumeration, fixed-point and string values checked by the parser;
- sub-command trees, aliases, inheritable options, hooks;
- relationship rules (requires, conflicts, conditions on values) with diagnostics that point at the command line, rustc-style;
- "did you mean?" for commands and values;
- generated help, shell completion (Bash, Zsh, Fish, PowerShell), man/Markdown pages, i18n.



Two features I'm particularly happy with:
- Shortcuts.
app cg database.urlis rewritten toapp config get database.urlbefore parsing, so the command tree stays untouched. Diagnostics are drawn on the expanded command line and a note names the shortcut, so users see what was actually run. Providers are pluggable (in memory, file-backed with your own format, or custom). It is inspired by the shortcus system of Alire. - Shell completion. Bash, Zsh, Fish and PowerShell, plus your own shell backends. The script calls the program back on each TAB, so suggestions come from the live command tree: commands, inherited options, allowed enum values.


Env vars can be prefixed per application (MYAPP_PORT) or declared by their exact name (NO_COLOR).
Where it is going. The goal for 1.0.0 is that libs/cli is formally proved with SPARK: absence of run-time errors, with the few non-SPARK boundaries listed and justified. It is not there yet (127 unproved checks at last count): no release, the API will still change, and the crates are not in the Alire index. You can build from a clone (see "Building from a clone" in the README).
Around it, the repo already holds early crates for styling, text wrapping and terminal output; a layout crate is a skeleton. The long-term target is a meta-framework (think Rich, Spectre.Console or Ratatui for Ada): components, interactive prompts, then a TUI. That comes much later.
An open question: string types. Aclida is built on anystrings, a small library of mine that lets the user pick the string type at build time (Unbounded_String, wide strings, UXStrings, VSS). It was meant to avoid forcing one string type on every user, but it costs a lot: five backends to test, backend-specific bugs (one backend counts UTF-8 bytes, others code points), a stack overflow under VSS from large records, a quadratic slowdown on UXString that took a storage change to fix, and more trusted code for the proof. The alternative is to commit to Wide_Wide_String, manage code points and encodings myself, and convert at the API edge. Has anyone been through this trade-off in a SPARK project? Would you use a library that only supports one string type?
I'd especially like opinions on:
- the API ergonomics (declaring commands, reading values, writing rules);
- the diagnostics: are they readable, is something missing?
- the SPARK approach and where the proof boundaries sit;
- the string-type question above;
- anything that would stop you from using it in a real tool.
Issues are open; pull requests are limited to collaborators (me) for now. Thanks!
The workflow behind it. Along the way I built an agentic development workflow, not specific to Aclida but grown out of working on it. It starts from what you want (a PRD or similar) and goes through requirements (HLR, LLR) and a technical design, then loops:
- the specifications are written first, as Ada
.adsfiles, with no bodies; - tests are written from the requirements and those specs; the test agent is not allowed to read implementation bodies (and for a new feature there are none yet), so the first run is expected red;
- the implementation then loops against the tests until they pass (red, green, refactor);
- SPARK proof, coverage and an independent fresh-context review close the loop. Each task ends on mechanical oracles (build, tests, traceability, proof), not on an agent saying it is done.
For the requirements-to-proof traceability I integrated AdaCore's GNAT Foundry: Intersection (https://github.com/AdaCore/gnat-foundry-intersection) where it did the job better than mine, and kept my own tasks for the parts it was missing. I plan to publish the workflow later as a separate kit, ready to drop into any AI harness.
Disclaimer: I used AI for the dev process. I started with ideas and building blocks by hand, but a substantial part of the code (~45k LoC currently) was written with AI (mainly Claude Code with Opus, Sonnet and Haiku, plus OpenCode/Pi/OMP with DeepSeek V4.1 Flash). This journey deserves its own article: there's so much to say about it.
Other libs that I wrotte as other building block for this project:
1
u/_Heziode 9h ago
ping u/MonospaceMentor 👆 Still no V1, but open, so you can take a look