{"id":28174716,"url":"https://github.com/ricopinazo/comai","last_synced_at":"2025-05-15T22:19:35.257Z","repository":{"id":165722099,"uuid":"632668511","full_name":"ricopinazo/comai","owner":"ricopinazo","description":"An AI powered terminal assistant","archived":false,"fork":false,"pushed_at":"2024-05-22T06:11:18.000Z","size":13353,"stargazers_count":7,"open_issues_count":8,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-05-23T00:11:38.679Z","etag":null,"topics":["ai","chatgpt","cli","openai-api","shell"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ricopinazo.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":"2023-04-25T22:16:59.000Z","updated_at":"2024-05-22T06:11:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"32056090-f9da-4dac-96c4-fd0cf23f12ac","html_url":"https://github.com/ricopinazo/comai","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricopinazo%2Fcomai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricopinazo%2Fcomai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricopinazo%2Fcomai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricopinazo%2Fcomai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ricopinazo","download_url":"https://codeload.github.com/ricopinazo/comai/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254430292,"owners_count":22069909,"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","chatgpt","cli","openai-api","shell"],"created_at":"2025-05-15T22:18:15.176Z","updated_at":"2025-05-15T22:19:35.249Z","avatar_url":"https://github.com/ricopinazo.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/ricopinazo/comai/main/logo.svg\" alt=\"comai\" width=\"200\"/\u003e\n\n**The AI powered terminal assistant**\n\n[![Tests](https://github.com/ricopinazo/comai/actions/workflows/tests.yml/badge.svg)](https://github.com/ricopinazo/comai/actions/workflows/tests.yml)\n[![Latest release](https://img.shields.io/github/v/release/ricopinazo/comai?color=brightgreen\u0026include_prereleases)](https://github.com/ricopinazo/comai/releases)\n[![PyPI](https://img.shields.io/pypi/v/comai)](https://pypi.org/project/comai/)\n[![Issues](https://img.shields.io/github/issues/ricopinazo/comai?color=brightgreen)](https://github.com/ricopinazo/comai/issues)\n[![PyPI - Downloads](https://img.shields.io/pypi/dm/comai)](https://pypi.org/project/comai/)\n[![License GPLv3](https://img.shields.io/badge/license-GPLv3-blue.svg)](./LICENSE)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n[![Checked with mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/)\n\n\u003c/div\u003e\n\n## What is comai? 🎯\n\n`comai` is an open source CLI utility that translates natural language instructions into executable commands.\n\n\u003cdiv align=\"left\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/ricopinazo/comai/627d94d39430bb574582f51cc64700012e9c28ce/demo.gif\" alt=\"demo\" width=\"350\"/\u003e\n\u003c/div\u003e\n\n## Installation 🚀\n\n`comai` is available as a python package. We recommend using [`pipx`](https://pypa.github.io/pipx/) to install it:\n\n```shell\npipx install comai\n```\n\nBy default, `comai` is setup to use [ollama](https://ollama.com) under the hood, which allows you to host any popular open source LLM locally. If you are happy with this, make sure to install and have ollama running. You can find the install instructions [here](https://ollama.com/download).\n\nOnce installed, make sure to download the `llama3` model, since comai has been optimised for it\n\n```shell\nollama pull llama3\n```\n\nOtherwise, you can set up any other model available in the ollama service via:\n\n```shell\ncomai --config\n```\n\n\u003e **_NOTE:_** `comai` uses the environment variable `TERM_SESSION_ID` to maintain context between calls so you don't need to repeat yourself giving instructions to it. You can check if it is available in your default terminal checking the output of `echo $TERM_SESSION_ID`, which should return some type of UUID. If the output is empty, you can simply add the following to your `.zshrc`/`.bashrc` file:\n\u003e\n\u003e ```shell\n\u003e export TERM_SESSION_ID=$(uuidgen)\n\u003e ```\n\n## Usage examples 🎉\n\nUsing `comai` is straightforward. Simply invoke the `comai` command followed by your natural language instruction. `comai` will provide you with the corresponding executable command, which you can execute by pressing Enter or ignore by pressing any other key.\n\nLet's dive into some exciting examples of how you can harness the power of `comai`:\n\n1. Access network details:\n\n```\n$ comai print my public ip address\n❯ curl -s4 ifconfig.co\n92.234.58.146\n```\n\n2. Manage `git` like a pro:\n\n```shell\n$ comai rename the current branch to awesome-branch\n❯ git branch -m $(git rev-parse --abbrev-ref HEAD) awesome-branch\n\n$ comai show me all the branches having commit c4c0d2d in common\n❯ git branch -a --contains c4c0d2d\n  main\n  fix/terrible-bug\n* awesome-branch\n```\n\n3. Find the annoying process using the port 8080:\n\n```shell\n$ comai show me the process using the port 8080\n❯ lsof -i :8080\nCOMMAND   PID      USER   FD   TYPE            DEVICE SIZE/OFF NODE NAME\nnode    36350 pedrorico   18u  IPv4 0xe0d28ea918e376b      0t0  TCP *:http-alt (LISTEN)\n```\n\n4. Get rid of all your docker containers:\n\n```shell\n$ comai stop and remove all running docker containers\n❯ docker stop $(docker ps -aq) \u0026\u0026 docker rm $(docker ps -aq)\n```\n\n## Contributions welcome! 🤝\n\nIf you're interested in joining the development of new features for `comai`, here's all you need to get started:\n\n1. Clone the [repository](https://github.com/ricopinazo/comai) and navigate to the root folder.\n2. Install the package in editable mode by running `pip install -e .`.\n3. Run the tests using `pytest`.\n4. Format your code using [black](https://github.com/psf/black) before submitting any change.\n\n## License 📜\n\nComai is licensed under the GPLv3. You can find the full text of the license in the [LICENSE](./LICENSE) file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fricopinazo%2Fcomai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fricopinazo%2Fcomai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fricopinazo%2Fcomai/lists"}