✦ v3.0 — Full API Key Management + Env Vars + 23 Providers

The AI-Powered
Terminal .app

A native macOS application with 23 AI providers built in. Errors get analyzed. Commands get explained. Dangerous operations get blocked. npm install or drag to Applications — done.

Built with SwiftUI + real forkpty(). Ships as a real .app bundle. Available on npm. No Electron. No web views.

⬡ Swift 5.9+ ◆ 23 Providers ▣ Native macOS ▪ npm ◇ MIT License
Get Started View Source
23
AI Providers
5
Client Types
26
Error Patterns
npm
Published
0
Electron
AI Terminal — zsh — ~/project
npm run build
 
ERROR in src/index.ts(42,5)
TS2345: Argument of type 'string' is not assignable
to parameter of type 'number'.
 
── AI detected error. Analyzing with Groq (0.3s) ──
 
TypeScript found a type mismatch on line 42. You're passing
a string where a number is expected.
 
```bash
sed -i '' 's/userId/Number(userId)/' src/index.ts ✓ Safe
```
 
[▶ Run] [📋 Copy] [💡 Explain] Groq · llama-3.3-70b · 0.3s

Why AI Terminal?

Every feature a developer needs, built into one native terminal.

📦

Native .app Bundle

Real macOS application — shows in Dock, Launchpad, Spotlight. Custom app icon. Auto-installs ait CLI on first launch.

🖥️

Real PTY Terminal

Full zsh with login shell, ANSI 256-color, tab completion, and command history. Native forkpty() — not a web view or emulator.

🤖

23 AI Providers

From local Ollama to cloud GPT-4o, Claude, Gemini, Groq, DeepSeek and 17 more. Auto mode picks the best available provider.

🔑

Full API Key Management

Configure keys for every provider. Auto-detects env vars (OPENAI_API_KEY, etc). Dashboard links. Test Connection button.

🔍

Auto Error Detection

26 regex patterns detect errors in terminal output — tracebacks, compiler errors, exit codes. One-click AI analysis.

🛡️

Safety Layer

Blocks rm -rf /, fork bombs, dd on disks. Warns on sudo, force pushes, DROP TABLE. Detects leaked API keys and tokens.

🧠

Memory Store

Remembers past errors and solutions in a persistent JSON store. Feeds them back to AI for smarter, project-aware answers.

Token Streaming

AI responses stream token-by-token in real time via SSE. Groq and Cerebras deliver full answers in under a second.

💡

Command Extraction

AI extracts runnable commands from its responses with safety ratings. Run, copy, or explain with one click.

📂

Context Engine

Auto-detects project type (Node, Python, Rust, Go, Swift, etc.), git branch, and dependencies. AI gets full context.

📑

Multi-Session

Open multiple terminal tabs, each with its own PTY process, AI conversation, and command history.

23 Providers

Local, cloud, or free — pick the AI that fits your workflow.

Ollama
Local Free, offline
LM Studio
Local Free, offline
Pollinations
Free No key needed
OpenAI
Cloud GPT-4o
Anthropic
Cloud Claude Sonnet
Google Gemini
Cloud Gemini 2.0
Mistral
Cloud Codestral
xAI
Cloud Grok-3
DeepSeek
Cloud V3, R1
Cohere
Cloud Command R+
AI21
Cloud Jamba 1.5
Groq
Fast <1s responses
Cerebras
Fast Ultra-fast
SambaNova
Fast Enterprise
Fireworks
Fast Inference
Together
Fast 100+ models
Lepton
Fast Serverless
OpenRouter
Hub 200+ models
DeepInfra
Hub Open models
Perplexity
Hub Search AI
HuggingFace
Hub Open-source
Replicate
Hub Run anything

Full-Featured CLI

Use AI Terminal inside your existing terminal. Every feature, headless.

Install: ait

The CLI version has every feature from the GUI — safety layer, memory store, context engine, all 23 providers with streaming, interactive REPL, and piped error analysis. Install via npm i -g ai-terminal-app or the .app auto-installs it.

ait "question" Ask the AI anything
ait -i Interactive REPL mode
ait --analyze Analyze piped input
ait --explain CMD Explain a command
ait --run CMD Run with AI error analysis
ait --safety CMD Check command safety
ait --provider NAME Pick a specific provider
ait --config Configure API keys
# Ask a question
$ ait "find large files on macOS"
 
# Pipe errors for analysis
$ npm run build 2>&1 | ait --analyze
 
# Safety check
$ ait --safety "rm -rf /"
✕ BLOCKED: Recursive deletion from root
 
$ ait --safety "git push --force"
⚠ Caution: Force push to remote
 
# Interactive mode
$ ait -i
!cargo build
error[E0308]: mismatched types
Analyzing with Groq...

Built-In Safety

Every command is evaluated before execution. Secrets are scanned in real time.

Blocked

Prevented from running. No override.

rm -rf / :(){ :|:& };:
mkfs dd of=/dev/sda

Caution

Warning shown. Confirmation required.

sudo git push --force
DROP TABLE curl | sh

Safe

Runs normally. No intervention.

ls -la git status
npm install cargo build

Get Started

macOS 14+ and Swift 5.9+. npm install or build once and drag to Applications.

npm install Easiest

One command. Installs ait CLI globally. Builds from source.

npm install -g ai-terminal-app
ait --help

Download .dmg

Build a drag-to-install DMG — open it and drag to Applications.

git clone https://github.com/3289david/ai-terminal
cd ai-terminal
make dmg

Install the .app

Build .app → copy to /Applications. Auto-installs ait CLI on first launch.

make install
# ait CLI auto-installed to /usr/local/bin

Install CLI (ait)

Headless CLI with all features for any terminal.

make install-cli
# installs ait to /usr/local/bin
ait --help

Under the Hood

Clean architecture. Easy to extend. Add a provider in 5 lines.

. ├── Package.swift # SPM manifest ├── package.json # npm (npm i -g ai-terminal-app) ├── Makefile # make app / make install / make run ├── bin/ │ └── ait # Node.js wrapper for npm ├── scripts/ │ └── postinstall.js # Builds native binary on npm install ├── Scripts/ │ ├── build-app.sh # Assembles AI Terminal.app (+ bundles ait) │ └── generate-icon.swift # CoreGraphics icon generator ├── Sources/ │ ├── CPty/ # C wrapper around forkpty() │ ├── AITerminal/ # SwiftUI macOS app │ │ ├── AITerminalApp.swift # @main entry point │ │ ├── Models/ │ │ │ ├── AIProvider.swift # 23 provider definitions │ │ │ ├── AppState.swift # @Observable app state │ │ │ └── Message.swift # Message types │ │ ├── Services/ │ │ │ ├── AIRouter.swift # Routes to correct client │ │ │ ├── SafetyLayer.swift # Command safety evaluation │ │ │ ├── MemoryStore.swift # Error/solution persistence │ │ │ ├── ContextEngine.swift# Project type detection │ │ │ ├── ANSIParser.swift # Full SGR + 256-color parser │ │ │ └── *Client.swift # 5 streaming client types │ │ └── Views/ │ │ ├── ContentView.swift # Main split view layout │ │ ├── TerminalView.swift # PTY terminal emulator │ │ └── AIResponsePanel.swift# Streaming AI side panel │ └── AITerminalCLI/ # Headless CLI (brew) │ └── CLI.swift # All features, one file └── docs/ └── index.html # GitHub Pages website