Skip to main content

AI-Powered Terminal Command Generator and Executor

Project description

Smart Terminal

Python Version License Version

Smart Terminal (st) is a powerful command-line interface that converts natural language instructions into executable terminal commands using AI. Say goodbye to forgetting command syntax or searching through documentation - just describe what you want to do in plain English.

🚀 Features

  • Natural Language Processing: Convert plain English to terminal commands
  • Multi-step Tasks: Handle complex operations with sequential commands
  • Multiple AI Providers: Support for OpenAI, Groq, and Anthropic
  • Cross-platform Support: Works across macOS, Linux, and Windows with dedicated shell adapters
  • Interactive Mode: Continuous command generation for complex workflows
  • Command History: Context-aware interactions for better suggestions
  • Admin Privilege Handling: Proper sudo/admin permission management
  • Customizable: Configure AI providers and other settings
  • Dry Run Mode: Preview commands without execution
  • JSON Output: Format results as JSON for scripting and automation

⚡ Quick Installation

pip install smart-terminal-cli

📖 Usage

Basic Command Conversion

st "create a folder called projects and create a python file inside it"

This will generate and execute the appropriate commands to create the folder and file.

Interactive Mode

st -i

Start an interactive session where you can continuously issue natural language commands.

Setup and Configuration

st --setup

Configure API keys, default settings, and other options.

Dry Run Mode

st --dry-run "create a file with the current date as filename"

Preview commands that would be executed without actually running them.

JSON Output

st --json "find all python files in the current directory"

Output results in JSON format for scripting and automation.

Other Commands

# Clear command history
st --clear-history

# Enable debug logging
st --debug

# View version information
st --version

# Set up shell integration
st --shell-setup

# Show configuration information
st --config-info

📋 Examples

Here are some examples of what you can do with Smart Terminal:

# File and directory operations
st "find all PDF files in the current directory and move them to a new folder called documents"

# System information
st "show me system information including CPU and memory usage"

# Package management
st "install numpy, pandas, and matplotlib for my python project"

# Git operations
st "initialize a git repository, add all files, and make an initial commit"

# Network operations
st "scan open ports on localhost"

🔧 Configuration

Smart Terminal stores its configuration in ~/.smartterminal/config.json. You can modify this file directly or use the setup command:

st --setup

Key configuration options:

  • API Key: Your AI service API key
  • Base URL: API endpoint URL
  • Model Name: AI model to use for command generation
  • Provider: AI provider to use (openai, groq, anthropic)
  • Default OS: Target operating system for commands
  • History Limit: Number of previous commands to retain
  • Shell Integration: Enable/disable shell integration for environment-changing commands

Shell Integration

Smart Terminal can modify your shell environment (changing directories, setting environment variables) when you enable shell integration:

st --shell-setup

This adds a function to your shell configuration file that allows Smart Terminal to affect your shell environment.

🛠️ Development

Prerequisites

  • Python 3.10 or higher
  • Poetry (for dependency management)

Setting up development environment

# Clone the repository
git clone https://github.com/muralianand12345/Smart-Terminal.git
cd Smart-Terminal

# Install dependencies using Poetry
poetry install

# Activate the virtual environment
poetry shell

Running tests

pytest

Building from source

poetry build

📜 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgements

  • OpenAI, Groq, and Anthropic for providing the AI capabilities
  • All contributors and testers

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

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

Created by Murali Anand

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

smart_terminal_cli-2.0.0.tar.gz (51.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

smart_terminal_cli-2.0.0-py3-none-any.whl (64.4 kB view details)

Uploaded Python 3

File details

Details for the file smart_terminal_cli-2.0.0.tar.gz.

File metadata

  • Download URL: smart_terminal_cli-2.0.0.tar.gz
  • Upload date:
  • Size: 51.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.10.11 Darwin/24.3.0

File hashes

Hashes for smart_terminal_cli-2.0.0.tar.gz
Algorithm Hash digest
SHA256 bd223b9396d7a7750ce60a90366defe05c494a7cc8de62c5e85583315482d9e5
MD5 1d30dcdbc821ad9f71af5c1dc961f5a3
BLAKE2b-256 091fa0d29b24c377eb9d1b83deb5dbc4bfa0bdafe51ed82949634f482357f3c8

See more details on using hashes here.

File details

Details for the file smart_terminal_cli-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: smart_terminal_cli-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 64.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.10.11 Darwin/24.3.0

File hashes

Hashes for smart_terminal_cli-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8b33145d015566f69e1ccdfd93a4f9b984be6a1f89ec1b9644fbe06011509eb3
MD5 7426e5d3a5ec9506ab926e10d8e08277
BLAKE2b-256 dc2c764ab91b7cbda5ceb9c19ea9e65ded789963a8e54f1d0898486286424e8d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page