{"id":19131408,"url":"https://github.com/hezkore/bash-ai","last_synced_at":"2025-09-08T16:32:41.099Z","repository":{"id":217803445,"uuid":"744836101","full_name":"Hezkore/bash-ai","owner":"Hezkore","description":"An advanced Bash shell script functioning as an AI-powered terminal assistant, equipped with plugin support for all your terminal tasks and questions","archived":false,"fork":false,"pushed_at":"2024-02-21T01:57:38.000Z","size":48,"stargazers_count":15,"open_issues_count":0,"forks_count":7,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-30T19:23:36.302Z","etag":null,"topics":["ai","artificial-intelligence","bash","bash-script","chatgpt","cli","command-line-tool","gpt","gpt-3","gpt-4","openai","terminal"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Hezkore.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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-01-18T05:19:44.000Z","updated_at":"2024-12-08T20:17:57.000Z","dependencies_parsed_at":"2024-01-20T02:12:16.495Z","dependency_job_id":"c34532ce-afee-42cd-b7a8-416205ad3730","html_url":"https://github.com/Hezkore/bash-ai","commit_stats":{"total_commits":52,"total_committers":1,"mean_commits":52.0,"dds":0.0,"last_synced_commit":"2b2cb6a007fd332c42da82a755b4a08d7120210f"},"previous_names":["hezkore/bash-ai"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hezkore%2Fbash-ai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hezkore%2Fbash-ai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hezkore%2Fbash-ai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hezkore%2Fbash-ai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Hezkore","download_url":"https://codeload.github.com/Hezkore/bash-ai/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232327978,"owners_count":18506149,"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","artificial-intelligence","bash","bash-script","chatgpt","cli","command-line-tool","gpt","gpt-3","gpt-4","openai","terminal"],"created_at":"2024-11-09T06:15:02.994Z","updated_at":"2025-01-03T11:24:26.741Z","avatar_url":"https://github.com/Hezkore.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bash AI\n\nBash AI _(bai)_ is an advanced Bash shell script functioning as an AI-powered terminal assistant, inspired by [Your AI](https://github.com/ekkinox/yai).\\\nLeveraging the newest OpenAI's capabilities, it allows you to ask questions and perform terminal-based tasks using natural language. It provides answers and command suggestions based on your input and allows you to execute or edit the suggested commands if desired.\n\nBash AI is not only powerful out of the box, but also expandable!\\\nWith its plugin architecture, you can easily add your own tools, thereby empowering Bash AI to accomplish even more, and extending its functionality beyond its original capabilities.\n\n## Features\n\nBash AI offers the following features:\n\n- **100% Shell Script**\\\n\tNo need to install anything. Just run it!\n\t\n- **Plugins!**\\\n\tExtend Bash AI's functionality by adding plugins known as \"tools\".\n\n- **Natural Language Interface**\\\n\tCommunicate with the terminal using everyday language.\n\t\n- **Question Answering**\\\n\tGet answers to all your terminal questions by ending your request with a question mark.\n\n- **Command Suggestions**\\\n\tReceive intelligent command suggestions based on your input.\n\n- **Command Information**\\\n\tGet detailed information about the suggested commands.\n\t\n- **Distribution Awareness**\\\n\tGet answers and commands that are compatible with, and related to, your specific Linux distribution.\n\n- **Command Execution**\\\n\tChoose to execute the suggested commands directly from Bash AI.\n\n- **Command Editing**\\\n\tEdit the suggested commands before execution.\n\n- **Error Examination**\\\n\tExamine the error messages generated by the suggested commands and attempt to fix them.\n\n- **Persistent Memory**\\\n\tRemembers your previous requests and uses them to improve future suggestions.\n\n- **Directory Awareness**\\\n\tAutomatically detects and uses the current directory when executing commands.\n\n- **Locale Awareness**\\\n\tAutomatically detects your system's locale and uses it to provide localized responses.\n\n- **Vim Awareness**\\\n\tAutomatically detects if you are using Vim and provides Vim-specific suggestions.\n\n## Setup\n\n1. To setup Bash AI quickly, you can run the following command:\n\n```bash\ncurl -sS https://raw.githubusercontent.com/hezkore/bash-ai/main/install.sh | bash\n```\n\n\u003e [!WARNING]\n\u003e Never run unknown scripts without reviewing them for safety. Read the install script [here](https://raw.githubusercontent.com/hezkore/bash-ai/main/install.sh).\n\n2. Run `bai` to start Bash AI.\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eManual Setup\u003c/b\u003e\u003c/summary\u003e\n\n1. Clone or download the repository:\n\n\t```bash\n\tgit clone https://github.com/hezkore/bash-ai.git\n\t```\n2. Make the script executable:\n\n\t```bash\n\tchmod +x bai.sh\n\t```\n\n3. Execute Bash AI:\n\n\t```bash\n\t./bai.sh\n\t```\n\n*  _(Optional)_ For convenience, you can create a shortcut to the `bai.sh` script. There are two ways to do this:\n\n\t* Create a symbolic link in `/usr/local/bin`. This will allow you to run the script from anywhere, without having to type the full path. Replace `path/to/bai.sh` with the actual path to the `bai.sh` script:\n\n\t\t```bash\n\t\tln -s path/to/bai.sh /usr/local/bin/bai\n\t\t```\n\n\t* Alternatively, you can create an alias for the `bai.sh` script in your `.bashrc` file. This will also allow you to execute the script using the `bai` command, reducing the need for typing the full path to the script each time. Replace `path/to/bai.sh` with the actual path to the `bai.sh` script:\n\n\t\t```conf\n\t\talias bai='path/to/bai.sh'\n\t\t```\n\n\u003c/details\u003e\n\n## Configuration\n\nOn the first run, a configuration file named `bai.cfg` will be created in your `~/.config` directory.\n\n\u003e [!IMPORTANT]\n\u003e Always remove `bai.cfg` before updating Bash AI to avoid compatibility issues.\n\nYou must provide a [OpenAI API key](https://platform.openai.com/api-keys) in the `key=` field of this file. The [OpenAI API key](https://platform.openai.com/api-keys) can be obtained from your [OpenAI account](https://platform.openai.com/api-keys).\n\n\u003e [!CAUTION]\n\u003e Keeping the key in a plain text file is dangerous, and it is your responsibility to keep it secure.\n\nYou can also change the [GPT model](https://platform.openai.com/docs/models), [temperature](https://platform.openai.com/docs/api-reference/chat/create#chat-create-temperature) and many other things in this file.\n\n## Usage\n\nBash AI operates in two modes: Interactive Mode and Command Mode.\n\nTo enter Interactive Mode, you simply run `bai` without any request. This allows you to continuously interact with Bash AI without needing to re-run the command.\n\nIn Command Mode, you run `bai` followed by your request, like so: `bai your request here`\n\nExample usage:\n\n```\nbai create a new directory with a name of your choice, then create a text file inside it\n```\n\nYou can also ask questions  by ending your request with a question mark:\n```\nbai what is the current time?\n```\n\n## Plugins and tools\n\nPlugins are OpenAI tools that expand Bash AI's functionality, but they are not included in the default Bash AI setup.\\\nAll tools should be placed in your `~/.bai_tools` directory.\\\nYou can see which tools are currently installed by running `bai`, and Bash AI will list them for you.\n\nTools are nothing more than a shell script with a `init` and `execute` function.\\\nYou can find examples and available tools in the [tools folder](https://github.com/Hezkore/bash-ai/tree/main/tools).\\\nFeel free to move them to your `~/.bai_tools` directory to enable them!\n\n## Known Issues\n\n- In Command Mode, avoid using single quotes in your requests.\\\n\tFor instance, the command `bai what's the current time?` will not work. However, both `bai \"what's the current time?\"` and `bai what is the current time?` will execute successfully.\\\n\tPlease note that this issue is specific to the terminal, and does not occur in Interactive Mode.\n\n## Prerequisites\n\n- [OpenAI account and API key](https://platform.openai.com/apps)\n- [curl](https://curl.se/download.html)\n- [jq](https://stedolan.github.io/jq/download/)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhezkore%2Fbash-ai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhezkore%2Fbash-ai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhezkore%2Fbash-ai/lists"}