### Manual Rav Configuration Example Source: https://github.com/jmitchel3/rav/blob/main/README.md An example of a 'rav.yaml' file demonstrating how to define simple script shortcuts for common tasks like echoing text or starting a server. ```yaml scripts: echo: echo hello world server: python -m http.server 8000 ``` -------------------------------- ### Create a New Rav Project Source: https://context7.com/jmitchel3/rav/llms.txt Initializes a new Rav project. This command can either guide the user through an interactive setup wizard or generate a sample 'rav.yaml' configuration file. ```bash # Interactive project setup wizard rav new # Create a sample rav.yaml file rav sample # Overwrite existing configuration rav sample --overwrite ``` -------------------------------- ### Initialize New Rav Project Source: https://github.com/jmitchel3/rav/blob/main/README.md This command initiates an interactive setup wizard to create a new Rav project and generate a 'rav.yaml' configuration file. ```bash cd ~/path/to/project rav new ``` -------------------------------- ### Rav Script Configuration Example Source: https://github.com/jmitchel3/rav/blob/main/README.md A comprehensive example of a 'rav.yaml' file showcasing various configurations, including single commands, multi-command sequences for build and deployment, and file downloads with integrity verification. ```yaml name: web-development-toolkit scripts: # Development servers dev: python -m http.server 8000 dev-secure: python -m http.server 8443 --bind 127.0.0.1 # Testing and quality assurance test: pytest tests/ -v lint: flake8 src/ tests/ format: black src/ tests/ # Build and deployment build: - npm run build - python setup.py sdist bdist_wheel - echo "Build complete!" deploy: - rav run test - rav run build - rsync -av dist/ user@server:/var/www/ downloads: frontend-deps: destination: static/vendor overwrite: true files: - name: htmx.min.js url: https://cdn.jsdelivr.net/npm/htmx.org@2.0.6/dist/htmx.min.js integrity: sha384-Akqfrbj/HpNVo8k11SXBb6TlBWmXXlYQrCSqEWmyKJe+hDm3Z/B2WVG4smwBkRVm - name: tailwind.css url: https://cdn.tailwindcss.com/3.4.0/tailwind.min.css ``` -------------------------------- ### Rav Download Output Example Source: https://github.com/jmitchel3/rav/blob/main/README.md This example shows the typical colored output from the `rav download` command, illustrating the progress, success, skipping of files, and a final summary of the download operation. ```text 📥 Starting download: frontend-deps Destination: static/vendor Files to download: 3 Overwrite existing: true [1/3] ⬇️ Downloading: htmx.min.js → From: https://cdn.jsdelivr.net/npm/htmx.org@2.0.6/dist/htmx.min.js → Integrity: sha384-Akqfrbj/... ✅ Integrity verified (sha384) ✅ Success! (45,234 bytes) [2/3] ⏭️ Skipping existing file: bootstrap.min.css [3/3] ⬇️ Downloading: alpine.min.js ✅ Success! (15,678 bytes) --------------------------------------- 📊 Download Summary: ✅ Downloaded: 2 files ⏭️ Skipped: 1 files --------------------------------------- ``` -------------------------------- ### Rav Project Configuration File Source: https://context7.com/jmitchel3/rav/llms.txt An example rav.yaml file demonstrating a complete web development workflow, including defining scripts for development, testing, building, deployment, and download configurations for frontend dependencies. ```yaml # rav.yaml - Complete web development workflow name: fullstack-app scripts: # Development dev: python -m http.server 8000 watch: - npm run watch - rav run dev # Code quality lint: - flake8 src/ - npm run lint format: - black src/ - prettier --write "static/js/**/*.js" test: - pytest tests/ -v --cov=src - npm test # Setup and build setup: - python -m venv venv - venv/bin/pip install -r requirements.txt - rav download frontend-deps build: - rm -rf dist/ - rav run test - npm run build - python setup.py sdist bdist_wheel # Deployment deploy-staging: - rav run build - rsync -av dist/ staging@server:/var/www/staging/ deploy-prod: - rav run build - rsync -av dist/ prod@server:/var/www/production/ downloads: frontend-deps: destination: static/vendor overwrite: true raise_on_error: true files: - name: htmx.min.js url: https://cdn.jsdelivr.net/npm/htmx.org@2.0.6/dist/htmx.min.js integrity: sha384-Akqfrbj/HpNVo8k11SXBb6TlBWmXXlYQrCSqEWmyKJe+hDm3Z/B2WVG4smwBkRVm destination: static/js - name: alpine.min.js url: https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js destination: static/js - name: bootstrap.min.css url: https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css destination: static/css ``` -------------------------------- ### Running Rav Commands Source: https://github.com/jmitchel3/rav/blob/main/README.md Examples of how to execute defined scripts using the 'rav run' command or its shortcut 'rav x'. It also shows how to list available commands. ```bash rav run echo # or rav x echo rav run server # Start development server rav list # Show all available commands ``` -------------------------------- ### Install Rav CLI Tool Source: https://context7.com/jmitchel3/rav/llms.txt Installs the Rav command-line interface tool using pip, the Python package installer. This is the primary method for getting Rav onto your system. ```bash pip install rav ``` -------------------------------- ### Rav Command Options Source: https://github.com/jmitchel3/rav/blob/main/README.md Examples demonstrating the use of command-line options for Rav, such as specifying a custom configuration file, forcing overwrites, or enabling verbose output. ```bash rav run -f custom.yaml echo rav sample --overwrite rav --verbose run command ``` -------------------------------- ### Define Custom Rav Project Configuration (YAML) Source: https://github.com/jmitchel3/rav/blob/main/README.md Illustrates how to define custom Rav configurations using YAML files. It shows that the root key can be `rav`, `scripts`, or `commands`, and provides examples for defining executable scripts. ```yaml rav: sweet: echo "this is working" echo: echo "so is this" ``` ```yaml scripts: sweet: echo "this is working" echo: echo "so is this" ``` -------------------------------- ### Install Rav CLI Source: https://github.com/jmitchel3/rav/blob/main/README.md This snippet shows the command to install the Rav CLI using pip. It requires Python 3.9 or higher and is recommended to be installed within a virtual environment. ```bash python3 -m pip install rav ``` -------------------------------- ### Generate and Run Sample Rav Project Source: https://github.com/jmitchel3/rav/blob/main/README.md This snippet shows how to generate a sample Rav project file and then execute a command using it. It demonstrates the basic usage of the `rav sample` command and how to run a script defined in a generated YAML file. ```bash rav sample # Creates rav.sample.yaml rav run -f rav.sample.yaml echo ``` -------------------------------- ### Project Structure Overview Source: https://github.com/jmitchel3/rav/blob/main/README.md Illustrates a typical project directory structure, including configuration files, scripts, vendor dependencies, and raw data. ```tree my-project/ ├── rav.yaml # Main configuration ├── rav.dev.yaml # Development-specific config ├── rav.prod.yaml # Production-specific config ├── scripts/ # Complex automation scripts ├── static/vendor/ # Downloaded dependencies └── data/raw/ # Downloaded datasets ``` -------------------------------- ### Rav Basic Syntax for Script Execution Source: https://github.com/jmitchel3/rav/blob/main/README.md Illustrates the basic syntax for executing scripts defined in a Rav configuration file using the 'rav run' command and its shortcut 'rav x'. ```bash rav run # Execute a script command rav x # Shortcut for rav run rav list # Show all available commands ``` -------------------------------- ### Interact with Rav CLI using Python Source: https://context7.com/jmitchel3/rav/llms.txt Illustrates how to instantiate and use the RavCLI class in Python to execute various rav commands, such as running scripts, downloading files, creating new projects, and generating sample configurations. ```python from rav.cli import RavCLI # Initialize CLI with options cli = RavCLI( project_file="rav.yaml", # or use f="custom.yaml" verbose=False, traceback=False, overwrite=False ) # Run commands cli.run("server") cli.x("test") # Shortcut for run # Download files cli.download("staticfiles") # List available commands cli.list() # Create new project interactively cli.new(path=".") # Generate sample configuration cli.sample(overwrite=False) # Show version cli.version() ``` -------------------------------- ### Manage Projects with Python's Project Class Source: https://context7.com/jmitchel3/rav/llms.txt Shows how to initialize and use the Project class in Python to manage project configurations, run scripts, and handle file downloads defined in a rav.yaml file. ```python from pathlib import Path from rav.project import Project # Initialize a project from a YAML file project = Project( project_file=Path("rav.yaml"), join_arg=" && ", verbose=True, traceback=False ) # Get all defined scripts scripts = project.scripts() # Returns: {"server": "python -m http.server", "test": "pytest tests/"} # List all available commands (prints formatted table) project.list() # Run a script command project.run("server") project.run("test", "-v", "--coverage") # Get download configuration download_config = project.get_download_config() # Returns: {"staticfiles": {"destination": "...", "files": [...]}} # Execute a download configuration project.download("staticfiles") ``` -------------------------------- ### Data Science Project Workflow with rav.yaml Source: https://github.com/jmitchel3/rav/blob/main/README.md Sets up Python virtual environments, runs Jupyter notebooks, processes data, and trains machine learning models. Includes downloading datasets using the `downloads` feature. ```yaml name: data-analysis-project scripts: # Environment management setup: - python -m venv venv - venv/bin/pip install -r requirements.txt - echo "✅ Environment ready!" # Jupyter workflows notebook: venv/bin/jupyter lab --port=8888 notebook-clean: venv/bin/jupyter nbconvert --clear-output notebooks/*.ipynb # Data processing download-data: python scripts/download_datasets.py process: - python scripts/clean_data.py - python scripts/feature_engineering.py - echo "📊 Data processing complete" # Analysis and reporting analyze: venv/bin/python scripts/analyze.py report: - venv/bin/jupyter nbconvert --to html notebooks/analysis.ipynb - echo "📑 Report generated: notebooks/analysis.html" # Model training train: - rav run process - python scripts/train_model.py - echo "🤖 Model training complete" downloads: datasets: destination: data/raw files: - name: sample_data.csv url: https://example.com/datasets/sample.csv - name: reference_data.json url: https://api.example.com/reference/data.json ``` -------------------------------- ### Rav Alternative Configuration Keys (YAML) Source: https://context7.com/jmitchel3/rav/llms.txt Demonstrates the interchangeability of the top-level configuration keys in 'rav.yaml'. 'rav', 'scripts', and 'commands' can all be used to define script shortcuts. ```yaml # Using 'rav' as top-level key rav: echo: echo "Hello World" server: python -m http.server # Using 'scripts' as top-level key scripts: echo: echo "Hello World" server: python -m http.server # Using 'commands' as top-level key commands: echo: echo "Hello World" server: python -m http.server ``` -------------------------------- ### Run Commands with Custom Rav Files (Bash) Source: https://github.com/jmitchel3/rav/blob/main/README.md Demonstrates how to execute commands defined in custom Rav YAML files using the `-f` or `--file` flags. This allows users to specify which configuration file to use for running commands. ```bash rav run -f project.yaml sweet rav run --file rav.other.yaml echo ``` -------------------------------- ### List Available Rav Commands Source: https://context7.com/jmitchel3/rav/llms.txt Displays all script commands that are currently defined in the 'rav.yaml' configuration file. This helps users discover and choose which commands to execute. ```bash rav list ``` -------------------------------- ### Cross-Platform Script Execution Source: https://github.com/jmitchel3/rav/blob/main/README.md Demonstrates how to define scripts for universal execution and provides platform-specific alternatives for broader compatibility. This uses a YAML configuration format. ```yaml scripts: # Universal commands (recommended) test: python -m pytest tests/ serve: python -m http.server 8000 # Platform-specific alternatives serve-win: python -m http.server 8000 serve-unix: python3 -m http.server 8000 ``` -------------------------------- ### Rav Core CLI Commands Source: https://github.com/jmitchel3/rav/blob/main/README.md Reference for the core commands provided by the Rav CLI, including executing scripts, listing commands, and project initialization. ```bash rav run # Execute a script command rav x # Shortcut for rav run rav list # List all available commands rav new # Create new rav project with wizard rav sample # Generate sample rav.yaml file rav version # Show rav version ``` -------------------------------- ### Rav File Download Configuration with Mixed Settings (YAML) Source: https://github.com/jmitchel3/rav/blob/main/README.md Illustrates how individual file download configurations can override the global settings defined at the download set level. This allows for granular control over where files are saved and whether they overwrite existing ones. ```yaml downloads: mixed-settings: destination: assets/ overwrite: false verbose: true files: - name: important-file.js url: https://example.com/file.js overwrite: true # Override: will overwrite destination: critical/ # Override: different folder - name: optional-file.css url: https://example.com/style.css # Uses download-level settings ``` -------------------------------- ### Rav Basic Script Configuration (YAML) Source: https://context7.com/jmitchel3/rav/llms.txt Defines script shortcuts in 'rav.yaml' using the 'scripts' top-level key. Supports single commands, multi-command sequences (using '&&'), and chaining of Rav commands. ```yaml # rav.yaml - Basic configuration name: my-project scripts: # Single command server: python -m http.server 8000 test: pytest tests/ -v lint: flake8 src/ # Multi-command sequence (runs with &&) build: - rm -rf dist/ - npm run build - python setup.py sdist bdist_wheel - echo "Build complete!" # Chain rav commands together deploy: - rav run test - rav run build - rsync -av dist/ user@server:/var/www/ ``` -------------------------------- ### Verify File Integrity with Python Source: https://context7.com/jmitchel3/rav/llms.txt Demonstrates how to use the IntegrityVerifier class in Python to parse SRI hashes, compute file hashes, and verify file integrity. It also shows a convenience function for quick verification. ```python from pathlib import Path from rav.integrity import IntegrityVerifier, verify_file_integrity # Parse an SRI integrity string algorithm, hash_value = IntegrityVerifier.parse_integrity( "sha384-Akqfrbj/HpNVo8k11SXBb6TlBWmXXlYQrCSqEWmyKJe+hDm3Z/B2WVG4smwBkRVm" ) # algorithm: "sha384" # hash_value: "Akqfrbj/HpNVo8k11SXBb6TlBWmXXlYQrCSqEWmyKJe+hDm3Z/B2WVG4smwBkRVm" # Compute file hash file_path = Path("./static/vendor/htmx.min.js") computed_hash = IntegrityVerifier.compute_hash(file_path, "sha384") # Returns: base64-encoded hash string # Verify integrity (returns True/False) is_valid = IntegrityVerifier.verify_integrity( file_path, "sha384-Akqfrbj/HpNVo8k11SXBb6TlBWmXXlYQrCSqEWmyKJe+hDm3Z/B2WVG4smwBkRVm" ) # Get detailed integrity information # integrity_string = "sha384-Akqfrbj/HpNVo8k11SXBb6TlBWmXXlYQrCSqEWmyKJe+hDm3Z/B2WVG4smwBkRVm" # info = IntegrityVerifier.get_integrity_info(file_path, integrity_string) # Returns: { # "algorithm": "sha384", # "expected_hash": "Akqfrbj/...", # "actual_hash": "Akqfrbj/...", # "is_valid": True, # "file_path": "/path/to/file.js", # "file_size": 45234 # } # Convenience function (returns True if no integrity or verification passes) # result = verify_file_integrity(file_path, integrity_string) ``` -------------------------------- ### Advanced Rav File Download Configuration with Overrides (YAML) Source: https://github.com/jmitchel3/rav/blob/main/README.md Demonstrates advanced configuration for file downloads, including options like `verbose`, `overwrite`, and `raise_on_error`. It also shows how individual files can override global settings like `destination` and `overwrite`. ```yaml downloads: frontend-deps: name: Frontend Dependencies destination: static/vendor verbose: true # Show detailed progress overwrite: true # Overwrite existing files raise_on_error: false # Continue on individual file errors files: - name: htmx.min.js url: https://cdn.jsdelivr.net/npm/htmx.org@2.0.6/dist/htmx.min.js integrity: sha384-Akqfrbj/HpNVo8k11SXBb6TlBWmXXlYQrCSqEWmyKJe+hDm3Z/B2WVG4smwBkRVm destination: static/js # Override global destination overwrite: false # Override global overwrite setting - name: bootstrap.min.css url: https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css destination: static/css ``` -------------------------------- ### Execute Rav File Downloads (Bash) Source: https://github.com/jmitchel3/rav/blob/main/README.md Commands to initiate file downloads based on the configuration in a Rav YAML file. It shows how to download files specified under a particular download configuration key. ```bash rav download assets # Download all files in 'assets' config rav downloads assets # Same as above (alias) ``` -------------------------------- ### Web Development Workflow with rav.yaml Source: https://github.com/jmitchel3/rav/blob/main/README.md Configures scripts for local development, code quality checks, testing, building, and deployment of a web application. It also defines frontend dependency downloads using the `downloads` feature. ```yaml name: my-web-app scripts: # Development dev: python -m http.server 8000 dev-watch: - npm run watch - rav run dev # Code quality lint: - flake8 src/ - npm run lint - echo "✅ Linting complete" format: - black src/ - prettier --write static/js/ test: - pytest tests/ -v --cov=src - npm test # Build pipeline build: - rm -rf dist/ - rav download frontend-deps - npm run build - python setup.py sdist bdist_wheel - echo "🚀 Build complete!" # Deployment deploy-staging: - rav run test - rav run build - rsync -av dist/ staging@server:/var/www/staging/ deploy-prod: - rav run test - rav run build - rsync -av dist/ prod@server:/var/www/production/ downloads: frontend-deps: name: Frontend Dependencies destination: static/vendor verbose: true overwrite: true files: # CSS Frameworks - name: bootstrap.min.css url: https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css integrity: sha384-9ndCyUa/9zzCGWL/iDMdwc9/z3dNS0MaTp5XhVpw5gGa6NZJK5YF6vZmN3K5J5zF destination: static/css # JavaScript Libraries - name: htmx.min.js url: https://cdn.jsdelivr.net/npm/htmx.org@2.0.6/dist/htmx.min.js integrity: sha384-Akqfrbj/HpNVo8k11SXBb6TlBWmXXlYQrCSqEWmyKJe+hDm3Z/B2WVG4smwBkRVm destination: static/js - name: alpine.min.js url: https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js destination: static/js ``` -------------------------------- ### Rav Download Configuration with SRI Verification (YAML) Source: https://context7.com/jmitchel3/rav/llms.txt Configures file downloads in 'rav.yaml', including URL, destination, and optional Subresource Integrity (SRI) hashes for verification. Allows overriding global settings per file. ```yaml # rav.yaml - Downloads with integrity verification name: web-app scripts: setup: rav download frontend-deps downloads: frontend-deps: name: Frontend Dependencies destination: static/vendor verbose: true overwrite: true raise_on_error: false files: # With integrity verification (SHA384) - name: htmx.min.js url: https://cdn.jsdelivr.net/npm/htmx.org@2.0.6/dist/htmx.min.js integrity: sha384-Akqfrbj/HpNVo8k11SXBb6TlBWmXXlYQrCSqEWmyKJe+hDm3Z/B2WVG4smwBkRVm destination: static/js # Override destination per file # Without integrity (downloads directly) - name: alpine.min.js url: https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js # Override settings per file - name: bootstrap.min.css url: https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css destination: static/css overwrite: false # Don't overwrite even if global is true ``` -------------------------------- ### Basic Rav File Download Configuration (YAML) Source: https://github.com/jmitchel3/rav/blob/main/README.md Configures basic file downloads within a `rav.yaml` file. It specifies a destination directory and lists files to download, including their names and URLs. ```yaml name: my-project scripts: serve: python -m http.server downloads: assets: destination: static/vendor files: - name: htmx.min.js url: https://cdn.jsdelivr.net/npm/htmx.org@2.0.6/dist/htmx.min.js - name: tailwind.css url: https://cdn.tailwindcss.com/3.4.0/tailwind.min.css ``` -------------------------------- ### DevOps/Infrastructure Project Workflow with rav.yaml Source: https://github.com/jmitchel3/rav/blob/main/README.md Manages infrastructure with Terraform, builds and runs Docker containers, deploys to Kubernetes, and sets up monitoring stacks. Utilizes `rav download` for fetching monitoring configuration files. ```yaml name: infrastructure-toolkit scripts: # Infrastructure plan: terraform plan apply: terraform apply -auto-approve destroy: terraform destroy -auto-approve # Docker workflows build: docker build -t myapp:latest . run: docker run -p 8080:8080 myapp:latest push: - docker tag myapp:latest registry.com/myapp:latest - docker push registry.com/myapp:latest # Kubernetes deploy: - kubectl apply -f k8s/ - kubectl rollout status deployment/myapp logs: kubectl logs -f deployment/myapp status: kubectl get pods,services,deployments # Monitoring setup setup-monitoring: - rav download monitoring-stack - kubectl apply -f monitoring/ - echo "📊 Monitoring stack deployed" downloads: monitoring-stack: destination: monitoring files: - name: prometheus.yaml url: https://raw.githubusercontent.com/prometheus/prometheus/main/documentation/examples/prometheus.yml - name: grafana-dashboard.json url: https://grafana.com/api/dashboards/1860/revisions/latest/download ``` -------------------------------- ### Define and Run Multiple Commands Sequentially (YAML & Bash) Source: https://github.com/jmitchel3/rav/blob/main/README.md Shows how to define a list of commands within a single script entry in the Rav YAML file. When executed, these commands are run sequentially, similar to using the `&&` operator in bash. ```yaml scripts: multi: - echo this is - echo awesome - echo simple - echo and - echo easy ``` -------------------------------- ### Rav Download Commands Source: https://github.com/jmitchel3/rav/blob/main/README.md Commands for downloading files using a configuration defined in the 'rav.yaml' file. 'rav download' and 'rav downloads' are aliases for this functionality. ```bash rav download # Download files using config rav downloads # Alias for rav download ``` -------------------------------- ### Execute Multiple Sequential Commands (Bash) Source: https://github.com/jmitchel3/rav/blob/main/README.md This snippet corresponds to the YAML definition above, showing the equivalent bash command execution. Multiple commands listed in a Rav script are joined by `&&`. ```bash rav run multi # This is the same as running: echo this is && echo awesome && echo simple && echo and && echo easy ``` -------------------------------- ### Run a Rav Script Command Source: https://context7.com/jmitchel3/rav/llms.txt Executes a script command defined in the 'rav.yaml' configuration file. Supports various options for specifying configuration files, arguments, and verbose output. ```bash # Run a named script rav run server # Shortcut form using 'x' rav x server # Run with additional arguments rav run test -- -v --coverage # Use a custom configuration file rav run -f custom.yaml deploy # Enable verbose output rav --verbose run build ``` -------------------------------- ### Download Files with Rav Source: https://context7.com/jmitchel3/rav/llms.txt Downloads files specified in the 'downloads' section of the 'rav.yaml' configuration. It supports integrity verification using Subresource Integrity (SRI) hashes for secure downloads. ```bash # Download files defined in a download configuration rav download staticfiles # Alias for download rav downloads frontend-deps ``` -------------------------------- ### Generate SRI Hashes using Bash Source: https://context7.com/jmitchel3/rav/llms.txt Provides bash commands using curl and openssl to generate Subresource Integrity (SRI) hashes (SHA384, SHA256, SHA512) for files, formatted for use in rav.yaml. ```bash # Generate SHA384 hash (recommended) curl -s https://cdn.jsdelivr.net/npm/htmx.org@2.0.6/dist/htmx.min.js | \ openssl dgst -sha384 -binary | openssl base64 -A # Output: Akqfrbj/HpNVo8k11SXBb6TlBWmXXlYQrCSqEWmyKJe+hDm3Z/B2WVG4smwBkRVm # Generate SHA256 hash curl -s https://example.com/file.js | \ openssl dgst -sha256 -binary | openssl base64 -A # Generate SHA512 hash curl -s https://example.com/file.js | \ openssl dgst -sha512 -binary | openssl base64 -A # Format for rav.yaml: sha384- ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.