Context command#
Usage:
zyn context [topic]
Commands:
application application overview (default)
routes [--path] [--method] route implementation map
database database sources and configuration
jobs registered jobs and schedules
notifications notification sources and transports
storage storage backends and references
testing tests and test configuration
build package and build imports
Read bounded application context without compiling, starting services, or writing project files.
Example:
zyn context database
Documentation: zyn docs cli/context
zyn context prints a bounded Markdown briefing for the current application. With no topic it prints the application overview. Focused topics combine project-specific configuration, source inventories, generated artifacts, and the relevant inspection, documentation, and verification commands.
The output is deterministic for a fixed working tree and Zyn release. Lists are sorted where source order is not meaningful and are limited to 20 entries before reporting the omitted count. Repository-controlled values are bounded and escaped inside Markdown code spans. Recursive source scans stop at fixed entry and byte budgets and report truncation.
The command uses static inspection only. It reads project files but does not synchronize the framework package, write .zyn metadata, compile the application, start PostgreSQL or another service, access credential values, or contact the network. Computed routes and unsupported registry shapes are reported as unavailable rather than compiled. Route-source failures include the source location, unsupported construct, and source line when static inspection can identify them. Literal mounted tables imported from local Zig files are inspected recursively using the same source rules and limits as zyn routes.
Route source map#
zyn context routes groups routes by handler implementation file. Each entry identifies the method and declared path, handler definition, registration location, enclosing mount locations, and inherited guards and hooks in declaration order, preserving guard/hook interleaving. Shared guards include their definitions and the selected routes using them. Global middleware is listed separately, in declaration order, with local handle definitions where resolvable. Middleware configuration values are not printed.
Handler, guard, hook, and middleware references follow local literal imports, constant aliases, re-exports, and named container declarations without evaluating Zig. Function definitions and registrations use project-relative file:line:column locations. Package imports, missing or symlinked source, computed references, cycles, and inspection limits are reported as unresolved; a resolvable route registration remains visible when its implementation cannot be located. Symbol inspection attempts at most 128 uncached files with a 16 MiB source-content budget and a 4 MiB per-file limit; reference walks stop at 64 steps, with one million expression/declaration visits across the command. Imports must stay within the project and cannot traverse symlink files or directories. Route context expansion stops after 16,384 route/mount entries or 64 nested table visits and reports the catalog as unavailable rather than returning a partial route map.
--path selects an exact effective declared route pattern, including mount prefixes and parameter names. It does not match request URLs or prefixes. --method selects a method case-insensitively and can be used independently. Filters can appear in either order and cannot be repeated. Empty selections are reported explicitly. Implementation groups and each nested list are bounded to 20 entries, with omitted counts and a reminder to focus omitted routes.
For example, locate the code for a mounted route with:
zyn context routes --path '/items/:id' --method GET
The map describes source declarations, not runtime reachability or access policy. An absence of declared route guards does not imply public access; middleware, hooks, CSRF handling, and handler code may also affect a request.
Textual source references identify Zig files containing topic-related public API tokens. They are orientation hints, not proof that a file participates in runtime behavior.