- Connect to any SSH server using environment variable credentials.
- Execute commands directly from the terminal.
- AI analyzes and summarizes SSH output automatically.
- Color-coded console output for readability using chalk.
- Clean exit with
exit.
- Node.js v20+
- NPM or Yarn
- Google Generative AI API Key (Gemini model access)
- SSH server credentials
- Clone the repository:
git clone https://github.com/ZayanMuhammed/Ai-terminal.git
cd Ai-terminal- Install dependencies:
npm install- Create a .env file in the project root:
API_KEY=your_google_generative_ai_api_key
SSH_HOST=your_ssh_host
SSH_PORT=22
SSH_USR=your_ssh_username
SSH_PASSWORD=your_ssh_password- Start the CLI:
npx tsx index.tsYou will see a prompt:
command:-
Type any SSH command, e.g., ls -la.
-
Command output will appear in green.
-
AI analysis will appear in yellow below the output.
-
Type exit to quit the CLI.
command: ls -la
📦 SSH Output:
total 12
drwxr-xr-x 2 user user 4096 Oct 10 19:00 .
drwxr-xr-x 3 user user 4096 Oct 10 18:59 ..
-rw-r--r-- 1 user user 45 Oct 10 18:59 README.md
🤖 AI:
The remote directory contains 2 folders (`.` and `..`)
ssh2 – SSH client for Node.js
@google/generative-ai – Google Gemini AI SDK
chalk – Colorized console output
dotenv – Environment variable loader
Caution
Ensure your Google Generative AI API key is valid and has access to gemini-2.0-flash.
- Name: Zayan Muhammed
- Email: zayan.shameermv@gmail.com
Hope you like it.