Skip to content

billxc/cloud_shell

Repository files navigation

Cloud Shell 🌩️

Xiaochen's cloud shell.

A unified, cross-platform shell enhancement toolkit that brings powerful commands and AI-assisted functionality to your terminal experience on macOS, Windows, and Linux.

🚀 Features

  • Cross-platform compatibility - Works seamlessly on macOS, Windows, and Linux
  • AI-powered command generation - Natural language to shell commands using OpenAI/Azure OpenAI
  • Fuzzy search integration - Enhanced command history and discovery with fzf
  • Git workflow shortcuts - Simplified git operations
  • Path utilities - Cross-platform path manipulation tools
  • Command history management - Advanced history search and filtering

📦 Installation

Quick Install (Windows)

iwr pwsh.xccc.me | iex

Manual Installation

  1. Clone the repository:

    git clone <repository-url> ~/.cloud_shell
    cd ~/.cloud_shell
  2. Run the initialization script:

    # On macOS/Linux
    ./init.sh
    
    # On Windows
    .\init.ps1
  3. Install Python dependencies:

    pip install -r requirements.txt
  4. (Optional) Configure AI features:

    cp openai_config.yml.example openai_config.yml
    # Edit openai_config.yml with your API credentials

🛠️ Core Commands

📚 Command Discovery & History

  • x - Interactive command browser with fuzzy search
  • hist - Search and execute from command history

🤖 AI-Powered Assistant

  • to <description> - Generate and execute commands from natural language
    to "find all python files larger than 1MB"
    to "compress this folder to zip"

🔄 Git Shortcuts

  • gitc <message> - Quick commit with message (no quotes needed)
  • gitcc <message> - Add all and commit
  • gs - Enhanced git status
  • ga - Interactive git add with fzf
  • multi_pull - Step-by-step pulling for large repositories

🛤️ Path Utilities

  • ospath <path> - Convert paths to OS-appropriate format
  • slashpath <path> - Normalize path separators to forward slashes

🔧 System Management

  • reloadpath - Refresh PATH environment variable
  • update_cloud_shell - Update this toolkit to latest version

📋 Requirements

  • Python 3.6+
  • fzf (for fuzzy searching)
  • git (for git-related commands)

Python Dependencies

  • pyperclip - Clipboard operations
  • distro - Linux distribution detection
  • openai - AI command generation
  • pyyaml - Configuration file parsing

⚙️ Configuration

AI Features Setup

  1. Copy the example config:

    cp openai_config.yml.example openai_config.yml
  2. Edit openai_config.yml with your credentials:

    api_type: azure  # or 'openai'
    api_base: https://your-endpoint.openai.azure.com/
    api_key: your-api-key-here
    api_model: gpt-4
    api_version: 2023-05-15

🏗️ Architecture

cloud_shell/
├── local_commands/     # Platform-specific executables
├── pwsh/              # PowerShell implementations
├── py/                # Python implementations
├── sh/                # Shell script implementations
├── shellrc/           # Shell configuration files
└── tools/             # Development utilities

The toolkit uses a hybrid approach:

  • Simple utilities - Implemented in shell scripts (bash/PowerShell)
  • Complex features - Implemented in Python for cross-platform compatibility
  • Fuzzy search - Powered by fzf for enhanced user experience

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test across platforms if possible
  5. Submit a pull request

📝 License

This project is open source. See the repository for license details.

🆘 Troubleshooting

  • Commands not found: Ensure the installation script completed successfully and restart your shell
  • AI features not working: Check your openai_config.yml configuration
  • fzf not working: Install fzf using your package manager (brew install fzf, apt install fzf, etc.)

For more details on all available commands, see full_commands.md.

About

Create a unified and seamless cross-platform shell experience.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published