diff --git a/README.md b/README.md index 4ff5d97..95d60a9 100644 --- a/README.md +++ b/README.md @@ -29,65 +29,99 @@ pip install . ## Usage +The `cmm` script has global options, a list of commands, and options per command: + ```bash -cmm [-h] [-p PRINT | -q QUESTION | -D | -d | -l] [-c CONFIG] [-m MAX_TOKENS] [-T TEMPERATURE] [-M MODEL] [-n NUMBER] [-t [TAGS [TAGS ...]]] [-e [EXTAGS [EXTAGS ...]]] [-o [OTAGS [OTAGS ...]]] [-a] [-w] [-W] +cmm [global options] command [command options] ``` -### Arguments +### Global Options -- `-p`, `--print`: YAML file to print. -- `-q`, `--question`: Question to ask. -- `-D`, `--chat-dump`: Print chat history as a Python structure. -- `-d`, `--chat`: Print chat history as readable text. -- `-a`, `--match-all-tags`: All given tags must match when selecting chat history entries. -- `-w`, `--with-tags`: Print chat history with tags. -- `-W`, `--with-tags`: Print chat history with filenames. -- `-l`, `--list-tags`: List all tags and their frequency. - `-c`, `--config`: Config file name (defaults to `.config.yaml`). + +### Commands + +- `ask`: Ask a question. +- `hist`: Print chat history. +- `tag`: Manage tags. +- `model`: Manage models. +- `print`: Print files. + +### Command Options + +#### `ask` Command Options + +- `-q`, `--question`: Question to ask (required). - `-m`, `--max-tokens`: Max tokens to use. - `-T`, `--temperature`: Temperature to use. - `-M`, `--model`: Model to use. - `-n`, `--number`: Number of answers to produce (default is 3). +- `-s`, `--source`: Add content of a file to the query. +- `-S`, `--only-source-code`: Add pure source code to the chat history. - `-t`, `--tags`: List of tag names. - `-e`, `--extags`: List of tag names to exclude. - `-o`, `--output-tags`: List of output tag names (default is the input tags). +- `-a`, `--match-all-tags`: All given tags must match when selecting chat history entries. + +#### `hist` Command Options + +- `-d`, `--dump`: Print chat history as Python structure. +- `-w`, `--with-tags`: Print chat history with tags. +- `-W`, `--with-files`: Print chat history with filenames. +- `-S`, `--only-source-code`: Print only source code. +- `-t`, `--tags`: List of tag names. +- `-e`, `--extags`: List of tag names to exclude. +- `-a`, `--match-all-tags`: All given tags must match when selecting chat history entries. + +#### `tag` Command Options + +- `-l`, `--list`: List all tags and their frequency. + +#### `model` Command Options + +- `-l`, `--list`: List all available models. + +#### `print` Command Options + +- `-f`, `--file`: File to print (required). +- `-S`, `--only-source-code`: Print only source code. ### Examples -1. Print the contents of a YAML file: +1. Ask a question: ```bash -cmm -p example.yaml +cmm ask -q "What is the meaning of life?" -t philosophy -e religion ``` -2. Ask a question: +2. Display the chat history: ```bash -cmm -q "What is the meaning of life?" -t philosophy -e religion +cmm hist ``` -3. Display the chat history as a Python structure: +3. Filter chat history by tags: ```bash -cmm -D +cmm hist -t tag1 tag2 ``` -4. Display the chat history as readable text: +4. Exclude chat history by tags: ```bash -cmm -d +cmm hist -e tag3 tag4 ``` -5. Filter chat history by tags: +5. List all tags and their frequency: ```bash -cmm -d -t tag1 tag2 +cmm tag -l ``` -6. Exclude chat history by tags: +6. Print the contents of a file: ```bash -cmm -d -e tag3 tag4 +cmm print -f example.yaml ``` ## Configuration