{"id":13780803,"url":"https://github.com/reid41/shell-pilot","last_synced_at":"2025-05-11T14:33:54.888Z","repository":{"id":233243069,"uuid":"786359771","full_name":"reid41/shell-pilot","owner":"reid41","description":"A simple, lightweight shell script to interact with OpenAI or Ollama or Mistral AI from the terminal, and enhancing intelligent system management without any dependencies(pure shell).","archived":false,"fork":false,"pushed_at":"2024-05-13T12:24:32.000Z","size":76,"stargazers_count":20,"open_issues_count":1,"forks_count":5,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-05-13T13:45:13.252Z","etag":null,"topics":["ai","bash","interact-with-system","linux","llm","macos","mistral","mistralai","no-dependencies","ollama","openai","pure-shell","smart-cli-assistant"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/reid41.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-14T08:01:42.000Z","updated_at":"2024-05-13T13:45:17.516Z","dependencies_parsed_at":"2024-05-13T13:45:16.530Z","dependency_job_id":"3df3f041-04fb-4c59-8eb6-c1a8aedfb13b","html_url":"https://github.com/reid41/shell-pilot","commit_stats":null,"previous_names":["reid41/shell-pilot"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reid41%2Fshell-pilot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reid41%2Fshell-pilot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reid41%2Fshell-pilot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reid41%2Fshell-pilot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reid41","download_url":"https://codeload.github.com/reid41/shell-pilot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225064390,"owners_count":17415239,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","bash","interact-with-system","linux","llm","macos","mistral","mistralai","no-dependencies","ollama","openai","pure-shell","smart-cli-assistant"],"created_at":"2024-08-03T18:01:19.925Z","updated_at":"2025-05-11T14:33:54.877Z","avatar_url":"https://github.com/reid41.png","language":"Shell","funding_links":[],"categories":["LLM Deployment","LLM Applications","Developer tools","Desktop \u0026 Web UIs (22)"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/reid41/shell-pilot/assets/25558653/7d99c212-4b5c-456d-907d-20df16112cd5\" alt=\"shell-pilot\"\u003e\n\u003c/p\u003e\n\nA simple, lightweight shell script to interact with `OpenAI` or `Ollama` or `Mistral AI` or `LocalAI` or `ZhipuAI` or `Athropic` or `Moonshot` or `Novita AI` from the terminal, and enhancing intelligent system management without any dependencies(pure shell).\n\u003c/div\u003e\n\n## Features\n\n- Based on [Ollama](https://ollama.com/) to setup a local LLM repository(`support deepseek, llama3.x, gemma2`), work with [Ollama API](https://github.com/ollama/ollama/blob/main/docs/api.md)\n- Use the official chatgpt model with the [official ChatGPT API](https://openai.com/blog/introducing-chatgpt-and-whisper-apis) from the terminal\n- Use the official Mistral AI model with the [Mistral AI API](https://docs.mistral.ai/)\n- Use the LocalAI model with the [LocalAI API](https://localai.io/)\n- Use the ZhipuAI model with the [ZhipuAI API](https://open.bigmodel.cn/)\n- Use the Anthropic model with the [Anthropic API](https://docs.anthropic.com/en/api/getting-started)\n- Use the Moonshot model with the [Moonshot API](https://platform.moonshot.cn/)\n- Use the Novita AI model with the [Novita AI API](https://novita.ai/llm-api?utm_source=github_shell-pilot\u0026utm_medium=github_readme\u0026utm_campaign=github_link)\n- View your history and session persistence\n- Chat context, GPT remembers previous chat questions and answers\n- Pass the input prompt with pipe/redirector(`|`, `\u003c`), as a script parameter or normal chat mode(bash version: 4.0+)\n- List all available models \n- Set OpenAI request parameters\n- Generate a command and run it in terminal, and can use `code chat mode` easy to interact \n- Easy to set the config in command parameter or edit config with vi mode(option e)\n- Enhanced system interaction and efficiency with features aimed at basic system management\n- `Modular plugin design` allows for easy expansion with each plugin introducing a new functionality, making the tool more powerful and adaptable to user needs.\n  - Easy to check system package verison\n  - Easy to add/list/remove alias from command line\n\n\n#### Code chat mode scenario\n\n![code-chat](https://github.com/reid41/shell-pilot/assets/25558653/58eee738-3f54-49c5-a1bb-1ebb87b2f1e5)\n\n\n#### Vim/vi scenario\n\n![vi-vim-new](https://github.com/reid41/shell-pilot/assets/25558653/f3b97c20-2861-4392-8cc8-c85ccccf2abb)\n\n## Disclaimer\n\n* This is still a test project for using online models and local LLM in shell environment. `It is not production ready, so do not use in critical/production system, and do not use to analyze customer data.`\n\n## Getting Started\n\n### Prerequisites\n\nThis script relies on curl for the requests to the api and jq to parse the json response.\n\n* [curl](https://www.curl.se)\n  ```sh\n  MacOS:\n  brew install curl\n\n  Linux: should be installed by default\n  dnf/yum/apt install curl\n  ```\n* [jq](https://stedolan.github.io/jq/)\n  ```sh\n  MacOS:\n  brew install jq\n\n  Linux: should be installed by default\n  dnf/yum/apt install jq\n  ```\n* An OpenAI API key. Create an account and get a free API Key at [OpenAI](https://beta.openai.com/account/api-keys)\n\n* Optionally, you can install [glow](https://github.com/charmbracelet/glow) to render responses in markdown \n\n### Installation\n\n   - For setup `Ollama` environment, [Manual install instructions](https://github.com/ollama/ollama/blob/main/docs/linux.md), [ollama usage](https://github.com/ollama/ollama), and [Ollama model library](https://ollama.com/library)\n   ```sh\n   curl -fsSL https://ollama.com/install.sh | sh\n\n   ollama pull llama2  # used llama2 by default\n   ```\n\n   - For setup `LocalAI` environment, [Manual](https://localai.io/), and [LocalAI github](https://github.com/mudler/LocalAI)\n   ```sh\n   docker run -p 8080:8080 --name local-ai -ti localai/localai:latest-aio-cpu\n   # Do you have a Nvidia GPUs? Use this instead\n   # CUDA 11\n   # docker run -p 8080:8080 --gpus all --name local-ai -ti localai/localai:latest-aio-gpu-nvidia-cuda-11\n   # CUDA 12\n   # docker run -p 8080:8080 --gpus all --name local-ai -ti localai/localai:latest-aio-gpu-nvidia-cuda-12\n   ```\n\n   - To install, run this in your terminal and provide your OpenAI API key when asked.\n   \n   ```sh\n   curl -sS -o spilot_install.sh https://raw.githubusercontent.com/reid41/shell-pilot/main/spilot_install.sh\n   bash spilot_install.sh\n   ```\n\n   - Set your local `Ollama` server ip in configuration file `spilot_common.sh` if not set during the installation\n   ```sh\n   OLLAMA_SERVER_IP=\u003collama server ip address\u003e\n   ```\n\n   - You can also set the other parameters in `spilot_common.sh` before using.\n   ```sh\n   e.g.\n   TEMPERATURE=0.6\n   MAX_TOKENS=4096\n   MODEL_OPENAI=gpt-3.5-turbo\n   MODEL_OLLAMA=llama2\n   CONTEXT=false\n   MULTI_LINE_PROMPT=false\n   ENABLE_DANGER_FLAG=false\n   ```\n\n### Manual Installation\n\n  If you want to install it manually, all you have to do is:\n\n  - Download the shell-pilot project files in\n  ```shell\n  git clone https://github.com/reid41/shell-pilot.git\n\n  cd shell-pilot/\n  ```\n\n  - If you want to reset `the script path(/usr/local/bin/ by default)` or `output store path(~/spilot_files_dir by default)`, try below:\n  ```shell\n  # define the config dir if need to reset\n  new_config_path=\"/new/path/to/config/\"\n  # define the tmp or output files dir\n  new_files_dir=\"/new/path/to/files/\"\n\n  # create it if new\n  [[ ! -d ${new_config_path} ]] \u0026\u0026 mkdir ${new_config_path} -p\n  [[ ! -d \"${new_config_path}/plugins\" ]] \u0026\u0026 mkdir ${new_config_path}/plugins -p\n  [[ ! -d ${new_files_dir} ]] \u0026\u0026 mkdir ${new_files_dir} -p\n\n  # reset it\n  sed -i \"s|SHELL_PILOT_CONFIG_PATH=\\\"/usr/local/bin/\\\"|SHELL_PILOT_CONFIG_PATH=\\\"$new_config_path\\\"|\" s-pilot\n  sed -i \"s|SPILOT_FILES_DEFAULT_DIR=~/spilot_files_dir|SPILOT_FILES_DEFAULT_DIR=$new_files_dir|\" spilot_common.sh\n  \n  # add ollama server host\n  ollama_server_ip_address=\u003cip\u003e\n  echo \"OLLAMA_SERVER_IP=${ollama_server_ip_address}\" \u003e\u003e spilot_common.sh\n\n  # add localai server host\n  localai_server_ip_address=\u003cip\u003e\n  echo \"LOCALAI_SERVER_IP=${localai_server_ip_address}\" \u003e\u003e spilot_common.sh\n  ```\n\n  - set the permissions\n  ```shell\n  chmod +x s-pilot spilot_common.sh spilot_llm_rq_apis.sh plugins/*.sh\n  ```\n\n  - Move the files to the dir\n  ```shell\n  cp s-pilot spilot_common.sh spilot_llm_rq_apis.sh ${new_config_path}\n\n  cp plugins/*.sh ${new_config_path}/plugins\n  ```\n\n  - Add settings into the profile file\n  ```shell\n  # profile, e.g. .bash_profile\n  the_profile_file=$HOME/.bash_profile\n\n  # add the script/config path\n  echo \"export PATH\\=\\$PATH\\:${new_config_path}\" \u003e\u003e $the_profile_file\n\n  # add source alias for alias option\n  echo \"alias ss-pilot='source s-pilot'\" \u003e\u003e $the_profile_file\n\n  # openai/mistral key if need\n  # openai\n  openai_api_key_value=\u003ckey\u003e\n  echo \"export OPENAI_KEY=${openai_api_key_value}\" \u003e\u003e $the_profile_file\n\n  # mistral ai\n  mistralai_api_key_value=\u003ckey\u003e\n  echo \"export MISTRAL_API_KEY=${mistralai_api_key_value}\" \u003e\u003e $the_profile_file\n\n  # zhipuai ai\n  zhipuai_api_key_value=\u003ckey\u003e\n  echo \"export ZHIPUAI_API_KEY=${zhipuai_api_key_value}\" \u003e\u003e $the_profile_file\n\n  # anthropic ai\n  anthropic_api_key_value=\u003ckey\u003e\n  echo \"export ANTHROPIC_API_KEY=${anthropic_api_key_value}\" \u003e\u003e $the_profile_file\n\n  # moonshot ai\n  moonshot_api_key_value=\u003ckey\u003e\n  echo \"export MOONSHOT_API_KEY=${moonshot_api_key_value}\" \u003e\u003e $the_profile_file\n\n  # novita ai\n  novita_api_key_value=\u003ckey\u003e\n  echo \"export NOVITA_API_KEY=${novita_api_key_value}\" \u003e\u003e $the_profile_file\n\n  source $the_profile_file\n  ```\n\n## Usage\n\n### Start\n\n#### Chat Mode\n  - Run the script by using the `s-pilot` command anywhere:\n  ```shell\n  $ s-pilot\n  Welcome to Shell Pilot!!\n  You can quit with 'q' or 'e'.\n\n  \u003c\u003cYou\u003e\u003e\n  ```\n\n#### Pipe Mode\n  - You can also use it in pipe mode:\n  ```shell\n  $ echo \"How to view running processes on RHEL8?\" | s-pilot\n\n  You can view running processes on RHEL8 using the `ps` command. To see a list of running processes,\n  open a terminal and type `ps aux` or `ps -ef`. This will display a list of all processes currently\n  running on your system.\n\n\n  $ cat error.log | s-pilot\n\n  The log entries indicate the following events on the system:\n\n  1. April 7, 23:35:40: Log rotation initiated by systemd, then completed successfully.\n  2. April 8, 05:20:51: Error encountered during metadata download for repository\n  ```\n\n#### Use Redirection Operators\n  ```shell\n\n  $ s-pilot \u003c ss.sh\n  The output will be:\n  Hello World test\n\n  $ s-pilot p \"summarize\" \u003c ss.sh\n  This is a bash script that defines and invokes a function named \"Hello\".\n  The function takes two arguments, $1 and $2, and prints \"Hello World\" followed by these arguments...\n\n  $ s-pilot \u003c\u003c\u003c \"what is the best way to learn shell? Provide an example\"\n  The best way to learn shell scripting is through hands-on practice and tutorials. Start by\n  understanding basic commands, then move on to writing simple scripts to automate tasks...\n\n  $ s-pilot \u003c\u003c EOF\n  \u003e how to learn python?\n  \u003e provide a detail example.\n  \u003e EOF\n  To learn Python, follow these steps:\n  1. **Understand the Basics**: Start with Python syntax, data types, variables, and basic operations.\n  2. **Control Structures**: Learn about loops (for, while), if statements, and functions...\n  ```\n\n#### Script Parameters\n\n  - Help with `h`, `-h`, `--help`:\n\n  - Check version:\n  ```shell\n  s-pilot v\n  [Shell Pilot Version]: 1.5.5\n  ```\n\n  -  Chat mode with initial prompt:\n  ```shell\n  s-pilot ip \"You are Linux Master. You should provide a detail and professional suggeston about Linux every time.\"\n  Welcome to Shell Pilot!!\n  You can quit with 'q' or 'e'.\n\n  \u003c\u003cYou\u003e\u003e\n  what is shell?\n\n\n  \u003c\u003cShellPilot\u003e\u003e A shell is a command-line interface that allows users to interact with the\n  operating system by running commands. It is a program that takes input from the user in the form of\n  commands and then executes them. The shell acts as an intermediary between the user and the\n  operating system, interpreting commands and running programs. There are different types of shells\n  available in Linux, such as bash (Bourne Again Shell), sh (Bourne Shell), csh (C Shell), ksh (Korn\n  Shell), and more. Each shell has its own set of features and capabilities, but they all serve the\n  same fundamental purpose of allowing users to interact with the system via the command line.\n  ```\n\n  - with `p`:\n  ```shell\n  s-pilot -p \"What is the regex to match an ip address?\"\n\n  The regex to match an IP address is:\n  (?:\\d{1,3}\\.){3}\\d{1,3}\n\n\n  $ cat error.log | s-pilot p \"find the errors and provide solution\"\n\n  Errors:\n  1. Inconsistent date formats: \"Apr 7\" and \"Apr 8\".\n  2. Inconsistency in log times: \"23:35:40\" and \"10:03:28\" for the same date.\n\n  Solutions:\n  1. Standardize date format: Use a consistent date format throughout the log entries.\n  2. Ensure log times are in chronological order within the same date.\n  ```\n\n  - change model provider:\n  ```shell\n\n  s-pilot cmp ollama\n  Attempting to update USE_API to ollama.\n  Backup file removed after successful update.\n  The setting will save in the configuration file.\n\n  Here is the checklist to change the model provider:\n  USE_API=ollama\n  ```\n\n  - list models:\n  ```shell\n  s-pilot lm\n\n  {\n    \"name\": \"llama2:13b\",\n    \"size\": \"6.86 GB\",\n    \"format\": \"gguf\",\n    \"parameter_size\": \"13B\",\n    \"quantization_level\": \"Q4_0\"\n  }\n  ```\n\n  - list config\n  ```shell\n  s-pilot lc\n  # Configuration settings\n  USE_API=ollama\n\n  # Define prompts using the adjusted settings\n  CHAT_INIT_PROMPT=\"You are $MODEL_NAME, a Large Language Model trained by $ORGANIZATION. You will be answering questions from users. Answer as concisely as possible for each response.\n  ...\n  ```\n\n  - Update the chat setting in `spilot_common.sh`\n  ```shell\n  s-pilot t 0.9\n  Attempting to update TEMPERATURE to 0.9.\n  Backup file removed after successful update.\n  The setting will save in the configuration file.\n\n  Here is the checklist to change the temperature:\n  TEMPERATURE=0.9\n  ```\n\n### Commands\n\n  - `history` To view your chat history, type `history`\n  ```shell\n  $ s-pilot\n  Welcome to Shell Pilot!!\n  You can quit with 'q' or 'e'.\n\n  \u003c\u003cYou\u003e\u003e\n  history\n\n  2024-04-08 18:51 hi\n  Hello! How can I assist you today?\n  ```\n\n  - `models` To get a list of the models available at OpenAI API/Ollama, type `models`\n  ```shell\n  $ s-pilot\n  Welcome to Shell Pilot!!\n  You can quit with 'q' or 'e'.\n  \u003c\u003cYou\u003e\u003e\n  models\n  {\n    \"name\": \"llama2:13b\",\n    \"size\": \"6.86 GB\",\n    \"format\": \"gguf\",\n    \"parameter_size\": \"13B\",\n    \"quantization_level\": \"Q4_0\"\n  }\n  ```\n\n  - `model:` To view all the information on a specific model, start a prompt with `model:` and the model `id`, please `do not use space between model: and id`,e.g.\n  ``` shell\n  $ s-pilot\n  Welcome to Shell Pilot!!\n  You can quit with 'q' or 'e'.\n\n  \u003c\u003cYou\u003e\u003e\n  model:llama2\n\n  License: LLAMA 2 COMMUNITY LICENSE AGREEMENT\n  Llama 2 Version Release Date: July 18, 2023\n  ...\n  Format: gguf\n  Family: llama\n  Parameter Size: 7B\n  Quantization Level: Q4_0\n  ```\n\n  - `cmd:` To get a command with the specified functionality and run it, just type `cmd:` and explain what you want to achieve. The script will always ask you if you want to execute the command. i.e.\n  *If a command modifies your file system or dowloads external files the script will show a warning before executing, but if the execution flag is disabled by default if found danger.*\n  ```shell\n  # \u003e\u003e\u003e\u003e\u003e\u003e MacOS\n  s-pilot\n  Welcome to Shell Pilot!!\n  You can quit with 'q' or 'e'.\n\n  \u003c\u003cYou\u003e\u003e\n  cmd: list the files in /tmp/\n\n\n  \u003c\u003cShellPilot\u003e\u003e  ls /tmp\n  Would you like to execute it? (Yes/No)\n  y\n\n  Executing command: ls /tmp\n\n  com.xx.launchd.xx\tcom.x.xx\t\tcom.xx.out\n  com.xx.launchd.xx\tcom.x.err\t\t\tpowerlog\n\n  # \u003e\u003e\u003e\u003e\u003e\u003e Linux\n  \u003c\u003cYou\u003e\u003e\n  cmd: update my os\n\n\n  \u003c\u003cShellPilot\u003e\u003e  sudo dnf update\n  Would you like to execute it? (Yes/No)\n  n\n\n\n  # \u003e\u003e\u003e\u003e\u003e\u003e The danger cmd example:\n  \u003c\u003cYou\u003e\u003e\n  cmd: remove the files in /tmp/\n\n\n  \u003c\u003cShellPilot\u003e\u003e  rm -r /tmp/*\n  Warning: This command can change your file system or download external scripts \u0026 data.\n  Please do not execute code that you don't understand completely.\n\n  Info: Execution of potentially dangerous commands has been disabled.\n  ```\n\n### Session persistence\n  - One-shot Command Mode\n  ```shell\n  # s-pilot cr test  p \"please remember my lucky number is 5\"\n\n  I've noted that your lucky number is 5!\n  \n  # s-pilot lr\n  ==\u003e Here are the chat record files[\u003cname\u003e-chat_record.spilot]:\n  -rw-r--r--. 1 root root 149 Apr 28 10:07 test-chat_record.spilot\n\n  # s-pilot lr test\n  ==\u003e Here is the chat record file content:\n  [\n    {\n      \"role\": \"user\",\n      \"content\": \"please remember my lucky number is 5\\n\"\n    },\n    {\n      \"role\": \"assistant\",\n      \"content\": \"I've noted that your lucky number is 5!\\n\"\n    }\n  ]\n\n  # s-pilot cr test  p \"use my lucky number plus 20\"\n\n  Using your lucky number (5) + 20 gives us... 25!\n\n\n  # s-pilot dr test\n  rm: remove regular file '/root/spilot_files_dir/test-chat_record.spilot'? y\n  File /root/spilot_files_dir/test-chat_record.spilot has been deleted successfully.\n  ```\n\n  - Interactive Session Mode\n  ```shell\n\n  # s-pilot cr test1\n  Welcome to Shell Pilot!!\n  You can quit with 'q' or 'e'.\n\n  \u003c\u003cYou\u003e\u003e\n  please remember my favorite color is blue\n\n\n  \u003c\u003cShellPilot\u003e\u003e I've made a note that your favorite color is blue!\n\n  \u003c\u003cYou\u003e\u003e\n  q # quit\n\n  # s-pilot cr test1\n  Welcome to Shell Pilot!!\n  You can quit with 'q' or 'e'.\n\n  \u003c\u003cYou\u003e\u003e\n  what is my favorite color?\n\n\n  \u003c\u003cShellPilot\u003e\u003e Your favorite color is blue!\n  ```\n\n### Chat context\n\n  - For models other than `gpt-3.5-turbo` and `gpt-4` where the chat context is not supported by the OpenAI api, you can use the chat context build in this script. You can enable chat context mode for the model to remember your previous chat questions and answers. This way you can ask follow-up questions. In chat context the model gets a prompt to act as ChatGPT and is aware of today's date and that it's trained with data up until 2021. To enable this mode start the script with  `c`, `-c` or `--chat-context`. i.e. `s-pilot c true` to enable it. \n\n#### Set chat initial prompt\n  - You can set your own initial chat prompt to use in chat context mode. The initial prompt will be sent on every request along with your regular prompt so that the OpenAI model will \"stay in character\". To set your own custom initial chat prompt use `ip` `-ip` or `--init-prompt` followed by your initial prompt i.e. see the `Script Parameters` usage example.\n  - You can also set an initial chat prompt from a file with `--init-prompt-from-file` i.e. `s-pilot --init-prompt-from-file myprompt.txt`\n  \n  *When you set an initial prompt you don't need to enable the chat context. \n\n### Use the official  model\n\n  - The default model used when starting the script is `gpt-3.5-turbo` for OpenAI.\n  \n  - The default model used when starting the script is `llama2` for Ollama.\n\n  - The default model used when starting the script is `mistral-small` for MistralAI.\n  \n### Use other models for OpenAI or Ollama\n  - If you have access to the GPT4 model you can use it by setting the model to `gpt-4`, i.e. `s-pilot --model gpt-4`.\n\n  - For `Ollama`, you can pull first from the ollama server, i.e. `ollama pull mistral`, `s-pilot e` to set.\n\n  - For `MistralAI`, you can check with `s-pilot lm`, and set with `s-pilot e`.\n\n### Set request parameters\n\n  - To set request parameters you can start the script like this: `s-pilot t 0.9`.\n  - The setting will save in `spilot_common.sh`, no need to change or mention every time.\n  \n    The available parameters are: \n      - temperature, `t` or  `-t` or `--temperature`\n      - model, `m` or `-m` or `--model`\n      - max number of tokens,`mt`, `-mt`, `--max-tokens`\n      - prompt, `p`, `-p` or `--prompt` \n      - prompt from a file in your file system, `pf` or `-pf` or `--prompt-from-file`  \n      \n    For OpenAI: [OpenAI API documentation](https://platform.openai.com/docs/api-reference/completions/create)\n    For Ollama: [Ollama API documentation](https://github.com/ollama/ollama/blob/main/docs/api.md)\n\n\n### Plugins\n\n  - pv: check the system package version(so far support MacOS/RHEL/CentOS/Fedora)\n  ```shell\n  $ s-pilot pv\n  Check the system package version\n  Usage: /usr/local/bin/s-pilot pv [-f] \u003cpkg1\u003e [pkg2] ...\n\n  $ s-pilot pv bc go xx\n  Check the system package version\n  ✔ bc version 6.5.0\n  ✔ go version 1.19.6\n  ✗ Package xx not found on macOS.\n\n  $ s-pilot pv -f usb\n  Check the system package version\n  ✔ libusb version 1.0.27\n  ✔ usb.ids version 2024.03.18\n  ✔ usbredir version 0.14.0\n  ```\n  - sa: manage the system alias\n  ```shell\n  # use `ss-pilot` to execute(not `s-pilot`), it will set it after installation\n\n  # ss-pilot sa a lx \"ls -l /tmp/\" lxx \"ls -ld /etc\" cdetc \"cd /etc\"\n  ==\u003e Alias 'lx' added to /root/spilot_files_dir/shell_pilot_system_aliases and is active.\n  ==\u003e Alias 'lxx' added to /root/spilot_files_dir/shell_pilot_system_aliases and is active.\n  ==\u003e Alias 'cdetc' added to /root/spilot_files_dir/shell_pilot_system_aliases and is active.\n\n  # ss-pilot sa l\n  ==\u003e Aliase List:\n  alias lx='ls -l /tmp/'\n  alias lxx='ls -ld /etc'\n  alias cdetc='cd /etc'\n\n  # lx\n  total 0\n  # cdetc\n  # pwd\n  /etc\n\n  # ss-pilot sa r lx lxx cdetc\n  ==\u003e Alias 'lx' removed from /root/spilot_files_dir/shell_pilot_system_aliases\n  ==\u003e Alias 'lxx' removed from /root/spilot_files_dir/shell_pilot_system_aliases\n  ==\u003e Alias 'cdetc' removed from /root/spilot_files_dir/shell_pilot_system_aliases\n\n  # lx\n  -bash: lx: command not found\n  ```\n\n### Acknowledgements\n\nThe following projects are worth remarking.\nThey were studied during development of this script and used as referencial code sources.\n\n1. [0xacx's chatGPT-shell-cli](https://github.com/0xacx/chatGPT-shell-cli)\n2. [Ollama](https://github.com/ollama/ollama/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freid41%2Fshell-pilot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freid41%2Fshell-pilot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freid41%2Fshell-pilot/lists"}