citomni/docs is the entry point for understanding, using and developing CitOmni as one framework. It holds the concepts, contracts and technical standards that span packages, and it leads to the documentation that each package and the guide trees own.
The documentation is being rewritten to follow the CitOmni Documentation Contract. The documentation from before the rewrite is kept at the tag pre-rewrite.
- Authority: Guidance
- Sources:
citomni/kernel:README.md;citomni/cli:README.md;citomni/demo-app:README.md - Verified:
citomni/kernel@6a62a7a(2026-11-29);citomni/cli@b6b7017(2026-11-29);citomni/demo-app@a5e01e0(2026-11-29)
Low overhead. High performance. Ready for anything.
CitOmni is a modular PHP framework for HTTP and CLI applications. Its core packages target PHP 8.5+ and are installed as Composer dependencies rather than copied into the application.
CitOmni is built around a straightforward premise. Framework code should do as little unnecessary work as possible while making the important decisions explicit. That means deterministic application boot, lean execution paths, lazy services, clearly owned side effects, and reusable capabilities that an application installs only when it needs them.
CitOmni provides a shared application model, separate HTTP and CLI runtimes, and focused packages for reusable technical capabilities. An application keeps its own source code and configuration, while the framework stays under vendor/. One application can run in both modes and share its Operations, Repositories, configuration and services, while its HTTP and CLI adapters stay separate.
CitOmni does not impose an ORM, a reflection-based dependency-injection container, a particular database schema or a mandatory business-domain hierarchy, and an application installs only the packages it needs. The framework's job is to make the application easier to structure and cheaper to run, not to conceal what the application is doing.
- Deterministic boot. Configuration, services, HTTP routes, and CLI commands come from explicit sources with defined precedence rules.
- No runtime discovery theater. No classpath scanning, reflection-driven autowiring, or implicit controller registration as part of normal dispatch.
- Small, independently useful packages. The shared kernel does not force an HTTP stack into a CLI application or a database layer into an image-processing job.
- Lazy, memoized services. Registered services are constructed when first accessed and reused within the same
Appinstance. - Compiled, OPcache-friendly maps. Configuration, services, routes, and commands can be prepared ahead of request handling.
- Explicit architectural ownership. Adapters handle transport, Operations orchestrate when needed, Repositories own SQL and datastore I/O, and Services provide registered, reusable capabilities.
- Fail-fast contracts. Missing service registrations and invalid definitions surface as errors instead of silently changing behavior.
- Performance and sustainability as design constraints. Avoid unnecessary CPU cycles, allocations, network calls, and filesystem operations; measure the result rather than assuming it.
- Works with ordinary PHP tooling. Composer, PSR-4, PHP CLI, supported PHP extensions, and conventional web servers remain the foundation.
The objective is not the smallest amount of source code at any cost. It is the smallest sensible amount of work and abstraction for the job.
Application (PSR-4 source, config, templates, state)
|
+-- HTTP delivery citomni/http
| +-- Routes, controllers, requests, responses
| +-- Templates, HTTP sessions, CSRF, cookies
|
+-- CLI delivery citomni/cli
| +-- Commands, arguments, output, exit codes
|
+-- Shared application behavior
| +-- Operations orchestration when justified
| +-- Repositories SQL and persistence
| +-- Registered Services reusable application-aware tools
| +-- Policies, State, Support, Utils focused responsibilities
|
+-- Reusable provider packages installed only as needed
| +-- Infrastructure, image, upload, jobs, AI, data integrations
|
+-- Shared application core citomni/kernel
+-- App, Cfg, service resolution, provider composition, cache mechanics
This is a responsibility map, not a mandatory call chain. A simple CRUD controller can call a Repository directly, and a transport-independent workflow with several steps can use an Operation. A layer is worth introducing only when it establishes a meaningful boundary or removes duplication. Each kind of class has one home and one set of rules: Where a class goes in the guide tree.
Three mechanisms hold the pieces together:
- Explicit registration, lazy resolution. A package contributes services, cfg, routes and commands through the constants of its
Boot\Registry, and the application lists the Registries it uses inconfig/providers.php. TheAppconstructs a registered service on first access and reuses it; an unknown service id fails instead of triggering discovery. Details: Service resolution and Providers and boot metadata in the kernel README. - Deterministic configuration and dispatch. Each mode composes its vendor baseline, the providers and the application's own config files in a fixed order, so the same sources always give the same cfg, services, routes and commands. Routes and commands are dispatch maps of their own, not part of cfg. The order is described in Merge model, how code reads cfg in Cfg Access, and how each mode boots in Runtime Modes.
- Compiled runtime maps. Each mode can load its cfg, services and dispatch map from prepared PHP files that OPcache keeps compiled. A cache file is used as it is until it is warmed again or cleared, so a deployment rebuilds it when providers, configuration, routes, commands or packages change: Cache operations in the citomni/cli README.
Resource efficiency is an architectural objective in CitOmni, not a separate feature: CPU time, memory, disk operations and network activity should go to application work rather than framework machinery. Lower latency, lower memory use, lower electricity consumption and lower emissions are different measurements, and none of them is a substitute for another. Green by Design describes the mechanisms, the coding discipline, how to measure, and what the 2025 capacity report does and does not show.
| You are | Start with | Then |
|---|---|---|
| New to CitOmni | What CitOmni is | Get started, then Runtime Modes |
| Writing an application | Get started | The guide tree citomni/demo-app and the README of each package you install |
| Writing a provider package | citomni/provider-skeleton | The guide tree citomni/demo-provider and contribute/ |
| Contributing to CitOmni | Contributing | contribute/ |
| An AI assistant | For AI assistants in the guide tree | Documentation Contract before writing documentation |
| Task | Read |
|---|---|
| Create an application | Get started |
| Follow one feature through all layers | The article example in citomni/demo-app |
| Write a file of a given kind | The guides for its path: Looking up a guide |
| Read cfg in code | Cfg Access |
| Understand boot, modes and caches | Runtime Modes |
| Understand why CitOmni has no DI container, ORM or autowiring | decisions/ |
| Run long work outside the HTTP request | citomni/jobrunner |
| Measure performance | Green by Design |
| Write tests | CitOmni Testing Guide |
| Write PHPDoc | CitOmni Code Documentation Guide |
| Write, move or remove documentation | CitOmni Documentation Contract |
| Find a package | The package catalog |
| Report a vulnerability | The security policy, not a public issue |
Every fact has one home, and the CitOmni Documentation Contract says which:
- The contract of a class or method: its PHPDoc.
- How each kind of file is written: the guide trees, citomni/demo-app for applications and citomni/demo-provider for packages, with tested reference code.
- What a package provides and how it is used: the package README, with long-form material in the package's
docs/. - Cross-package concepts, contracts and standards, and the way in: this repository.
- Governance and the package catalog: citomni/.github.
- What happens at runtime: the source. A document that disagrees with it is wrong, or the source has a bug.
- CitOmni Code Documentation Guide
- CitOmni Coding & Documentation Conventions
- CitOmni Documentation Contract
- CitOmni Testing Guide