# cli


<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

## The tool registry

`TOOLS` is the single source of truth for what `slmn` can dispatch: a
name -\> function map. Adding a tool here (and, if you want it over MCP,
to the list in `03_mcp.ipynb`) is all it takes to wire it up – the
dispatcher below is generic.

## argv -\> function dispatch

[`main()`](https://drscotthawley.github.io/slmn/cli.html#main) looks the
tool up by name and hands the rest of `argv` to
[`_call_cli`](https://drscotthawley.github.io/slmn/cli.html#_call_cli),
which parses it against the function’s own type-hinted signature (via
fastcore’s `anno_parser`) – so each tool’s parameters *are* its
command-line flags, no per-tool arg-parsing code.
[`insert_cells`](https://drscotthawley.github.io/slmn/nbtools.html#insert_cells)
is the one special case: its `sources` argument is a list, which doesn’t
map cleanly onto flags, so those cells are read from stdin instead.

------------------------------------------------------------------------

<a
href="https://github.com/drscotthawley/slmn/blob/main/slmn/cli.py#L48"
target="_blank" style="float:right; font-size:smaller">source</a>

### main

``` python
def main():
```

*Entry point for the `slmn` console script: `slmn <tool> [args...]`.
Prints the tool’s return value (if any); tools themselves never print.*
