MeowTerm is an AI-powered terminal emulator built with Electron, xterm.js, and Vite. It seamlessly integrates a powerful terminal environment with a context-aware AI chat assistant to boost your productivity. Designed with a sleek, customizable interface and robust functionality, MeowTerm brings intelligent automation directly to your command line.
MeowTerm embeds an AI directly alongside your terminal. The assistant uses advanced tools to understand what you're doing and take action on your behalf:
- Screen & History Analysis: The AI can read the visible terminal screen and fetch command history (up to 500 lines) to provide highly contextual answers and solutions based on your recent workflow.
- Smart Execution: Safely run shell commands directly from the chat. MeowTerm guarantees that standard shell commands are executed only when the terminal is idle at a prompt, avoiding disastrous input collisions.
- Interactive TUI Support: Interact with running TUI applications (like
vim,nano, or interactive prompts) using thetype_keyboardtool, sending keystrokes and control characters (e.g.,<enter>,<tab>,<esc>). - File System Inspection: Fetch and read files or list directory contents straight from the chat, allowing the AI to debug issues or explain codebase logic.
- Engaging UI Elements: Real-time tools execution indicators and a progressive, fluid typewriter animation for AI text responses.
- Powered by
node-ptyand@xterm/xterm, delivering reliable terminal execution performance. - Automatically launches
pwsh.exeorcmd.exeon Windows, and defaults tobashorzshon macOS/Linux. Alternatively, you can override the target shell via configuration. - Support for auto-resizing (
@xterm/addon-fit) and clickable web links (@xterm/addon-web-links).
- Out of the box, it features a modern, dark-themed scheme with distinct color mappings and custom window dimensions.
- A toggleable and seamlessly resizable chat panel with drag-to-resize functionality to maximize your terminal workspace when needed.
- Load custom setup from
~/.meowterm.json—including customizedapiKeysources, base AI models, font families, font sizes, and specific shell environments.
- Node.js (v16.x or newer is recommended)
- Configured
.meowterm.jsonfile in your system's Home directory containing your API details and optional visual preferences.
Clone the repository, install dependencies, and run the app:
# Install required dependencies
npm install
# Start the application in development mode
npm startTo produce a standalone application or installer specific to your OS:
# Package the application for distribution
npm run package
# Build installer executables (like .exe for Windows)
npm run makepackage.json: Manages the Electron Forge pipeline and external dependencies (@xterm/xterm,node-pty,openai).src/main.js: Main process entry point. Defines window properties, instantiates the PTY pseudo-terminal using the detected or configured shell, and establishes the IPC pipeline bridging the AI service context and PTY callbacks.src/main/ai-service.js&src/main/tools.js: Manages OpenAI chat context, and interprets the system tool loop—validating executing actions likecapture_current_screen,fetch_file,type_keyboard, andrun_commandin your local environment.src/renderer.js: Orchestrates UI logic, rendering the customizedxterminstance, dynamically refreshing DOM styles from settings, and managing bidirectional user interaction (chat messages matching user/assistant roles).src/index.css: Vanilla CSS responsible for the application's clean design, chat scrolling mechanics, and markdown message rendering layers.
You can customize MeowTerm by creating a .meowterm.json file in your home directory:
{
"apiKey": "YOUR_OPENAI_API_KEY",
"model": "gpt-4o-mini",
"baseURL": "https://api.openai.com/v1",
"terminal": {
"shell": "pwsh.exe",
"fontFamily": "JetBrains Mono",
"fontSize": 14
},
"chat": {
"fontFamily": "Inter",
"fontSize": 13
}
}This project is licensed under the MIT License. Created by Sky Li.