The cli tool groff
must be installed this package to work,
e.g. on MacOS:
brew install groff
> json_function_schema, schema_arguments = man_schema(</path/to/man_file>)
json_function_schema
can then be passed to tools which use JSON schemas
to specify functions.
schema_arguments
can be used to take a tool call dictionary and return
the CLI arguments to run (e.g. via subprocess.run
):
> json_function_schema, schema_arguments = man_schema(</path/to/ssh_man_file>)
> tool_call = { "destination": "user@example.org", "4": True, "E": "/tmp/log", "A": False, }
> get_cli_args(tool_call, schema_arguments)
['-4', '-E', '/tmp/log', 'user@example.org']