diff --git a/README.md b/README.md index d2b3bc4b..d2491cb6 100644 --- a/README.md +++ b/README.md @@ -134,9 +134,9 @@ Check the [`./features.md`](./features.md) for more details. - `-m`, `--model`: Specify Large Language Model to use. - `-f`, `--format`: Ask the LLM to format the response in a given format. -- `--format-as`: Specify the format for the output (used with `--format`). -- `-P`, `--prompt`: Prompt should include stdin and args. -- `-p`, `--prompt-args`: Prompt should only include args. +- `--format-as`: Specify the format for the output (used with `--format`, e.g. `mods -f --format-as json 'your prompt here'`). +- `-P=n`, `--prompt=n`: show the output with prompts from stdin, and only include the first `n` lines of prompt. +- `-p`, `--prompt-args`: show the prompt from args in the output. - `-q`, `--quiet`: Only output errors to standard err. - `-r`, `--raw`: Print raw response without syntax highlighting. - `-s`, `--settings`: Open settings. diff --git a/config.go b/config.go index d7d80196..e697421c 100644 --- a/config.go +++ b/config.go @@ -40,7 +40,7 @@ var help = map[string]string{ "role": "System role to use.", "roles": "List of predefined system messages that can be used as roles.", "list-roles": "List the roles defined in your configuration file", - "prompt": "Include the prompt from the arguments and stdin, truncate stdin to specified number of lines.", + "prompt": "Include the top n lines of prompt from the stdin in the response, where n is the specified number.", "prompt-args": "Include the prompt from the arguments in the response.", "raw": "Render output as raw text when connected to a TTY.", "quiet": "Quiet mode (hide the spinner while loading and stderr messages for success).", diff --git a/features.md b/features.md index 969255fc..89b6c68d 100644 --- a/features.md +++ b/features.md @@ -16,6 +16,12 @@ The most basic usage is: mods 'first 2 primes' ``` +```bash +mods --prompt 'first 2 primes' +``` + +In this case, the prompt will be printed in the output. + ### Pipe from You can also pipe to it, in which case `STDIN` will not be a TTY: @@ -26,6 +32,19 @@ echo 'as json' | mods 'first 2 primes' In this case, `mods` should read `STDIN` and append it to the prompt. +```bash +echo 'as json' | mods -P=1 'first 2 primes' +``` + +In this case, the first line of the prompt will be included in the output. + +```bash +mods -f --format-as json 'first 2 primes' +``` + +In this case, the prompt will include instructions to ask the model to return +json format results. + ### Pipe to You may also pipe the output to another program, in which case `STDOUT` will not