AI for the CLI.
(Fork of Mods, WIP.)
Pipes works by reading standard in and prefacing it with a prompt supplied in the pipes arguments. It sends the input text to an LLM and prints out the result, optionally asking the LLM to format the response as Markdown. This gives you a way to "question" the output of a command. Pipes will also work on standard in or an argument supplied prompt individually.
Be sure to check out the examples and a list of all the features.
Pipes works with OpenAI compatible endpoints. By default, Pipes is configured to support OpenAI's official API and a LocalAI installation running on port 8080. You can configure additional endpoints in your settings file by running pipes --settings.
Conversations are saved locally by default. Each conversation has a SHA-1 identifier and a title (like git!).
Check the ./features.md for more details.
-m,--model: Specify Large Language Model to use-M,--ask-model: Ask which model to use via interactive prompt-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,--promptInclude the prompt from the arguments and stdin, truncate stdin to specified number of lines-p,--prompt-args: Include the prompt from the arguments in the response-q,--quiet: Only output errors to standard err-r,--raw: Print raw response without syntax highlighting--settings: Open settings-x,--http-proxy: Use HTTP proxy to connect to the API endpoints--max-retries: Maximum number of retries--max-tokens: Specify maximum tokens with which to respond--no-limit: Do not limit the response tokens--role: Specify the role to use (See custom roles)--word-wrap: Wrap output at width (defaults to 80)--reset-settings: Restore settings to default--theme: Theme to use in the forms; valid choices are:charm,catppuccin,dracula, andbase16--status-text: Text to show while generating
-t,--title: Set the title for the conversation.-l,--list: List saved conversations.-c,--continue: Continue from last response or specific title or SHA-1.-C,--continue-last: Continue the last conversation.-s,--show: Show saved conversation for the given title or SHA-1-S,--show-last: Show previous conversation--delete-older-than=<duration>: Deletes conversations older than given duration (10d,1mo).--delete: Deletes the saved conversations for the given titles or SHA-1s--no-cache: Do not save conversations
--mcp-list: List all available MCP servers--mcp-list-tools: List all available tools from enabled MCP servers--mcp-disable: Disable specific MCP servers
--fanciness: Level of fanciness--temp: Sampling temperature--topp: Top P value--topk: Top K value
Roles allow you to set system prompts. Here is an example of a shell role:
roles:
shell:
- you are a shell expert
- you do not explain anything
- you simply output one liners to solve the problems you're asked
- you do not provide any explanation whatsoever, ONLY the commandThen, use the custom role in Pipes:
pipes --role shell list files in the current directoryPipes uses GPT-4 by default. It will fall back to GPT-3.5 Turbo.
Set the OPENAI_API_KEY environment variable. If you don't have one yet, you
can grab it the OpenAI website.
Alternatively, set the [AZURE_OPENAI_KEY] environment variable to use Azure
OpenAI. Grab a key from Azure.
Cohere provides enterprise optimized models.
Set the COHERE_API_KEY environment variable. If you don't have one yet, you can
get it from the Cohere dashboard.
Local AI allows you to run models locally. Pipes works with the GPT4ALL-J model as setup in this tutorial.
Groq provides models powered by their LPU inference engine.
Set the GROQ_API_KEY environment variable. If you don't have one yet, you can
get it from the Groq console.
Pipes supports using Gemini models from Google.
Set the GOOGLE_API_KEY environment variable. If you don't have one yet,
you can get it from the Google AI Studio.