Skip to content

VaibhavCodeClub/term

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

30 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Term - Minimal AI Terminal Assistant

A cross-platform, AI-powered terminal assistant with custom commands, local API key storage, and autocompletion. Built using Tauri v2.5, React, and Rust.


πŸš€ Purpose

Term aims to provide a minimal, extensible terminal-like interface enhanced with AI capabilities. It supports custom shell commands, natural language queries, and secure local API key management, making it a powerful productivity tool for developers and power users.


✨ Key Features

  • Terminal-like UI with command history and autocompletion
  • AI-powered responses for natural language queries
  • Custom shell command execution (with sudo/password support)
  • Secure local storage for API keys
  • Cross-platform: Linux, Windows, macOS (experimental)
  • Colorful output and user-friendly design

πŸ› οΈ Technologies Used

  • Frontend: React, TypeScript, TailwindCSS, Vite
  • Backend: Rust, Tauri
  • Testing: Vitest, Jest, Testing Library
  • Linting/Formatting: ESLint, Prettier, Husky

πŸ“ Project Structure

term/
β”œβ”€β”€ src/              # React frontend (components, hooks, utils, styles)
β”œβ”€β”€ src-tauri/        # Rust backend (Tauri commands, API key mgmt, shell)
β”œβ”€β”€ public/           # Static assets
β”œβ”€β”€ __tests__/        # Unit and integration tests
β”œβ”€β”€ package.json      # Node.js dependencies and scripts
β”œβ”€β”€ tailwind.config.js# TailwindCSS config
β”œβ”€β”€ vite.config.ts    # Vite config
β”œβ”€β”€ README.md         # Project documentation
└── ...               # Other configs and assets

πŸ–₯️ Installation & Setup

Prerequisites

1. Clone the repository

git clone https://github.com/sapatevaibhav/term.git
cd term

2. Install system dependencies

Linux (Arch):

sudo pacman -S --needed base-devel webkit2gtk rsvg2

Linux (Debian/Ubuntu):

sudo apt update
sudo apt install build-essential libwebkit2gtk-4.1-dev librsvg2-dev

Windows:

3. Install Rust and Cargo

# Linux/macOS/Windows (via rustup)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# Restart your terminal or run:
source $HOME/.cargo/env
rustup default stable

4. Install Tauri CLI

cargo install create-tauri-app tauri-cli

5. Install Node.js dependencies

npm install  # or pnpm install

6. Run the app

npx tauri dev  # or npm run tauri dev

πŸ” API Key Management

  • On first launch, you’ll be prompted to enter your OpenAI API key.
  • To set your API key manually:
    setapikey sk-proj-xxxxxx
  • To reset your API key:
    resetapikey
  • API keys are stored securely in a .term directory at the project root.

πŸ’‘ Usage

  • Type shell commands or natural language queries in the terminal.
  • Use Up/Down arrows to navigate command history.
  • Some commands are predefined (src/utils/autocomplete.ts).
  • If a command isn’t recognized, the AI will handle it.

πŸ—οΈ Contributing

Contributions are welcome! To get started:

  1. Fork the repository
  2. Create a new branch (git checkout -b feature/your-feature)
  3. Commit your changes (git commit -m 'Add feature')
  4. Push to your fork (git push origin feature/your-feature)
  5. Open a Pull Request

Guidelines

  • Follow the existing code style (see ESLint/Prettier configs)
  • Write clear commit messages
  • Add tests for new features when possible
  • Be respectful in code reviews and discussions
  • Do not push the code without manually testing and verifying it.

Expanding the ESLint configuration

If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:

export default tseslint.config({
  extends: [
    // Remove ...tseslint.configs.recommended and replace with this
    ...tseslint.configs.recommendedTypeChecked,
    // Alternatively, use this for stricter rules
    ...tseslint.configs.strictTypeChecked,
    // Optionally, add this for stylistic rules
    ...tseslint.configs.stylisticTypeChecked,
  ],
  languageOptions: {
    // other options...
    parserOptions: {
      project: ['./tsconfig.node.json', './tsconfig.app.json'],
      tsconfigRootDir: import.meta.dirname,
    },
  },
})

You can also install eslint-plugin-react-x and eslint-plugin-react-dom for React-specific lint rules:

// eslint.config.js
import reactX from 'eslint-plugin-react-x'
import reactDom from 'eslint-plugin-react-dom'

export default tseslint.config({
  plugins: {
    // Add the react-x and react-dom plugins
    'react-x': reactX,
    'react-dom': reactDom,
  },
  rules: {
    // other rules...
    // Enable its recommended typescript rules
    ...reactX.configs['recommended-typescript'].rules,
    ...reactDom.configs.recommended.rules,
  },
})

πŸ“· Screenshots

Terminal Screenshot Terminal Screenshot 2


πŸ“š Resources


πŸ“„ License

This project is licensed under the MIT License.


For issues and TODOs, see the TODO File.

About

A minimal terminal with AI capabilities.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks