AI for Linux commands
Project description
Ape
Ape is an AI for Linux commands.
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:
find ~/user/projects -type f -name "*attention*.pdf" > important_files.txt && mv important_files.txt ~/Documents/
Ape works with any provider supported by Pydantic AI — OpenAI, Anthropic, Google, Groq, Mistral and more.
To install (uv recommended):
uv tool install ape-linux
Next, set the API key for your provider using its standard environment variable. For example:
export OPENAI_API_KEY=key # for OpenAI models
export ANTHROPIC_API_KEY=key # for Anthropic models
To run:
ape "Create a symbolic link called win pointing to /mnt/c/Users/jdoe"
Output:
ln -s /mnt/c/Users/jdoe win
Another example:
ape "Delete all the .venv directories under projects/"
Output:
find projects/ -type d -name ".venv" -exec rm -rf {} +
If you try to ask something unrelated to Linux commands:
ape "Tell me about monkeys"
you should get:
echo "Please try again."
You can change the model with the APE_MODEL environment variable. Models are
specified in provider:name form.
See here for the supported providers and models.
For example:
export APE_MODEL=anthropic:claude-sonnet-4-5
If APE_MODEL is unset, the default openai-chat:gpt-4.1 is used.
System-aware suggestions
Ape automatically detects a few facts about your machine and adds them to the prompt so
the suggested command is correct for your environment — for example BSD (macOS) vs GNU
(Linux) flags, the right package manager (brew, apt, dnf, pacman, ...), and tools
that are actually installed. It looks at:
- operating system and version (macOS version or Linux distribution),
- whether the userland is BSD or GNU,
- CPU architecture (e.g.
arm64vsx86_64), - your shell (
$SHELL), - whether you are root,
- available package manager(s) and common tools (
rg,fd,jq,docker, ...).
This is all gathered locally with the Python standard library and is best-effort: if anything can't be determined it is simply left out. No identifying information is collected or sent — never your username, hostname, working directory, or home path.
To see exactly what Ape detects and sends (without calling the model), run
ape-system-info:
ape-system-info
Output (example):
Operating system: Darwin
macOS version: 26.5
Userland: BSD (macOS) — prefer BSD-compatible flags
Architecture: arm64
Shell: /bin/zsh
Privileges: non-root (use sudo for privileged actions)
Package manager(s): brew
Available tools: rg, fd, jq, git, curl, docker, tar, rsync, sed, awk
See also: Gorilla
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ape_linux-0.4.1.tar.gz.
File metadata
- Download URL: ape_linux-0.4.1.tar.gz
- Upload date:
- Size: 96.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.18 {"installer":{"name":"uv","version":"0.11.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3b487f01e3ef92c8f06f32a4680ae1414159d048c7cc5874ae705ff87771cd82
|
|
| MD5 |
b38097a488617f6fc5a80636b28c6dee
|
|
| BLAKE2b-256 |
e9701054740a332c2d4a360a153024a01f04649d19184d5948f7aa5a94d41360
|
File details
Details for the file ape_linux-0.4.1-py3-none-any.whl.
File metadata
- Download URL: ape_linux-0.4.1-py3-none-any.whl
- Upload date:
- Size: 7.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.18 {"installer":{"name":"uv","version":"0.11.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
40ecb9c34dce471edf10fc19d355d2a92b38fb17f4220f48957beca31738bd09
|
|
| MD5 |
b842bd3bb5df2ce9876229d8381aebde
|
|
| BLAKE2b-256 |
adec0ceb88094ba12cd00a3434d10a7c07198186991981f48090edc3f7caa03d
|