Natural language CLI that converts instructions into shell commands using LLMs
Project description
phi
phi is a global CLI tool that converts natural‑language instructions into real shell commands using LLMs and executes them on your machine.
Example:
phi apply the current stash
phi show processes running on port 6379
phi kill the process on port 6379
Installation
Install phi globally using pip:
pip install phi
Verify installation:
phi --help
The phi command is now available globally in your terminal.
LLM API Keys
phi currently uses OpenAI by default.
You must export an API key before running any command.
OpenAI
export OPENAI_API_KEY="sk-..."
To make this persistent, add it to your shell config file:
~/.zshrc~/.bashrc~/.profile
First Run & Configuration
On the first run, phi automatically creates a user‑level configuration file that stores environment information such as OS, shell, and tool preferences.
Config file location
-
macOS / Linux
~/.config/phi/config.json -
Windows
%APPDATA%\phi\config.json
Config File Structure
Example config.json:
{
"os": "Darwin",
"shell": "zsh",
"provider": "openai",
"preferred_tools": [
{
"name": "git",
"description": "Use git commands assuming GitLab remotes and standard workflows"
},
{
"name": "lsof",
"description": "Use lsof on macOS instead of Linux tools like fuser"
}
]
}
Fields
-
os
Automatically detected operating system (Darwin,Linux,Windows). -
shell
Detected from your environment (zsh,bash, etc.). -
provider
LLM provider to use (openaiby default). -
preferred_tools
Optional list of tools thatphishould prefer when generating commands.Each tool entry contains:
name: tool namedescription: how and when the tool should be used
You can edit this file manually at any time.
Usage
Run phi followed by a natural‑language instruction:
phi list all git branches
phi check if redis is running
phi show processes using port 6379
phi will:
- Convert your instruction into shell commands using an LLM
- Execute them in your terminal
- Print the output
Notes
phiexecutes real shell commands — use with care- Commands are generated to match your OS automatically
- Safety checks, retries, and confirmations are planned for future versions
License
MIT
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 pyphi_cli-0.1.0.tar.gz.
File metadata
- Download URL: pyphi_cli-0.1.0.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e2af5bb7167fc7ba947051382a27e9fe9ea865630c2b2b3091fd25d0da1a3600
|
|
| MD5 |
6b2738203267078d11df1cd4a3507430
|
|
| BLAKE2b-256 |
4eb48ecae5e894cce930270cdbff41b2c6265948e2b1f200ea02a295579d7cfc
|
File details
Details for the file pyphi_cli-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pyphi_cli-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a9a68f8bcefa4f0245195dc5fed2fe1af24f8b42a86d0db80f898bfa96a645c1
|
|
| MD5 |
235ab1b4955358ba7faf16de484c0376
|
|
| BLAKE2b-256 |
16af170206c8317f84b012af6ed824457fd9bb8a699de24248d6a2fc2ae367be
|