Repository navigation
py-strictcli@v0.21.0
Command declaration framework: structured handler returns, programmatic invocation, typed args, config fields, compound types, tool export, MCP projection, and scope-based check filtering.
Context
This release transforms strictcli from a CLI framework into a command declaration framework with multiple output projections. Commands declared once can be invoked via CLI (existing), programmatic API (app.call/acall), tool export (as_tools with JSON Schema), and MCP server (--mcp flag).
Key additions: handlers can return structured data (backward compatible -- int returns still work), positional args gain type and choices support, first-class config fields with per-command binding and startup validation, compound types (list[T] and dict[str,T]), command visibility (hidden/interactive), schema enrichment with versioning and constraint serialization, and declarative scope field on check definitions with set_scope_adapter() for context-dependent pre-check filtering.
Features
- [strictcli] New feature. Programmatic invocation via
app.call()andapp.acall()withInvokeErrorexception for structured error handling. - [strictcli] New feature. Schema versioning with
schema_versionfield, constraint serialization (mutex, CoRequired, Requires, Implies), tag contracts, and arg defaults in--dump-schemaoutput. - [strictcli] New feature. Typed positional args with
type(str/int/float/bool) andchoicessupport, matching the flag type system. - [strictcli] New feature. Command visibility:
hiddenandinteractivedeclarations with help text filtering and schema serialization. - [strictcli] New feature. First-class config fields with
config_field()declarations, per-command binding, startup validation,config inittemplate generation, and unknown-key rejection. - [strictcli] New feature. Compound types
list[T]anddict[str, T]on flags and args with projection-specific CLI parsing. - [strictcli] New feature. Tool export:
json_schema(),as_tools(),Tooldataclass, and router tool for AI agent integration. - [strictcli] New feature. MCP projection via
serve_mcp()and--mcpflag for Model Context Protocol tool serving. - [strictcli] New feature. Optional
scopefield on check definitions for declarative pre-check context filtering, andset_scope_adapter()method on App for registering scope transformation callbacks.
Fixes
- [strictcli] Fix. Validate unknown kwargs and enforce required globals in passthrough invoke path.