Skip to content

ZayanMuhammed/Ai-terminal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

image

🚀 SSH Command Analyzer with Google Gemini AI

Node Version License Powered by Genimi

A Node.js CLI tool that connects to a remote SSH server, executes commands, and uses Google Generative AI (Gemini) to analyze and summarize command outputs in real-time.


✨ Features

  • 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.

🛠 Requirements

  • Node.js v20+
  • NPM or Yarn
  • Google Generative AI API Key (Gemini model access)
  • SSH server credentials

📥 Installation

  1. Clone the repository:
git clone https://github.com/ZayanMuhammed/Ai-terminal.git
cd Ai-terminal
  1. Install dependencies:
npm install
  1. 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

▶ Usage

  1. Start the CLI:
npx tsx index.ts

You 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.

💻 Example

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 `..`)

📦 Dependencies

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.

🕵 Authors

Hope you like it.

About

A Node.js CLI tool that connects to a remote SSH server, executes commands, and uses Google Generative AI (Gemini) to analyze and summarize command outputs in real-time.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors