{"id":13408067,"url":"https://github.com/iivvoo/clai","last_synced_at":"2026-01-26T00:41:15.069Z","repository":{"id":217684667,"uuid":"741920394","full_name":"iivvoo/clai","owner":"iivvoo","description":"Command Line AI","archived":false,"fork":false,"pushed_at":"2024-01-18T07:57:26.000Z","size":28,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-07-31T20:28:56.696Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/iivvoo.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-11T11:40:23.000Z","updated_at":"2024-01-19T12:48:55.000Z","dependencies_parsed_at":"2024-01-17T23:01:23.113Z","dependency_job_id":"7d261c3b-dd9f-4d7a-8545-ba7dcf522c56","html_url":"https://github.com/iivvoo/clai","commit_stats":null,"previous_names":["iivvoo/clai"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iivvoo%2Fclai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iivvoo%2Fclai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iivvoo%2Fclai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iivvoo%2Fclai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iivvoo","download_url":"https://codeload.github.com/iivvoo/clai/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243578461,"owners_count":20313833,"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":[],"created_at":"2024-07-30T20:00:50.543Z","updated_at":"2026-01-26T00:41:15.028Z","avatar_url":"https://github.com/iivvoo.png","language":"Go","funding_links":[],"categories":["\u003ca name=\"ai\"\u003e\u003c/a\u003eAI / ChatGPT"],"sub_categories":[],"readme":"# CLAI - Command Line AI\n\n`clai` is a command line integration for openai. It's setup to help you learn\nnew shell commands and construct more complex commands. E.g.\n\n    $ clai \"group a tab separated file by first column, sum them by third column\"\n    awk -F'\\t' '{sum[$1] += $3} END {for(group in sum) print group, sum[group]}' file.txt\n\n    This command uses awk to read a tab-separated file, it creates an array 'sum' where the keys are the values in the first column and the values are the sum of the third column for each group. Finally, it prints the group and the sum.\n\nand\n\n    $ clai \"find the largest file\"\n    To find the largest file in a directory and its subdirectories, you can use the `find` and `du` commands together:\n\n    ```bash\n    find /path/to/directory -type f -exec du -sh {} + | sort -rh | head -n 1\n    ```\n\n    This command will find all the files in the specified directory and its subdirectories, calculate their sizes using `du`, sort them in descending order, and display the largest file with its size.\n\nBy default it assumes a gnu / linux / bash environment, but by explicitly mentioning, e.g. macos or powershell you can get\nit to provide solutions for other environments.\n\n    C:\\\u003e clai.exe \"find the largest file using powershell\"\n    To find the largest file using PowerShell, you can use the following command:\n\n    ```powershell\n    Get-ChildItem -File | Sort-Object -Property Length -Descending | Select-Object -First 1\n    ```\n\n    This command uses the `Get-ChildItem` cmdlet to list all files in the current directory, piped to `Sort-Object` to sort them by file size in descending order, and then piped to `Select-Object` to select just the first (largest) file.\n\n## Install\n\n```\n$ git clone https://github.com/iivvoo/clai.git\n$ make\n```\n\nYour binary will be in `bin/clai`\n\nReleases for several architectures including linux, macos and windows are available on the [Releases](https://github.com/iivvoo/clai/releases) page.\n\n\n## Prerequisites and configuration\n\nYou will need an OpenAI api key. Open https://platform.openai.com/account/api-keys to create a key, create an\naccount if necessary. New users get some free credit but at some point you will need to pay for API access.\nThe (default) GPT3Dot5Turbo model should work really well and is very price efficient.\n\nConfiguration is done through a config.yml file that can be placed in $HOME/.clai/ or $HOME/.config/clai/\n\nHere you can also tweak the system prompt (make it more suitable to your needs or environment) and disable the disclaimer once you  get fed up with it and are aware that you should always double check anything generated or suggested by an AI\n\nAlternatively you can just set the `OPENAI_APIKEY` or `CLAI_APIKEY` environment variable with your key and run on defaults.\n\nYou can run `clai defaults` to see the known models and the default system prompt.\n\n\n## License\n\nclai is open source and available under the MIT License. See LICENSE.txt\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiivvoo%2Fclai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiivvoo%2Fclai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiivvoo%2Fclai/lists"}