Skip to content
ochat
Search documentation

Use quotes for an exact phrase.

Search by topic, command, or code identifier.

    GitHub ↗

    mp-refine-run

    Generate or refine prompts with local and paid strategies, append behavior, and explicit boolean flags.

    View Markdown source ↗

    Use this command to generate prompt packs or refine an existing prompt/tool description. It offers local template generation, online prompt-factory work, and classic recursive meta-prompting—not a single fixed refinement strategy.

    With Ochat installed, write a task description in task.md:

    Terminal window
    mp-refine-run -task-file task.md -output-file generated-prompt.md

    The default strategy may call models and incur charges. To use the local template factory without model calls:

    Terminal window
    mp-refine-run -task-file task.md -meta-factory true -output-file local-pack.md

    Output is appended, not replaced, when -output-file is supplied. Use a fresh file for a separate result. Without that flag, output goes to stdout.

    FlagDefaultMeaning
    -task-file FILEAbsentTask description. Recommended; despite the help saying required, the parser accepts omission and uses empty task text.
    -input-file FILEAbsentExisting prompt to iterate; absence selects creation paths.
    -output-file FILEAbsentAppend result to this file; otherwise print it.
    -action generate|updategenerateAction supplied to the recursive flow.
    -prompt-type general|toolgeneralSelect general/tool behavior where the selected strategy distinguishes it.
    -meta-factory BOOLfalseLocal template factory; takes precedence over the other strategy flags.
    -meta-factory-online BOOLtrueEnable online factory strategy.
    -classic-rmp BOOLfalseDisable online factory mode; does not override -meta-factory true.

    These booleans take explicit true or false arguments.

    1. With -meta-factory true, call Prompt_factory.create_pack without an input file or iterate_pack with one. This is local template generation.
    2. Otherwise online mode is enabled only if -meta-factory-online true and -classic-rmp false.
    3. With no input file and online mode enabled, try Prompt_factory_online.create_pack_online with the GPT-5 model constructor. If it returns no result, fall back to the general recursive flow with online factory mode disabled.
    4. Other cases select Mp_flow.first_flow or tool_flow according to prompt type, passing the chosen online setting.

    For example, refine a tool description using the classic strategy:

    Terminal window
    mp-refine-run -task-file task.md -input-file draft-tool.md \
    -prompt-type tool -action update -classic-rmp true \
    -output-file refined-tool.md

    The binary does not expose a universal iteration, model, or spending-cap flag. Review the selected library strategy before automating paid runs. Invalid action/type values explicitly exit 1; parsing, file, or provider failures may also exit nonzero. There is no documented fixed 20,000-token truncation contract.