.\" Generated by kramdown-man 1.0.1 .\" https://github.com/postmodern/kramdown-man#readme .TH aia 1 "2024-01-01" AIA "User Manuals" .SH NAME .PP aia \- command\-line interface for an AI assistant .SH SYNOPSIS .PP aia \[lB]options\[rB]* PROMPT\[ru]ID \[lB]CONTEXT\[ru]FILE\[rB]* \[lB]\-\- EXTERNAL\[ru]OPTIONS\[pl]\[rB] .SH DESCRIPTION .PP The aia command\-line tool is an interface for interacting with an AI model backend, providing a simple way to send prompts and receive responses\. The CLI supports various options to customize the interaction, load a configuration file, edit prompts, set debugging levels, and more\. .SH ARGUMENTS .TP \fIPROMPT\[ru]ID\fP This is a required argument\. .TP \fICONTEXT\[ru]FILES\fP This is an optional argument\. One or more files can be added to the prompt as context for the backend gen\-AI tool to process\. .TP \fIEXTERNAL\[ru]OPTIONS\fP External options are optional\. Anything that follow \[lq] \-\- \[lq] will be sent to the backend gen\-AI tool\. For example \[lq]\-\- \-C \-m gpt4\-128k\[rq] will send the options \[lq]\-C \-m gpt4\-128k\[rq] to the backend gen\-AI tool\. \fBaia\fR will not validate these external options before sending them to the backend gen\-AI tool\. .SH OPTIONS .TP \fB\-\-chat\fR begin a chat session with the backend after the initial prompt response; will set \-\-no\-out\[ru]file so that the backend response comes to STDOUT\. .TP \fB\-\-completion\fR \fISHELL\[ru]NAME\fP .TP \fB\-\-dump\fR \fIFORMAT\fP .TP \fB\-e\fR, \fB\-\-edit\fR Invokes an editor on the prompt file\. You can make changes to the prompt file, save it and the newly saved prompt will be processed by the backend\. .TP \fB\-\-shell\fR This option tells \fBaia\fR to replace references to system environment variables in the prompt with the value of the envar\. envars are like \[Do]HOME and \[Do]\[lC]HOME\[rC] in this example their occurance will be replaced by the value of ENV\[lB]\[oq]HOME\[cq]\[rB]\. Also the dynamic shell command in the pattern \[Do](shell command) will be executed and its output replaces its pattern\. It does not matter if your shell uses different patters than BASH since the replacement is being done within a Ruby context\. .TP \fB\-\-erb\fR If dynamic prompt content using \[Do](\.\.\.) wasn\[cq]t enough here is ERB\. Embedded RUby\. <%\[eq] ruby code %> within a prompt will have its ruby code executed and the results of that execution will be inserted into the prompt\. I\[cq]m sure we will find a way to truly misuse this capability\. Remember, some say that the simple prompt is the best prompt\. .TP \fB\-\-model\fR \fINAME\fP Name of the LLM model to use \- default is gpt\-4\-1106\-preview .TP \fB\-\-speak\fR Simple implementation\. Uses the \[lq]say\[rq] command to speak the response\. Fun with \-\-chat .TP \fB\-\-terse\fR Add a clause to the prompt text that instructs the backend to be terse in its response\. .TP \fB\-\-version\fR Print Version \- default is false .TP \fB\-b\fR, \fB\-\-\[lB]no\[rB]\-backend\fR \fILLM TOOL\fP Specify the backend prompt resolver \- default is mods .TP \fB\-c\fR, \fB\-\-config\[ru]file\fR \fIPATH\[ru]TO\[ru]CONFIG\[ru]FILE\fP Load Config File \- default is nil .TP \fB\-d\fR, \fB\-\-debug\fR Turn On Debugging \- default is false .TP \fB\-e\fR, \fB\-\-edit\fR Edit the Prompt File \- default is false .TP \fB\-f\fR, \-\-fuzzy\` Use Fuzzy Matching when searching for a prompt \- default is false .TP \fB\-h\fR, \fB\-\-help\fR Show Usage \- default is false .TP \fB\-l\fR, \fB\-\-\[lB]no\[rB]\-log\fR \fIPATH\[ru]TO\[ru]LOG\[ru]FILE\fP Log FILEPATH \- default is \[Do]HOME\[sl]\.prompts\[sl]prompts\.log .TP \fB\-m\fR, \fB\-\-\[lB]no\[rB]\-markdown\fR Format with Markdown \- default is true .TP \fB\-o\fR, \fB\-\-\[lB]no\[rB]\-out\[ru]file\fR \fIPATH\[ru]TO\[ru]OUTPUT\[ru]FILE\fP Out FILENAME \- default is \.\[sl]temp\.md .TP \fB\-p\fR, \fB\-\-prompts\fR \fIPATH\[ru]TO\[ru]DIRECTORY\fP Directory containing the prompt files \- default is \[ti]\[sl]\.prompts .TP \fB\-r\fR, \fB\-\-role\fR \fIROLE\[ru]ID\fP A role ID is the same as a prompt ID\. A \[lq]role\[rq] is a specialized prompt that gets pre\-pended to another prompt\. It\[cq]s purpose is to configure the LLM into a certain orientation within which to resolve its primary prompt\. .TP \fB\-v\fR, \fB\-\-verbose\fR Be Verbose \- default is false .SH CONFIGURATION HIERARCHY .PP System Environment Variables (envars) that are all uppercase and begin with \[lq]AIA\[ru]\[rq] can be used to over\-ride the default configuration settings\. For example setting \[lq]export AIA\[ru]PROMPTS\[ru]DIR\[eq]\[ti]\[sl]Documents\[sl]prompts\[rq] will over\-ride the default configuration; however, a config value provided by a command line options will over\-ride an envar setting\. .PP Configuration values found in a config file will over\-ride all other values set for a config item\. .PP \[rq]\[sl]\[sl]config\[rq] directives found inside a prompt file over\-rides that config item regardless of where the value was set\. .PP For example \[lq]\[sl]\[sl]config chat? \[eq] true\[rq] within a prompt will setup the chat back and forth chat session for that specific prompt regardless of the command line options or the envar AIA\[ru]CHAT settings .SH OpenAI ACCOUNT IS REQUIRED .PP Additionally, the program requires an OpenAI access key, which can be specified using one of the following environment variables: .RS .IP \(bu 2 \fBOPENAI\[ru]ACCESS\[ru]TOKEN\fR .IP \(bu 2 \fBOPENAI\[ru]API\[ru]KEY\fR .RE .PP Currently there is not specific standard for name of the OpenAI key\. Some programs use one name, while others use a different name\. Both of the envars listed above mean the same thing\. If you use more than one tool to access OpenAI resources, you may have to set several envars to the same key value\. .PP To acquire an OpenAI access key, first create an account on the OpenAI platform, where further documentation is available\. .SH USAGE NOTES .PP \fBaia\fR is designed for flexibility, allowing users to pass prompt ids and context files as arguments\. Some options change the behavior of the output, such as \fB\-\-out\[ru]file\fR for specifying a file or \fB\-\-no\-out\[ru]file\fR for disabling file output in favor of standard output (STDPIT)\. .PP The \fB\-\-completion\fR option displays a script that enables prompt ID auto\-completion for bash, zsh, or fish shells\. It\[cq]s crucial to integrate the script into the shell\[cq]s runtime to take effect\. .PP The \fB\-\-dump\fR options will send the current configuration to STDOUT in the format requested\. Both YAML and TOML formats are supported\. .SH PROMPT DIRECTIVES .PP Within a prompt text file any line that begins with \[lq]\[sl]\[sl]\[rq] is considered a prompt directive\. There are numerious prompt directives available\. In the discussion above on the configuration you learned about the \[lq]\[sl]\[sl]config\[rq] directive\. .PP Detail discussion on individual prompt directives is TBD\. Most likely it will be handled in the github wiki .UR https:\[sl]\[sl]github\.com\[sl]MadBomber\[sl]aia .UE \. .SH SEE ALSO .RS .IP \(bu 2 OpenAI Platform Documentation .UR https:\[sl]\[sl]platform\.openai\.com\[sl]docs\[sl]overview .UE for more information on obtaining access tokens .UR https:\[sl]\[sl]platform\.openai\.com\[sl]account\[sl]api\-keys .UE and working with OpenAI models\. .IP \(bu 2 mods .UR https:\[sl]\[sl]github\.com\[sl]charmbracelet\[sl]mods .UE for more information on \fBmods\fR \- AI for the command line, built for pipelines\. LLM based AI is really good at interpreting the output of commands and returning the results in CLI friendly text formats like Markdown\. Mods is a simple tool that makes it super easy to use AI on the command line and in your pipelines\. Mods works with OpenAI .UR https:\[sl]\[sl]platform\.openai\.com\[sl]account\[sl]api\-keys .UE and LocalAI .UR https:\[sl]\[sl]github\.com\[sl]go\-skynet\[sl]LocalAI .UE .IP \(bu 2 sgpt .UR https:\[sl]\[sl]github\.com\[sl]tbckr\[sl]sgpt .UE (aka shell\-gpt) is a powerful command\-line interface (CLI) tool designed for seamless interaction with OpenAI models directly from your terminal\. Effortlessly run queries, generate shell commands or code, create images from text, and more, using simple commands\. Streamline your workflow and enhance productivity with this powerful and user\-friendly CLI tool\. .RE .SH AUTHOR .PP Dewayne VanHoozer .MT dvanhoozer\[at]gmail\.com .ME