Professional Terminal Assistant for LLM Interactions
Key Features β’ Quick Start β’ Usage Guide β’ Advanced Configuration
GPT Shell is a powerful terminal AI assistant built with Rust, enabling direct interaction with various Large Language Models (LLMs) through the command line. With its clean interface and support for multiple AI providers, it's the ideal choice for developers and terminal users. Whether you need programming assistance, text creation, or task automation, GPT Shell provides professional support.
|
|
- β OpenAI: GPT-3.5/4 models with complete streaming response
- β DeepSeek: DeepSeek-Chat models with custom API endpoints
- β Tongyi: Qianwen models with configurable parameters
- β ZhiPu: ChatGLM models with flexible interface adaptation
- β Other models: Compatible with OpenAI API format
# Windows PowerShell
irm https://raw.githubusercontent.com/wangenius/gpt-shell/refs/heads/master/install.ps1 | iex
# For other platforms, please refer to the online documentation
gpt [OPTIONS] [PROMPT]
Options:
-b, --bot <BOT> Use specified preset role
-a, --agent <AGENT> Use specified intelligent agent
-h, --help Display help information
-V, --version Display version information
Subcommands:
update Check and install updates
config Configuration management
bots Role management
# Start interactive session
gpt
# Direct question
gpt "How to use Docker?"
# Use specific role
gpt -b programmer "Code review"
# Show help
gpt --help
gpt
> Hello
Hello! How can I help you today?
> What is a closure?
A closure is a function that can access free variables...
[Press Ctrl+C to interrupt generation]
> exit
Goodbye!
# Add model
gpt config model add openai sk-xxxxxxxxxxxxxxxx
# Add custom model
gpt config model add deepseek your-api-key \
--url https://api.deepseek.com/v1/chat/completions \
--model deepseek-chat
# View and switch models
gpt config model list
gpt config model use deepseek
gpt config model remove openai
Note: --url
should be a complete API address, like https://api.deepseek.com/v1/chat/completions
, not just the base URL.
# View all roles
gpt bots
# Add custom role
gpt bots add reviewer -s "You are a professional code review expert"
# Manage role aliases
gpt bots alias set reviewer r
gpt bots alias list
gpt bots alias remove r
GPT Shell provides a powerful intelligent agent system with high-performance command execution and state management implemented in Rust:
- System Prompts: Define agent roles and behavior characteristics
- Environment Variables: Configure system environment variables for command execution
- Command Templates: Predefined common command templates
- Smart Command Execution: Automatic variable replacement and execution
- State Management: Maintain conversation context and execution state
- Concurrency Control: Support for async operations and task cancellation
- Standardized Interaction: JSON format request-response
name = "Development Assistant"
description = "Professional development tool"
system_prompt = "You are an experienced developer"
[env]
editor = "code"
browser = "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe"
[templates]
open_file = "{{editor}} {{file}}"
open_browser = "start {{browser}} {{url}}"
# View configuration
gpt config
# Edit settings
gpt config edit
# Update system prompt
gpt config system "You are a professional developer"
# Feature toggles
gpt config stream true
- Config file location:
~/.gpt-shell/
- Secure API key storage
- Automatic session history management
- .env environment variable support
- Async Processing: tokio-based async runtime
- Stream Transfer: Real-time response handling
- Memory Safety: Rust-guaranteed memory safety
- Error Handling: Comprehensive error handling
- Type System: Strong typing for data safety
- API Keys: Secure storage, avoid version control
- Access Control: Careful permission management
- Cost Management: Monitor API usage
- Data Privacy: Mind data handling policies
- Updates: Keep tools and dependencies current
Welcome to contribute to the project:
- π Report issues and bugs
- π‘ Suggest new features
- π§ Submit code improvements
- π Improve project documentation
- π Enhance translations
- Clone project and install dependencies
- Follow Rust coding standards
- Write test cases
- Ensure all tests pass before submitting PR
This project is licensed under the MIT License.
Documentation β’ Report Bug β’ Request Feature