# Terra Commands AI (tai)
A powerful natural language shell command tool that uses AI to convert human instructions into appropriate shell commands for your operating system.
## Features
- **AI-Powered Command Generation**: Uses OpenAI's GPT models to generate OS-specific commands
- **Interactive Setup**: Easy setup process for OpenAI API key with fallback support
- **Automatic OS Detection**: Adapts commands for Linux, macOS, Windows, and various distributions
- **Natural Language Processing**: Execute commands using plain English instructions
- **Safe Execution**: Commands require confirmation before execution
- **Dry Run Mode**: Test commands without actually executing them
- **Robust Fallback Mode**: Works seamlessly without AI using predefined command patterns
- **Cross-platform**: Native support for Linux, macOS, and Windows
## Installation
### Prerequisites
- Python 3.7+
- OpenAI API key (for AI functionality)
### From Source
1. Clone the repository:
```bash
git clone https://github.com/terra-agi/terra-commands.git
cd terra-commands
```
2. Install using pip:
```bash
pip install .
```
Or for development:
```bash
pip install -e .
```
### Configuration
**Easy Setup:**
Terra Command AI provides a simple interactive setup process:
1. **Setup AI Features:**
```bash
tai --setup-ai
```
Follow the prompts to enter your OpenAI API key securely.
2. **Configuration Storage:**
Your API key and settings are stored securely in:
- macOS/Linux: `~/.config/terra-ai/config`
- Windows: `%USERPROFILE%\\.config\\terra-ai\\config`
**Fallback Mode:**
If you choose not to set up AI or if the OpenAI package is not available, Terra Command AI will automatically fall back to using predefined command patterns. All basic functionality will still work without any additional configuration!
### Direct Installation
```bash
pip install git+https://github.com/terra-agi/terra-commands.git
```
## Usage
### Basic Usage
```bash
tai <instruction>
```
### Examples(Without AI)
```bash
# List files in current directory
tai list files
tai show directory
tai what files are here
# Navigate directories
tai go home
tai go back
tai go up
# System information
tai who am i
tai system info
tai disk usage
# Git operations
tai git status
tai git log
tai current branch
# Network operations
tai ping google
tai internet connection
```
### Advanced Options
```bash
# Dry run mode (shows command without executing)
tai --dry-run list files
# Force execution without confirmation
tai --force system info
# List all available commands and AI status
tai --list
# Show system and AI configuration status
tai --status
# Set up OpenAI API key for AI features
tai --setup-ai
```
### AI-Powered Examples
With AI enabled, you can use much more natural and complex instructions:
```bash
tai "find all python files in the current directory and count them"
tai "show me the last 10 lines of system logs"
tai "check if port 80 is open on localhost"
tai "display my public IP address"
tai "find files larger than 100MB in my home directory"
tai "show the current git branch and status"
tai "list all running docker containers"
tai "check disk usage and show only the largest directories"
```
## Available Commands(Without AI)
### File Operations
- `list files`, `show directory`, `list directory`
- `what files are here`, `see files`
### Directory Navigation
- `go home`, `go to home`
- `go back`, `go up`, `go to parent`
### System Information
- `who am i`, `current user`
- `system info`, `what system`
- `disk usage`, `disk space`
- `memory usage`, `memory info`
### Process Management
- `process list`, `running processes`
- `cpu info`
### Git Operations
- `git status`, `git log`, `git branch`
- `current branch`, `git diff`
### Network Operations
- `ping google`, `network status`
- `internet connection`
## Safety Features
- **Confirmation Required**: All commands require user confirmation before execution
- **Dry Run Mode**: Use `--dry-run` to see what command would be executed
- **Force Mode**: Use `--force` to skip confirmation (use with caution)
## Development
### Adding New Commands
Edit the `CommandInterpreter` class in `terra_cmd.py` to add new command patterns:
```python
self.command_patterns = {
'new command': 'shell_command',
# Add more patterns here
}
```
### Testing
```bash
# Test without installation
python terra_cmd.py --dry-run list files
# Run tests
python -m pytest tests/ # (if you add tests)
```
## Contributing
1. Fork the repository
2. Create a feature branch
3. Make your changes
4. Add tests if applicable
5. Submit a pull request
## License
MIT License - see LICENSE file for details
## Future Enhancements
- [ ] Integration with more AI language models for better command interpretation
- [ ] Support for complex multi-step commands
- [ ] Command history and favorites
- [ ] Custom command aliases
- [ ] Integration with shell completion
- [ ] Support for Windows commands
- [ ] Plugin system for extending functionality
## Changelog
### v0.1.0
- Initial release with basic natural language command interpretation
- Support for common file, directory, system, and git operations
- Safe execution with confirmation prompts
- Dry run mode for testing
- Installable via pip
Developed by [TerraAGI](https://terra-agi.com/) Team with <3
Raw data
{
"_id": null,
"home_page": "https://github.com/terra-agi/terra-commands",
"name": "terra-tai",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "Terra AGI <contact@terra-agi.com>",
"keywords": "cli, shell, command, natural-language, terminal, ai, openai, automation",
"author": "Terra AGI",
"author_email": "Terra AGI <contact@terra-agi.com>",
"download_url": "https://files.pythonhosted.org/packages/09/d9/60d6746c17f1bdfe843116bd5b770ec783c4bba7536c4cc1f1fe4e3a4d2e/terra_tai-0.1.0.tar.gz",
"platform": null,
"description": "# Terra Commands AI (tai)\n\nA powerful natural language shell command tool that uses AI to convert human instructions into appropriate shell commands for your operating system.\n\n## Features\n\n- **AI-Powered Command Generation**: Uses OpenAI's GPT models to generate OS-specific commands\n- **Interactive Setup**: Easy setup process for OpenAI API key with fallback support\n- **Automatic OS Detection**: Adapts commands for Linux, macOS, Windows, and various distributions\n- **Natural Language Processing**: Execute commands using plain English instructions\n- **Safe Execution**: Commands require confirmation before execution\n- **Dry Run Mode**: Test commands without actually executing them\n- **Robust Fallback Mode**: Works seamlessly without AI using predefined command patterns\n- **Cross-platform**: Native support for Linux, macOS, and Windows\n\n## Installation\n\n### Prerequisites\n\n- Python 3.7+\n- OpenAI API key (for AI functionality)\n\n### From Source\n\n1. Clone the repository:\n\n```bash\ngit clone https://github.com/terra-agi/terra-commands.git\ncd terra-commands\n```\n\n2. Install using pip:\n\n```bash\npip install .\n```\n\nOr for development:\n\n```bash\npip install -e .\n```\n\n### Configuration\n\n**Easy Setup:**\nTerra Command AI provides a simple interactive setup process:\n\n1. **Setup AI Features:**\n\n ```bash\n tai --setup-ai\n ```\n\n Follow the prompts to enter your OpenAI API key securely.\n\n2. **Configuration Storage:**\n Your API key and settings are stored securely in:\n - macOS/Linux: `~/.config/terra-ai/config`\n - Windows: `%USERPROFILE%\\\\.config\\\\terra-ai\\\\config`\n\n**Fallback Mode:**\nIf you choose not to set up AI or if the OpenAI package is not available, Terra Command AI will automatically fall back to using predefined command patterns. All basic functionality will still work without any additional configuration!\n\n### Direct Installation\n\n```bash\npip install git+https://github.com/terra-agi/terra-commands.git\n```\n\n## Usage\n\n### Basic Usage\n\n```bash\ntai <instruction>\n```\n\n### Examples(Without AI)\n\n```bash\n# List files in current directory\ntai list files\ntai show directory\ntai what files are here\n\n# Navigate directories\ntai go home\ntai go back\ntai go up\n\n# System information\ntai who am i\ntai system info\ntai disk usage\n\n# Git operations\ntai git status\ntai git log\ntai current branch\n\n# Network operations\ntai ping google\ntai internet connection\n```\n\n### Advanced Options\n\n```bash\n# Dry run mode (shows command without executing)\ntai --dry-run list files\n\n# Force execution without confirmation\ntai --force system info\n\n# List all available commands and AI status\ntai --list\n\n# Show system and AI configuration status\ntai --status\n\n# Set up OpenAI API key for AI features\ntai --setup-ai\n```\n\n### AI-Powered Examples\n\nWith AI enabled, you can use much more natural and complex instructions:\n\n```bash\ntai \"find all python files in the current directory and count them\"\ntai \"show me the last 10 lines of system logs\"\ntai \"check if port 80 is open on localhost\"\ntai \"display my public IP address\"\ntai \"find files larger than 100MB in my home directory\"\ntai \"show the current git branch and status\"\ntai \"list all running docker containers\"\ntai \"check disk usage and show only the largest directories\"\n```\n\n## Available Commands(Without AI)\n\n### File Operations\n\n- `list files`, `show directory`, `list directory`\n- `what files are here`, `see files`\n\n### Directory Navigation\n\n- `go home`, `go to home`\n- `go back`, `go up`, `go to parent`\n\n### System Information\n\n- `who am i`, `current user`\n- `system info`, `what system`\n- `disk usage`, `disk space`\n- `memory usage`, `memory info`\n\n### Process Management\n\n- `process list`, `running processes`\n- `cpu info`\n\n### Git Operations\n\n- `git status`, `git log`, `git branch`\n- `current branch`, `git diff`\n\n### Network Operations\n\n- `ping google`, `network status`\n- `internet connection`\n\n## Safety Features\n\n- **Confirmation Required**: All commands require user confirmation before execution\n- **Dry Run Mode**: Use `--dry-run` to see what command would be executed\n- **Force Mode**: Use `--force` to skip confirmation (use with caution)\n\n## Development\n\n### Adding New Commands\n\nEdit the `CommandInterpreter` class in `terra_cmd.py` to add new command patterns:\n\n```python\nself.command_patterns = {\n 'new command': 'shell_command',\n # Add more patterns here\n}\n```\n\n### Testing\n\n```bash\n# Test without installation\npython terra_cmd.py --dry-run list files\n\n# Run tests\npython -m pytest tests/ # (if you add tests)\n```\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Add tests if applicable\n5. Submit a pull request\n\n## License\n\nMIT License - see LICENSE file for details\n\n## Future Enhancements\n\n- [ ] Integration with more AI language models for better command interpretation\n- [ ] Support for complex multi-step commands\n- [ ] Command history and favorites\n- [ ] Custom command aliases\n- [ ] Integration with shell completion\n- [ ] Support for Windows commands\n- [ ] Plugin system for extending functionality\n\n## Changelog\n\n### v0.1.0\n\n- Initial release with basic natural language command interpretation\n- Support for common file, directory, system, and git operations\n- Safe execution with confirmation prompts\n- Dry run mode for testing\n- Installable via pip\n\nDeveloped by [TerraAGI](https://terra-agi.com/) Team with <3\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Terra Command AI - A natural language shell command tool with AI",
"version": "0.1.0",
"project_urls": {
"Changelog": "https://github.com/terra-agi/terra-commands/blob/main/CHANGELOG.md",
"Homepage": "https://github.com/terra-agi/terra-commands",
"Issues": "https://github.com/terra-agi/terra-commands/issues",
"Repository": "https://github.com/terra-agi/terra-commands"
},
"split_keywords": [
"cli",
" shell",
" command",
" natural-language",
" terminal",
" ai",
" openai",
" automation"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "b2cf18d7b77c82e8131ff7af6bf1254b09e233acf06ab010ec205dd34787ea9e",
"md5": "8a43a97ee68340b4e5d95c931e9dbcbc",
"sha256": "71a1e570d72edc91e1acd781159e7a9fbe6978f6a9914b2814e48c012b79b5af"
},
"downloads": -1,
"filename": "terra_tai-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "8a43a97ee68340b4e5d95c931e9dbcbc",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 24711,
"upload_time": "2025-09-08T08:14:03",
"upload_time_iso_8601": "2025-09-08T08:14:03.828296Z",
"url": "https://files.pythonhosted.org/packages/b2/cf/18d7b77c82e8131ff7af6bf1254b09e233acf06ab010ec205dd34787ea9e/terra_tai-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "09d960d6746c17f1bdfe843116bd5b770ec783c4bba7536c4cc1f1fe4e3a4d2e",
"md5": "18ce956e9099160ee583e9d0ed14fafb",
"sha256": "34cb3bc4e5a790d6d54a1aef89a3e9bd17d90e31e067cdfb53de154005fe0f14"
},
"downloads": -1,
"filename": "terra_tai-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "18ce956e9099160ee583e9d0ed14fafb",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 23355,
"upload_time": "2025-09-08T08:14:05",
"upload_time_iso_8601": "2025-09-08T08:14:05.444161Z",
"url": "https://files.pythonhosted.org/packages/09/d9/60d6746c17f1bdfe843116bd5b770ec783c4bba7536c4cc1f1fe4e3a4d2e/terra_tai-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-09-08 08:14:05",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "terra-agi",
"github_project": "terra-commands",
"github_not_found": true,
"lcname": "terra-tai"
}