Skip to main content

Transform your shell scripts into powerful CLI tools with autocomplete, help messages, and argument validation

Project description


version = "1.0.0"

RunSH

Transform your shell scripts into powerful CLI tools with autocomplete, help messages, and argument validation.

✨ Features

  • 🔧 Zero Configuration: Add simple comments to your scripts
  • 🌍 GitHub Integration: Run scripts directly from GitHub repositories
  • 💾 Smart Caching: Offline support with automatic cache management
  • 🎯 Auto-completion: Rich CLI experience with argument validation
  • 📁 Organized: All files managed in .runsh/ directory

🚀 Quick Start

Installation

pip install runsh

Basic Usage

  1. Create a script with metadata comments:
#!/bin/bash
# @description: Deploy application to production
# @arg environment: Target environment (staging/prod)
# @option verbose,v [flag]: Show detailed output
# @option dry-run,d [flag]: Preview changes without executing

echo "Deploying to $ENVIRONMENT..."
[ "$VERBOSE" = "1" ] && echo "Verbose mode enabled"
  1. Run with RunSH:
# Auto-discovers scripts in ./scripts/
runsh deploy production --verbose

# Get help automatically
runsh deploy --help

GitHub Integration

# Initialize configuration
runsh config init

# Edit .runsh/config.yaml
scripts_dir: "https://github.com/user/repo/tree/main/scripts"

# Use scripts from GitHub
runsh list
runsh deploy --help

📖 Documentation

🎯 Key Commands

# Script Management
runsh list                    # List available scripts
runsh <script-name> --help    # Get script help

# Configuration  
runsh config show             # Show current config
runsh config init             # Create config file

# Cache Management
runsh cache list              # List cached scripts
runsh cache clean             # Clean expired cache
runsh cache clean --all       # Clean all cache

📁 Project Structure

.runsh/
├── config.yaml              # Main configuration
└── cache/                    # GitHub script cache
    └── github_user_repo_main_scripts/
        ├── script1.sh
        └── .metadata

🔧 Script Metadata

Add these comments to your shell scripts:

# @description: Brief description of what the script does
# @arg name [optional] [default=value]: Argument description  
# @option name,short [flag]: Option description
# @option timeout [default=30]: Value option with default

→ Complete syntax reference

🌍 Remote Scripts

# .runsh/config.yaml
scripts_dir: "https://github.com/team/devops-scripts/tree/main/tools"
default_shell: "bash"

→ GitHub integration guide

📚 Examples

Python Package Publishing

#!/bin/bash
# @description: Publish Python package to PyPI
# @option test,t [flag]: Upload to TestPyPI instead
# @option skip-build,s [flag]: Skip building step

# Build and publish logic here...
runsh publish-python --test  # Test on TestPyPI first
runsh publish-python         # Publish to PyPI

→ More examples

🛠️ Configuration

Environment Variables

export RUNSH_SCRIPTS_DIR="~/my-scripts"
export RUNSH_SHELL="zsh"

Config File

# .runsh/config.yaml
scripts_dir: "./tools"        # Local directory
# scripts_dir: "https://github.com/user/repo/tree/main/scripts"  # GitHub
default_shell: "bash"

→ Full configuration options

🤝 Contributing

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

📄 License

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

🔗 Links


Transform your shell scripts into professional CLI tools! 🚀

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

runsh-2.0.1.tar.gz (26.1 kB view details)

Uploaded Source

Built Distribution

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

runsh-2.0.1-py3-none-any.whl (26.3 kB view details)

Uploaded Python 3

File details

Details for the file runsh-2.0.1.tar.gz.

File metadata

  • Download URL: runsh-2.0.1.tar.gz
  • Upload date:
  • Size: 26.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.0

File hashes

Hashes for runsh-2.0.1.tar.gz
Algorithm Hash digest
SHA256 61ce62701e97fc5d0e34da813fe87b7b7fdd91eeffcdba6ad55fc796507796fb
MD5 a9ff11749863b615111e2abad9bd6964
BLAKE2b-256 dce63f33454297d100e26e1edc444c13e04084a67ffd6bd23546b0cde1008f4e

See more details on using hashes here.

File details

Details for the file runsh-2.0.1-py3-none-any.whl.

File metadata

  • Download URL: runsh-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 26.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.0

File hashes

Hashes for runsh-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 930f72a30cccc7721c8675cfc35948a01c74141dee9ab39c9e5dcb3edc0aac66
MD5 0620b18bb8f64dd326a3ee17c4106a45
BLAKE2b-256 f1b35de6fe10cdb1277e1de9f4d4faeb625820a9506ecc4bb3f4444474570566

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