# Ape
Ape is an AI for Linux commands.
```sh
ape "Find all the important PDF files in user/projects. An important PDF file has 'attention' in its name. Write the results to important_files.txt and then move it to Documents."
```
Output:
```text
find ~/user/projects -type f -name "*attention*.pdf" > important_files.txt && mv important_files.txt ~/Documents/
```
Currently, only [OpenAI](https://openai.com/api/) is supported.
To install:
```bash
pipx install ape-linux
```
Next, set your API key:
```bash
export OPENAI_API_KEY=key
```
To run:
```bash
ape "Create a symbolic link called win pointing to /mnt/c/Users/jdoe"
```
Output:
```text
ln -s /mnt/c/Users/jdoe win
```
Another example:
```bash
ape "Delete all the .venv directories under projects/"
```
Output:
```text
find projects/ -type d -name ".venv" -exec rm -rf {} +
```
If you try to ask something unrelated to Linux commands, you should get "Please rephrase." printed:
```bash
ape "Tell me about monkeys"
```
Output:
```text
Please rephrase.
```
You can change the model using `--model`. The default is `gpt-4o`.
See [here](https://platform.openai.com/docs/models) for a list of models. For example:
```bash
ape "List the contents of the working directory with as much detail as possible" --model gpt-3.5-turbo
```
Output:
```text
ls -lha
```
If you pass `--execute`, the tool will run the command for you after printing it! Be careful with this as LLMs often make mistakes:
```bash
ape "Who am I logged in as?"
```
Output:
```text
whoami
jdoe
```
For more help:
```bash
ape --help
```
See also: [Gorilla](https://github.com/gorilla-llm)
Raw data
{
"_id": null,
"home_page": "https://github.com/sbalian/ape",
"name": "ape-linux",
"maintainer": "Seto Balian",
"docs_url": null,
"requires_python": "<4.0,>=3.10",
"maintainer_email": "seto.balian@gmail.com",
"keywords": "ai, llm, linux, openai",
"author": "Seto Balian",
"author_email": "seto.balian@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/02/ba/59be729715cd0f25825d6fd06fcf392140a3c894b0f277a214e1a2e95bb9/ape_linux-0.1.0.tar.gz",
"platform": null,
"description": "# Ape\n\nApe is an AI for Linux commands.\n\n```sh\nape \"Find all the important PDF files in user/projects. An important PDF file has 'attention' in its name. Write the results to important_files.txt and then move it to Documents.\"\n```\n\nOutput:\n\n```text\nfind ~/user/projects -type f -name \"*attention*.pdf\" > important_files.txt && mv important_files.txt ~/Documents/\n```\n\nCurrently, only [OpenAI](https://openai.com/api/) is supported.\n\nTo install:\n\n```bash\npipx install ape-linux\n```\n\nNext, set your API key:\n\n```bash\nexport OPENAI_API_KEY=key\n```\n\nTo run:\n\n```bash\nape \"Create a symbolic link called win pointing to /mnt/c/Users/jdoe\"\n```\n\nOutput:\n\n```text\nln -s /mnt/c/Users/jdoe win\n```\n\nAnother example:\n\n```bash\nape \"Delete all the .venv directories under projects/\"\n```\n\nOutput:\n\n```text\nfind projects/ -type d -name \".venv\" -exec rm -rf {} +\n```\n\nIf you try to ask something unrelated to Linux commands, you should get \"Please rephrase.\" printed:\n\n```bash\nape \"Tell me about monkeys\"\n```\n\nOutput:\n\n```text\nPlease rephrase.\n```\n\nYou can change the model using `--model`. The default is `gpt-4o`.\nSee [here](https://platform.openai.com/docs/models) for a list of models. For example:\n\n```bash\nape \"List the contents of the working directory with as much detail as possible\" --model gpt-3.5-turbo\n```\n\nOutput:\n\n```text\nls -lha\n```\n\nIf you pass `--execute`, the tool will run the command for you after printing it! Be careful with this as LLMs often make mistakes:\n\n```bash\nape \"Who am I logged in as?\"\n```\n\nOutput:\n\n```text\nwhoami\njdoe\n```\n\nFor more help:\n\n```bash\nape --help\n```\n\nSee also: [Gorilla](https://github.com/gorilla-llm)\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "AI for Linux commands",
"version": "0.1.0",
"project_urls": {
"Homepage": "https://github.com/sbalian/ape",
"Repository": "https://github.com/sbalian/ape"
},
"split_keywords": [
"ai",
" llm",
" linux",
" openai"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "c25f71eab9c614c404d527395efdd5969fc01a54250ece8f25177033e79e2348",
"md5": "08eb64f3161b0d76caf11948ebebc148",
"sha256": "06f51c66aa893f5e81eacd0b38cdcfbe196bbf96644598320ec5ed77fdfe0ca7"
},
"downloads": -1,
"filename": "ape_linux-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "08eb64f3161b0d76caf11948ebebc148",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.10",
"size": 4997,
"upload_time": "2024-05-26T19:15:37",
"upload_time_iso_8601": "2024-05-26T19:15:37.365507Z",
"url": "https://files.pythonhosted.org/packages/c2/5f/71eab9c614c404d527395efdd5969fc01a54250ece8f25177033e79e2348/ape_linux-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "02ba59be729715cd0f25825d6fd06fcf392140a3c894b0f277a214e1a2e95bb9",
"md5": "a9cb96621889a25bf364415850f2ef06",
"sha256": "2e55b1b2a9818ae496301189582eb13a624aaa68c123611243e96e821218c1be"
},
"downloads": -1,
"filename": "ape_linux-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "a9cb96621889a25bf364415850f2ef06",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.10",
"size": 4026,
"upload_time": "2024-05-26T19:15:38",
"upload_time_iso_8601": "2024-05-26T19:15:38.662675Z",
"url": "https://files.pythonhosted.org/packages/02/ba/59be729715cd0f25825d6fd06fcf392140a3c894b0f277a214e1a2e95bb9/ape_linux-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-05-26 19:15:38",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "sbalian",
"github_project": "ape",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "ape-linux"
}