Os Devil is a cross-platform compiled tool that uses OpenAI's latest models and APIs to execute operating system commands.
"Letting AI run commands on your computer is kind of like selling your soul to the devil..."
Available for Linux, macOS, and Windows.
⚠️ Warning: Os Devil requires an OpenAI API key to run locally. Please treat your API key as sensitive information do not share it or commit it to public repositories.Additionally, using the OpenAI API may incur costs on your account depending on usage.
Option A: Config file
echo "OPENAI_API_KEY=sk-your-key-here" > ~/.devilconfOption B: Environment variable
export OPENAI_API_KEY='your-api-key-here'Option C: Command-line flag
./devil -k "sk-your-key-here" -c "your command"Run the tool with the -c flag followed by your command or task:
# Summon the Devil with a simple command:
devil -c "print a cool devil ASCII art"# Simple command (uses config file defaults)
devil -c "list all files in the current directory"
# Request JSON output
devil -c "which extensions do I use in Cursor, and what are their origins?" --json > list.json
# With verbose output
devil -c "find the largest PDF file in ~/Documents" -v
# With approval required for each command
devil -c "delete old log files" -a
# Override API key
devil -k "sk-custom-key" -c "search which MCP servers are configured"
# Use different model
devil -m "gpt-4" -c "analyze system performance"
# Combine multiple flags
devil -c "check all open network connections on 0.0.0.0" -v -a --json
# Use custom config file
devil --conf /path/to/custom.conf -c "your command"You can create a configuration file to set default values:
# Config file
# OpenAI API Key
OPENAI_API_KEY=sk-your-api-key-here
# Default settings (y/n, yes/no, true/false, 1/0)
JSON=n
VERBOSE=n
APPROVE=n
# Default model
MODEL=gpt-5.2Priority order (highest to lowest):
- Command-line flags
- Config file (
~/.devilconf) - Environment variables (
OPENAI_API_KEY)
An example config file is provided: .devilconf.example
# Download dependencies
go mod download
# Build the binary
go build -o devil main.gomake buildmake installThis will copy the binary to /usr/local/bin/devil (requires sudo).
-c string Command/mission prompt to execute (required)
-v Enable verbose output (default: from config)
-a Approve all commands before execution (default: from config)
--json Request JSON formatted output (default: from config)
-k string OpenAI API key (default: from config or env)
-m string OpenAI model to use (default: gpt-5.2 or from config)
--conf string Path to config file (default: ~/.devilconf)make build-allThis creates binaries in the bin/ directory for:
- macOS Intel (darwin-amd64)
- macOS Apple Silicon (darwin-arm64)
- Linux AMD64 (linux-amd64)
- Linux ARM64 (linux-arm64)
- Windows AMD64 (windows-amd64.exe)
- Windows ARM64 (windows-arm64.exe)
# Windows only
make build-windows
# Linux only
make build-linux
# Current platform
make buildThe tool automatically detects your operating system and uses the appropriate shell:
- Windows: PowerShell (
powershell -Command) - Mac/Linux/Unix: Bourne shell (
sh -c)
Instructions sent to the AI are also customized based on your OS.
You can download a release or compile it yourself. If Apple thinks the binary is suspicious and you trust it, you can use:
xattr -d com.apple.quarantine devil-darwin-amd64