foley.cli#

The foley command-line interface (argparse, the verbs generated by cw).

Two kinds of command share one parser:

  • the verbs (#62): every verb of foley.agent.verbs.VERBS, the table MCP serves too, generated by cw from its signature and docstring, so a verb added there is a command here with no CLI code. Its result is printed as JSON; a dict argument (a timeline) is given as JSON; a result with "ok": false exits 1:

    foley find "The door creaked open in the storm." --territory US
    foley score "Rain on the roof." --no-commercial-ok
    foley generate "a glass shatters" --backend elevenlabs
    foley set-master '{"items": []}' --target-lufs -16
    
  • the commands written here, for what is not a verb (bulk corpora, folders, the agent kit, the evaluation harness):

    foley demo                       # offline ingest->search over the bundled fixture
    foley bootstrap [--rings 0,1] [--corpora fsd50k,foleyset] [--data-dir DIR]
                    [--accept-ai-restricted] [--no-commercial-filter]
    foley ingest PATH [--license ID] [--min-status warn|pass|fail] [--no-qc]
    foley ingest-library PATH [--root DIR] [--accept-ai-restricted] [--no-qc]
    foley search QUERY [-k N] [--commercial-ok]
    

Wired as the foley console entry point ([project.scripts]). Every command is a thin call into the library facade; the CLI only parses args and prints.

Module Attributes

RESERVED_VERB_PARAMS

the parser's own namespace keys (command its subcommand, func a written command's handler, _cw cw's).

Functions

add_verbs(parser[, verbs])

Add the CLI-enabled verbs of verbs (default: foley.agent.verbs.VERBS) to parser's subcommands, one command each (#62).

build_parser()

Build the foley argument parser: the commands written here, then the verbs.

main([argv])

Entry point for the foley console script.

foley.cli.RESERVED_VERB_PARAMS = frozenset({'_cw', 'command', 'func'})#

the parser’s own namespace keys (command its subcommand, func a written command’s handler, _cw cw’s).

Type:

Parameter names a verb may not take on the CLI

foley.cli.add_verbs(parser, verbs=None)[source]#

Add the CLI-enabled verbs of verbs (default: foley.agent.verbs.VERBS) to parser’s subcommands, one command each (#62).

Raises:

ValueError – If a verb’s command clashes with a written one, or it takes a parameter named in RESERVED_VERB_PARAMS.

Return type:

ArgumentParser

foley.cli.build_parser()[source]#

Build the foley argument parser: the commands written here, then the verbs.

Return type:

ArgumentParser

foley.cli.main(argv=None)[source]#

Entry point for the foley console script.

Return type:

int