{"id":34743788,"url":"https://github.com/passabilities/scripts","last_synced_at":"2026-05-26T10:31:48.226Z","repository":{"id":318950968,"uuid":"1072641103","full_name":"passabilities/scripts","owner":"passabilities","description":null,"archived":false,"fork":false,"pushed_at":"2025-10-15T18:37:33.000Z","size":107,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-16T18:43:00.558Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/passabilities.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-09T02:33:14.000Z","updated_at":"2025-10-15T18:37:37.000Z","dependencies_parsed_at":"2025-10-17T11:17:38.625Z","dependency_job_id":"755be965-684b-4269-8d68-e65923cb2263","html_url":"https://github.com/passabilities/scripts","commit_stats":null,"previous_names":["passabilities/scripts"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/passabilities/scripts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/passabilities%2Fscripts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/passabilities%2Fscripts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/passabilities%2Fscripts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/passabilities%2Fscripts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/passabilities","download_url":"https://codeload.github.com/passabilities/scripts/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/passabilities%2Fscripts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28019488,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-25T02:00:05.988Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-12-25T04:28:30.413Z","updated_at":"2025-12-25T04:28:33.150Z","avatar_url":"https://github.com/passabilities.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DGB Scripts\n\nA comprehensive collection of shell scripts for AWS infrastructure automation, deployment, and monitoring. Scripts are organized in logical subdirectories with automated symlink management for easy PATH accessibility.\n\n## Table of Contents\n\n- [Features](#features)\n- [Architecture](#architecture)\n- [Installation](#installation)\n- [Quick Start](#quick-start)\n- [Available Scripts](#available-scripts)\n  - [AWS Visualization Tools](#aws-visualization-tools)\n- [Usage](#usage)\n- [Development](#development)\n- [Configuration](#configuration)\n- [Contributing](#contributing)\n\n## Features\n\n- **Organized Structure**: Scripts organized in logical subdirectories under `src/`\n- **Automated Symlinks**: Flat symlinks in `bin/` for PATH accessibility\n- **Git Hooks**: Pre-commit hook automatically updates symlinks\n- **Interactive Prompts**: Beautiful npm-style UI with arrow key navigation\n- **AWS Integration**: Comprehensive AWS resource discovery and monitoring\n- **Project-Based**: Support for multi-project environments with filtering\n- **Environment Discovery**: Automatic detection of existing AWS environments\n\n## Architecture\n\n### Directory Structure\n\n```\nscripts/\n├── src/                    # Source scripts (organized by category)\n│   ├── aws/               # AWS-related scripts\n│   │   └── vis/          # Visualization and monitoring tools\n│   └── lib/              # Shared libraries (sourced, not executed)\n├── bin/                   # Auto-generated symlinks (flat structure)\n├── setup-bin.sh          # Symlink management utility\n└── .git/hooks/           # Git hooks for automation\n    └── pre-commit        # Auto-runs setup-bin.sh\n```\n\n### How It Works\n\n1. **Scripts** are created in logical subdirectories under `src/`\n2. **Symlinks** are auto-generated in `bin/` with flattened names\n   - Example: `src/aws/deploy.sh` → `bin/aws-deploy.sh`\n3. **Git hooks** automatically regenerate symlinks on commit\n4. **Libraries** in `src/lib/` are sourced by scripts (no `.sh` extension)\n\n### Why This Architecture?\n\nShell scripts in PATH directories must be directly accessible (subdirectories are not searched). This architecture provides:\n- Logical organization in `src/` subdirectories\n- Flat structure in `bin/` for PATH accessibility\n- Automatic synchronization via git hooks\n- Clear separation between executable scripts and sourced libraries\n\n## Installation\n\n### Prerequisites\n\n- Bash 4.0 or higher\n- Git\n- AWS CLI (for AWS scripts)\n- jq (for JSON processing in AWS scripts)\n\n### Setup\n\n1. Clone the repository:\n   ```bash\n   git clone \u003crepository-url\u003e\n   cd scripts\n   ```\n\n2. Generate symlinks:\n   ```bash\n   ./setup-bin.sh\n   ```\n\n3. (Optional) Add `bin/` to your PATH:\n   ```bash\n   echo 'export PATH=\"$PATH:/path/to/scripts/bin\"' \u003e\u003e ~/.bashrc\n   source ~/.bashrc\n   ```\n\n4. For AWS scripts, configure AWS CLI:\n   ```bash\n   aws configure\n   ```\n\n## Quick Start\n\n### Running Scripts\n\nIf `bin/` is in your PATH:\n```bash\n# Run by flattened name\naws-vis-status-dashboard.sh\n```\n\nOtherwise:\n```bash\n# Run from bin directory\n./bin/aws-vis-status-dashboard.sh\n\n# Or run source directly\n./src/aws/vis/status-dashboard.sh\n```\n\n### Creating a New Script\n\n1. Create your script in the appropriate subdirectory:\n   ```bash\n   touch src/category/my-script.sh\n   vim src/category/my-script.sh\n   ```\n\n2. Add shebang and make it executable (optional, setup-bin.sh handles this):\n   ```bash\n   #!/bin/bash\n   ```\n\n3. Regenerate symlinks:\n   ```bash\n   ./setup-bin.sh\n   # Or just commit - the pre-commit hook handles it\n   git add src/category/my-script.sh\n   git commit -m \"Add my new script\"\n   ```\n\n## Available Scripts\n\n### AWS Visualization Tools\n\nLocated in `src/aws/vis/`, these tools provide comprehensive AWS infrastructure monitoring and visualization.\n\n#### Status Dashboard (`aws-vis-status-dashboard.sh`)\n\nReal-time infrastructure health monitoring with color-coded status indicators.\n\n**Features:**\n- Live status monitoring for all AWS resources\n- Health indicators: healthy/warning/critical/unknown\n- Supported resources: VPC, RDS, ElastiCache, S3, SES, Elastic Beanstalk\n- Project-based filtering or \"show all\" mode\n- Visual separation between resource types\n- Regional filtering for S3 buckets\n\n**Usage:**\n```bash\n./bin/aws-vis-status-dashboard.sh\n```\n\n**Example Output:**\n```\n╔═══════════════════════════════════════════════════════════════════════════╗\n║  VPC \u0026 Network\n╟───────────────────────────────────────────────────────────────────────────╢\n║  ✓  VPC                    my-project-vpc                   available\n║  ✓  Internet Gateway       igw-xxx                          available\n╚═══════════════════════════════════════════════════════════════════════════╝\n\n╔═══════════════════════════════════════════════════════════════════════════╗\n║  Database (RDS)\n╟───────────────────────────────────────────────────────────────────────────╢\n║  ✓  RDS Instance           my-project-db                    available\n╚═══════════════════════════════════════════════════════════════════════════╝\n```\n\n#### Discover Resources (`aws-vis-discover-resources.sh`)\n\nAutomated resource discovery with tag-based project filtering.\n\n**Features:**\n- Scans all AWS resources in a region\n- Tag-based project filtering (Project tag)\n- JSON output for automation and integration\n- Discovers: VPC, Subnets, Security Groups, RDS, ElastiCache, S3, SES, Elastic Beanstalk\n\n**Usage:**\n```bash\n./bin/aws-vis-discover-resources.sh\n```\n\n**Output Format:**\nJSON with resource types, IDs, names, and relationships\n\n#### Infrastructure Visualization (`aws-vis-infra.sh`)\n\nASCII diagram generation of infrastructure with dependency mapping.\n\n**Features:**\n- ASCII architecture diagrams\n- Dependency tree visualization\n- Resource relationship mapping\n- Empty state handling with helpful suggestions\n- Dynamic VPC labeling based on filter mode\n\n**Usage:**\n```bash\n./bin/aws-vis-infra.sh\n```\n\n**Example Output:**\n```\n                        ┌─────┐\n                        │     │\n                    ┌───┤ AWS ├───┐\n                    │   │     │   │\n                    │   └─────┘   │\n╔═══════════════════════════════════════════════════════════════╗\n║  VPC (my-project-vpc)                                         ║\n║                   │                                           ║\n║            ┌──────▼──────┐                                    ║\n║            │ Internet GW │                                    ║\n║            └──────┬──────┘                                    ║\n╚═══════════════════════════════════════════════════════════════╝\n```\n\n### Configuration Options\n\nAll AWS visualization scripts support:\n\n- **Interactive configuration prompts** with environment discovery\n- **Project-based filtering** using Project tags\n- **\"Show all resources\" mode** to ignore filters\n- **Configuration file** loading from `aws-config.env`\n- **Environment auto-discovery** from Elastic Beanstalk applications\n\n## Usage\n\n### Interactive Configuration\n\nWhen you run any AWS visualization script, you'll be prompted to:\n\n1. **Select or create a project**\n   - Choose from discovered AWS projects\n   - Create a new project\n   - Show all resources (no filter)\n\n2. **Select environment** (if project chosen)\n   - Discovered environments from Elastic Beanstalk\n   - Standard environments (development/staging/production)\n   - Custom environment name\n\n3. **Choose AWS region**\n   - Select from list of AWS regions\n   - Custom region\n\n### Configuration File\n\nCreate `aws-config.env` in the script directory to save your configuration:\n\n```bash\nPROJECT_NAME=\"my-project\"\nENVIRONMENT=\"production\"\nAWS_REGION=\"us-east-1\"\n```\n\nScripts will automatically load these values if available.\n\n### Resource Naming Conventions\n\nFor best results with project filtering, follow these naming patterns:\n\n- **VPC**: `{PROJECT_NAME}-vpc` or tagged with `Project={PROJECT_NAME}`\n- **RDS**: `{PROJECT_NAME}-db` or `{PROJECT_NAME}-{ENV}-db`\n- **ElastiCache**: `{PROJECT_NAME}-redis` or `{PROJECT_NAME}-cache`\n- **Elastic Beanstalk**: `{PROJECT_NAME}-app-{ENVIRONMENT}`\n- **S3 Buckets**: Contains `{PROJECT_NAME}` in the name\n- **Security Groups**: Tagged with `Project={PROJECT_NAME}`\n\n## Development\n\n### Adding New Scripts\n\n1. **Choose the right directory** under `src/`\n   - Use existing subdirectories or create new ones\n   - Group related scripts together\n\n2. **Naming conventions**:\n   - Executable scripts: Include `.sh` extension\n   - Libraries (sourced): NO `.sh` extension\n   - Use lowercase with hyphens: `my-script.sh`\n\n3. **Script template**:\n   ```bash\n   #!/bin/bash\n\n   # Get script directory (works when run from anywhere)\n   SCRIPT_DIR=\"$( cd \"$( dirname \"${BASH_SOURCE[0]}\" )\" \u0026\u003e /dev/null \u0026\u0026 pwd )\"\n\n   # For sourcing libraries\n   LIB_DIR=\"$(dirname \"$(dirname \"$SCRIPT_DIR\")\")/src/lib\"\n   source \"${LIB_DIR}/prompts\"\n   ```\n\n4. **Test and commit**:\n   ```bash\n   ./src/category/my-script.sh  # Test\n   git add src/category/my-script.sh\n   git commit -m \"feat: add my new script\"\n   # Pre-commit hook automatically updates bin/\n   ```\n\n### Using Shared Libraries\n\nAvailable libraries in `src/lib/`:\n\n#### `prompts` - Interactive Prompts\n```bash\nsource \"${LIB_DIR}/prompts\"\n\n# Text input with validation\nprompt_text VAR \"Enter value\" \"default\" \"^[a-z]+$\"\n\n# Select menu\nprompt_select CHOICE \"Select option\" 0 \"Option 1\" \"Option 2\"\n\n# Select or custom input\nprompt_select_or_custom VAR \"Choose\" \"default\" \"opt1\" \"opt2\"\n\n# Confirmation\nprompt_confirm \"Continue?\" \u0026\u0026 echo \"Yes!\"\n\n# Display functions\nprompt_header \"Title\" \"Description\"\nprompt_success \"Success message\"\nprompt_error \"Error message\"\nprompt_warning \"Warning message\"\nprompt_info \"Info message\"\n```\n\n#### `config-display` - Configuration Display\n```bash\nsource \"${LIB_DIR}/config-display\"\n\ndisplay_config \"header\" \"Title\" \"Description\"\ndisplay_config \"compact\" \"Title\" \"Description\"\ndisplay_config \"inline\" \"Label\" \"value\"\ndisplay_config \"summary\" \"Title\" \"message\"\n```\n\n#### `config-prompt` - AWS Configuration\n```bash\nsource \"${LIB_DIR}/config-prompt\"\n\n# Discover AWS projects\nprojects=$(discover_aws_projects)\n\n# Discover environments for a project\nenvs=$(discover_project_environments \"$PROJECT_NAME\")\n\n# Prompt for AWS configuration\nprompt_aws_config \"true\" \"visualization\"\n# Returns: PROJECT_NAME, ENVIRONMENT, AWS_REGION exported\n```\n\n### Git Workflow\n\n```bash\n# 1. Create or edit scripts in src/\nvim src/category/new-script.sh\n\n# 2. Test the script\n./src/category/new-script.sh\n\n# 3. Commit changes\ngit add src/category/new-script.sh\ngit commit -m \"feat: add new script\"\n# Pre-commit hook automatically updates bin/\n\n# 4. Push changes\ngit push\n```\n\n### Manual Symlink Regeneration\n\n```bash\n# Regenerate all symlinks\n./setup-bin.sh\n\n# Output shows all created symlinks:\n#   src/category/script.sh -\u003e bin/category-script.sh\n#   Done! Created N symlinks in bin/\n```\n\n## Configuration\n\n### Git Configuration\n\nThis repository uses SSH for git operations. Ensure your git remotes use SSH URLs:\n\n```bash\ngit remote -v\n# Should show: git@github.com:user/repo.git (not https://)\n```\n\n### Pre-commit Hook\n\nThe pre-commit hook (`.git/hooks/pre-commit`):\n1. Runs `./setup-bin.sh` to regenerate symlinks\n2. Checks for changes in `bin/` directory\n3. Automatically stages `bin/` changes if detected\n4. Allows commit to proceed\n\nThis ensures `bin/` always stays synchronized with `src/` in version control.\n\n### AWS Credentials\n\nConfigure AWS CLI with your credentials:\n\n```bash\naws configure\n# AWS Access Key ID: \u003cyour-key\u003e\n# AWS Secret Access Key: \u003cyour-secret\u003e\n# Default region name: us-east-1\n# Default output format: json\n```\n\nOr use environment variables:\n```bash\nexport AWS_ACCESS_KEY_ID=\"your-key\"\nexport AWS_SECRET_ACCESS_KEY=\"your-secret\"\nexport AWS_DEFAULT_REGION=\"us-east-1\"\n```\n\n## Contributing\n\n### Code Style\n\n- Use 4-space indentation\n- Follow existing script patterns\n- Use descriptive variable names\n- Add comments for complex logic\n- Always use absolute paths (derived from `$SCRIPT_DIR`)\n\n### Testing\n\nBefore committing:\n1. Test your script from different directories\n2. Verify it works when run via symlink\n3. Check that library sourcing works correctly\n4. Test with and without configuration files\n\n### Pull Requests\n\n1. Create a feature branch\n2. Make your changes\n3. Test thoroughly\n4. Commit with conventional commit messages\n5. Push and create a pull request\n\n### Commit Message Format\n\nUse conventional commits:\n```\ntype(scope): description\n\n[optional body]\n\n[optional footer]\n```\n\nTypes: `feat`, `fix`, `refactor`, `perf`, `test`, `docs`, `style`, `chore`, `build`, `ci`\n\nExamples:\n```\nfeat(aws): add EC2 instance monitoring script\nfix(lib): correct path resolution for nested scripts\ndocs: update README with new AWS tools\n```\n\n## License\n\n[Your License Here]\n\n## Support\n\nFor issues or questions:\n- Create an issue on GitHub\n- Check `CLAUDE.md` for detailed development guidelines\n- Review existing scripts for examples\n\n## Acknowledgments\n\nBuilt with:\n- Bash scripting\n- AWS CLI\n- Git hooks for automation\n- Interactive prompts library\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpassabilities%2Fscripts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpassabilities%2Fscripts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpassabilities%2Fscripts/lists"}