ape-linux


Nameape-linux JSON
Version 0.2.1 PyPI version JSON
download
home_pagehttps://github.com/sbalian/ape
SummaryAI for Linux commands
upload_time2024-09-15 19:44:26
maintainerSeto Balian
docs_urlNone
authorSeto Balian
requires_python<4.0,>=3.10
licenseMIT
keywords ai llm linux openai
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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 OpenAI API key:

```bash
export APE_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:

```bash
ape "Tell me about monkeys"
```

you should get:

```text
echo "Please try again."
```

You can change the model using `--model` or `-m`. 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` or `-e`, 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/24/35/ca1953ec2cea814b30fe1ae134f47bc4f2bad5a27f89f6453132cf352593/ape_linux-0.2.1.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 OpenAI API key:\n\n```bash\nexport APE_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:\n\n```bash\nape \"Tell me about monkeys\"\n```\n\nyou should get:\n\n```text\necho \"Please try again.\"\n```\n\nYou can change the model using `--model` or `-m`. 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` or `-e`, 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.2.1",
    "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": "59cfd455b8bdeaba25ae4ba4d147dc06541cd4225d7303b1416377622ff6171e",
                "md5": "262eacd42f5d7cf95e7539dc8e0cd777",
                "sha256": "18bc665659906a1d9e0e0325a0525ffbbb5f227f1b5d621f2189790aab0ff8e4"
            },
            "downloads": -1,
            "filename": "ape_linux-0.2.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "262eacd42f5d7cf95e7539dc8e0cd777",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.10",
            "size": 4338,
            "upload_time": "2024-09-15T19:44:25",
            "upload_time_iso_8601": "2024-09-15T19:44:25.142428Z",
            "url": "https://files.pythonhosted.org/packages/59/cf/d455b8bdeaba25ae4ba4d147dc06541cd4225d7303b1416377622ff6171e/ape_linux-0.2.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2435ca1953ec2cea814b30fe1ae134f47bc4f2bad5a27f89f6453132cf352593",
                "md5": "9d982cd0e30c02ce39f6d1659b091bd9",
                "sha256": "a62041f6d6971d4ede622a0642afd676ed11520e8421e1dd2307582c4c3d059c"
            },
            "downloads": -1,
            "filename": "ape_linux-0.2.1.tar.gz",
            "has_sig": false,
            "md5_digest": "9d982cd0e30c02ce39f6d1659b091bd9",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.10",
            "size": 3654,
            "upload_time": "2024-09-15T19:44:26",
            "upload_time_iso_8601": "2024-09-15T19:44:26.518066Z",
            "url": "https://files.pythonhosted.org/packages/24/35/ca1953ec2cea814b30fe1ae134f47bc4f2bad5a27f89f6453132cf352593/ape_linux-0.2.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-15 19:44:26",
    "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"
}
        
Elapsed time: 1.18518s