npm package: @stevexinpa/terminalpal
Description: TerminalPal: A terminal chat interface powered by Google Gemini with code execution capabilities
Author: Spargat Group
Latest version: 1.3.27

# TerminalPal (Full Version) 🚀

[![GitHub license](https://img.shields.io/github/license/spargatgroup/pal)](https://github.com/spargatgroup/pal/blob/main/LICENSE)
[![GitHub stars](https://img.shields.io/github/stars/spargatgroup/pal)](https://github.com/spargatgroup/pal/stargazers)
[![GitHub issues](https://img.shields.io/github/issues/spargatgroup/pal)](https://github.com/spargatgroup/pal/issues)
[![Node.js Version](https://img.shields.io/badge/node-%3E%3D18.0.0-brightgreen)](https://nodejs.org/)

> **Note:** Looking for the lightweight version? Check out [TerminalPal Lite](https://github.com/spargatgroup/pallite) for a PowerShell-based alternative.

## 🌟 Features

- **AI-Powered Terminal Chat** - Chat with Google's Gemini AI directly in your terminal
- **Smart Command Execution** - Execute and analyze commands with AI assistance
- **Context-Aware** - Maintains conversation history and chat memory across sessions
- **Multi-Model Support** - Supports Gemini 2.5 Pro, Flash, and other Gemini models
- **Adaptive Responses** - AI chooses between fast replies and deeper reasoning
- **Chat Sessions** - Create, switch between, and manage multiple chat sessions
- **Secure** - API keys stored locally with proper permissions
- **Cross-Platform** - Works on Windows, macOS, and Linux

## 🚀 Installation

### Prerequisites

- Node.js 18.0.0 or higher
- npm (comes with Node.js)
- Google Gemini API key (get one from [Google AI Studio](https://makersuite.google.com/app/apikey))

### Quick Start

1. **Install TerminalPal globally**:
   ```bash
   npm install -g @stevexinpa/terminalpal
   ```

2. **Start TerminalPal**:
   ```bash
   pal
   ```

3. **Set up your API key when prompted** or set it manually:
   ```
   /config set GEMINI_API_KEY your-api-key-here
   ```

   > **Note**: Get your Google Gemini API key from [Google AI Studio](https://makersuite.google.com/app/apikey)

## 🛠️ Usage

### Starting a Chat

Simply run:
```bash
pal
```

### Conversation Memory

TerminalPal now features enhanced conversation memory, allowing the AI to maintain context across multiple messages. The system will automatically remember:

- The last 10 messages in your conversation
- The current working directory and system context
- Previous commands and their outputs

This enables more natural, context-aware conversations without having to repeat information.

### Update Checking

TerminalPal automatically checks for updates when you start it. If a new version is available, you'll see a notification with instructions on how to update.

To manually check for and install updates, use the update command:

```bash
pal update
# or the shorter version:
pal upd
```

To disable automatic update checking, use the `--skip-update-check` flag:

```bash
pal --skip-update-check
```

### In-Chat Commands

- `/help`, `/h` - Show available commands
- `/config`, `/c` - Show current configuration
- `/models`, `/m` - List available models
- `/model <model_id>` - Switch to a different AI model (e.g., `gemini-2.5-pro`)
- `/list`, `/ls` - List all chat sessions
- `/new [name]` - Create a new chat session
- `/switch <id>`, `/use <id>` - Switch to a different chat session
- `/clearmemory` - Clear current chat memory
- `/reset` - Reset all data (chats, config, etc.)
- `/update`, `/upd` - Check for and install updates
- `/exit`, `/quit` - Exit the application

### Examples

```
How do I list files in a directory?
/model gemini-2.5-pro
/clearmemory
/new Project Help
```

## ⚙️ Configuration

View or modify configuration settings from within the chat:

```
/config set setting_name value
```

### Available Models

- `gemini-2.5-pro` - Gemini 2.5 Pro (default)
- `gemini-2.5-flash` - Gemini 2.5 Flash (faster, lighter)
- `gemini-2.0-pro` - Gemini 2.0 Pro
- `gemini-2.0-flash` - Gemini 2.0 Flash

## 🤝 Contributing

We welcome contributions! Here's how to get started:

1. Fork the repository
2. Create your feature branch (`git checkout -b feature/AmazingFeature`)
3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request

## 📝 License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## 🙏 Acknowledgments

- Google for the amazing Gemini AI models
- All the open-source contributors who made this project possible

---

<div align="center">
  Made with ❤️ by the TerminalPal team
</div>