ann_router.cli module
The ann-router command line, built with click.
The one command-line surface. It used to be the optional twin of an argparse
CLI; the two were kept in lock-step by hand, and a flag naming the parsing
library (ann-router-click) described the implementation rather than the
interface. Both are gone: click is now a core dependency and this module
is the whole CLI. Every command still delegates to the shared
ann_router._core_cli, which is what the API and MCP doors also call,
so no door can answer differently from another.
Consumes: click, ann_router._core_cli, os_helper.
Produces: main() (the ann-router console-script entry point,
wrapping cli()).
Author: Warith Harchaoui <warithmetics@deraison.ai>
- ann_router.cli.capabilities_cmd()
List backends, availability and capabilities.
- Return type:
None
- ann_router.cli.main()[source]
Console entry point (
ann-router).click’s own dispatch only special-cases
ClickException/Abort(and a broken pipe); a plain library exception (e.g.Criteria.validate()’sValueError) would otherwise propagate as a raw Python traceback instead of a clean CLI error. This wraps the whole invocation and translates that last case into a one-line stderr message + exit 1 – click’s own control flow (usage errors,--help, an explicitsys.exitin a subcommand) already raisesSystemExit, aBaseExceptionthis does not catch, so it passes through untouched.- Return type:
None