Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: improve examples on several command line arguments. #310

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'`).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the other flags don't have example usages in their help, i think this should be somewhere else

Suggested change
- `--format-as`: Specify the format for the output (used with `--format`, e.g. `mods -f --format-as json 'your prompt here'`).
- `--format-as`: Specify the format for the output (used with `--format`).

- `-P=n`, `--prompt=n`: show the output with prompts from stdin, and only include the first `n` lines of prompt.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `-P=n`, `--prompt=n`: show the output with prompts from stdin, and only include the first `n` lines of prompt.
- `-P`, `--prompt`: show the output with the prompt from STDIN, and only include the first `n` lines of the 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.
Expand Down
2 changes: 1 addition & 1 deletion config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"prompt": "Include the top n lines of prompt from the stdin in the response, where n is the specified number.",
"prompt": "Include the first n lines of prompt from the STDIN in the response",

"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).",
Expand Down
19 changes: 19 additions & 0 deletions features.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down