{"id":24788831,"url":"https://github.com/rafraanje/url-opener","last_synced_at":"2026-04-11T07:43:47.290Z","repository":{"id":272072497,"uuid":"915442780","full_name":"rafraanje/url-opener","owner":"rafraanje","description":"A command-line tool that opens URLs based on pattern matching, designed to be used with keyboard shortcuts (e.g., Win+O to open URLs from selected text). It's particularly useful for quickly opening issue trackers, tickets, or other pattern-based URLs. It can also open local files. This project was created using AI assistance (Cursor).","archived":false,"fork":false,"pushed_at":"2025-01-11T22:03:32.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-24T12:17:04.487Z","etag":null,"topics":["ai","bash","cursor","keyboard-shortcuts","linux","url-opener","urls","xclip","zenity"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rafraanje.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2025-01-11T21:19:41.000Z","updated_at":"2025-01-11T22:03:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"01146b93-714d-4eb7-9a5b-51b9c43e1e97","html_url":"https://github.com/rafraanje/url-opener","commit_stats":null,"previous_names":["rafraanje/url-opener"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rafraanje/url-opener","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafraanje%2Furl-opener","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafraanje%2Furl-opener/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafraanje%2Furl-opener/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafraanje%2Furl-opener/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rafraanje","download_url":"https://codeload.github.com/rafraanje/url-opener/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafraanje%2Furl-opener/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31673067,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-10T17:19:37.612Z","status":"online","status_checked_at":"2026-04-11T02:00:05.776Z","response_time":54,"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":["ai","bash","cursor","keyboard-shortcuts","linux","url-opener","urls","xclip","zenity"],"created_at":"2025-01-29T17:15:12.221Z","updated_at":"2026-04-11T07:43:47.285Z","avatar_url":"https://github.com/rafraanje.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# URL Opener\n\nA command-line tool that opens URLs based on pattern matching, designed to be used with keyboard shortcuts (e.g., Win+O to open URLs from selected text). It's particularly useful for quickly opening issue trackers, tickets, or other pattern-based URLs. It can also open local files. This project was created using AI assistance (Cursor).\n\n## Features\n\n- Open URLs based on configurable patterns\n- GUI mode with text entry dialog\n- Grab selected text from any window\n- Configurable URL patterns via config file\n- Support for regex capture groups\n\n## Installation\n\nThe script requires a configuration file to work. Copy the example configuration:\n\n    cp url_patterns.example.conf url_patterns.conf\n\nThen edit `url_patterns.conf` to match your needs. The example configuration contains common patterns that you can customize, see the [Configuration](#configuration) section for more information.\n\n### Dependencies\n\nThe script requires the following dependencies:\n\nFor basic functionality:\n\n    bash\n\nFor GUI support (--gui option):\n\n    # Debian/Ubuntu\n    sudo apt-get install zenity\n\n    # RedHat/CentOS\n    sudo yum install zenity\n\nFor text selection grabbing (--grab option):\n\n    # Debian/Ubuntu\n    sudo apt-get install xclip\n\n    # RedHat/CentOS\n    sudo yum install xclip\n\nFor window focusing (--focus option):\n\n    # Debian/Ubuntu\n    sudo apt-get install wmctrl\n\n    # RedHat/CentOS\n    sudo yum install wmctrl\n\n## Usage\n\n### Basic Usage\n\n    ./open_urls.sh [options] [identifier]\n\n### Options\n\n- `--gui`: Opens a GUI dialog for entering/editing the identifier\n- `--grab`: Uses currently selected text as the identifier (sanitized for safety)\n- `--focus`: Focuses the browser/application window after opening the URL/file\n- Both options can be combined: `--gui --grab`\n\n### Security Features\n\nThe script includes several security measures:\n\n- Selected text is sanitized by:\n  - Removing control characters\n  - Removing whitespace\n  - Limiting length to 1000 characters\n- File paths are validated before opening\n- URL patterns must explicitly match the entire input\n- Direct URLs must contain `://` to prevent command injection\n\n### Examples\n\n    # Basic usage\n    ./open_urls.sh PROJECT-1234\n\n    # Open GUI dialog\n    ./open_urls.sh --gui\n\n    # Open GUI with pre-filled text\n    ./open_urls.sh --gui PROJECT-1234\n\n    # Use selected text\n    ./open_urls.sh --grab\n\n    # Open GUI with selected text pre-filled\n    ./open_urls.sh --gui --grab\n\n## Configuration\n\nThe script uses a configuration file `url_patterns.conf` to define URL patterns. Each line in the file contains a pattern and URL template, separated by `|`:\n\n    # Format: pattern|url_template\n    ^(PROJECT-[0-9]+)$|https://company.atlassian.net/browse/{match}\n    ^([A-Za-z0-9_-]+)#([0-9]+)$|https://github.com/{group1}/issues/{group2}\n    ^(PROJECT-[A-Z0-9]+)$|https://company.sentry.io/issues/{match}\n\n    # Local files (with safety checks)\n    ^([.~/]?[-_./A-Za-z0-9]+)$|file://{match}\n\n    # Direct URLs\n    ^(https?://[-_./A-Za-z0-9]+)$|{match}\n\n### Pattern Format\n\n- Use regular expressions for patterns\n- Patterns are anchored (must match entire input)\n- Use capture groups `()` if needed\n- Available replacements in URL template:\n  - `{match}`: The entire matched text\n  - `{group1}`, `{group2}`, etc.: Captured groups\n\n### Example Patterns\n\n    # Jira tickets\n    ^(PROJECT-[0-9]+)$|https://company.atlassian.net/browse/{match}\n\n    # GitHub issues\n    ^([A-Za-z0-9_-]+)#([0-9]+)$|https://github.com/{group1}/issues/{group2}\n\n    # Sentry issues\n    ^(PROJECT-[A-Z0-9]+)$|https://company.sentry.io/issues/{match}\n\n### Local File Support\n\nThe script can safely open local files:\n- Supports absolute and relative paths\n- Expands ~ to home directory\n- Prevents command injection by validating paths\n- Only opens existing, readable files\n- Supports common file extensions and paths containing alphanumeric characters, dots, dashes, and underscores\n\nExamples of valid file paths:\n```bash\n./script.sh\n~/Documents/file.txt\n/etc/hosts\n../relative/path/file.pdf\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frafraanje%2Furl-opener","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frafraanje%2Furl-opener","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frafraanje%2Furl-opener/lists"}