{"id":23468395,"url":"https://github.com/dikkadev/bangs","last_synced_at":"2025-04-12T21:39:28.408Z","repository":{"id":258118410,"uuid":"872094876","full_name":"dikkadev/bangs","owner":"dikkadev","description":null,"archived":false,"fork":false,"pushed_at":"2025-01-12T11:46:17.000Z","size":3410,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-05T23:55:49.118Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dikkadev.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,"zenodo":null}},"created_at":"2024-10-13T19:05:02.000Z","updated_at":"2025-01-04T18:50:01.000Z","dependencies_parsed_at":"2024-10-26T22:42:18.263Z","dependency_job_id":"643a70de-7c14-4d4c-97fa-e3ba3ba1a223","html_url":"https://github.com/dikkadev/bangs","commit_stats":null,"previous_names":["sett17/bangs"],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dikkadev%2Fbangs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dikkadev%2Fbangs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dikkadev%2Fbangs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dikkadev%2Fbangs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dikkadev","download_url":"https://codeload.github.com/dikkadev/bangs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248631679,"owners_count":21136562,"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","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":"2024-12-24T13:52:56.315Z","updated_at":"2025-04-12T21:39:28.388Z","avatar_url":"https://github.com/dikkadev.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bangs\n\nA lightweight and extensible search engine that leverages \"bangs\" to quickly redirect queries to your favorite services. Customize your search experience by defining your own bangs and effortlessly expand its capabilities.\n\n## Features\n\n- **Customizable Bangs**: Define and manage your own bangs through a simple `bangs.yaml` configuration file.\n- **Flexible Query Handling**: Perform searches using query parameters or clean URL paths.\n- **Default Search Engine**: Specify a default search URL for queries without a bang (only works when using `q` query parameter).\n- **Public Instances**: Accessible via [https://bang.dikka.dev](https://bang.dikka.dev) and [https://s.dikka.dev](https://s.dikka.dev) with HTTPS support.\n- **Extensible \u0026 Open**: Contributions to expand and refine bang definitions are highly encouraged.\n- **Robust Testing**: Automated Go workflows ensure the correctness and reliability of bang URLs.\n\n## Public Instances\n\nExperience Bangs without any setup by using our public instances:\n\n- **Primary Instance**: [https://bang.dikka.dev](https://bang.dikka.dev)\n- **Alternative Instance**: [https://s.dikka.dev](https://s.dikka.dev)\n\nBoth URLs point to the same backend and support HTTPS for secure connections.\n\n## Installation\n\n### Docker (Preferred)\n\n\u003e **Note:** Docker support is coming. Stay tuned for updates!\n\n- **Docker Image**: To be hosted on GitHub.\n- **Usage**: TBD\n\n### Build from Source\n\nEnsure you have [Go](https://golang.org/dl/) installed (version 1.18 or later).\n\n1. **Clone the Repository**\n\n    ```bash\n    git clone https://github.com/Sett17/bangs.git\n    cd bangs\n    ```\n\n2. **Build the Application**\n\n    ```bash\n    go build -o bangs ./cmd\n    ```\n\n## Usage\n\n### Usage Scenarios\n\n#### 1. Query-Based Search\n\nPerform a search by specifying the bang and query as URL parameters using the public instance.\n\n**Example:**\n\n```bash\nhttps://s.dikka.dev/?q=!gh Sett17/bangs\n```\n\n**Explanation:**  \nThe above URL uses the `!gh` bang to perform a GitHub search for the repository `Sett17/bangs`.\n\nWith query-based searches, you also have the option to omit the bang and use the default search engine defined in `bangs.yaml`. This is useful when you want to use bangs as the default search engine in your browser, so you do not need to specify a bang every time.\n\n#### 2. Path-Based Search\n\nPerform a search by embedding the bang and query directly into the URL path using the public instance.\n\n**Example:**\n\n```bash\nhttps://s.dikka.dev/!gh/Sett17/bangs\n```\n\n**Explanation:**  \nThis URL achieves the same search as the query-based example but uses the path to specify the bang and query.\n\n#### 3. Default Search\n\nPerform a search without specifying a bang, which uses the default search engine.\n\n**Example:**\n\n```bash\nhttps://s.dikka.dev/?q=OpenAI ChatGPT\n```\n\n**Explanation:**  \nThe above URL uses the default search engine defined in `bangs.yaml` to search for \"OpenAI ChatGPT\".\n\n#### 4. Double Hashtag Search\n\nPerform a search by typing a double hashtag `##` at the start of the query, which uses the default search engine.\n\n**Example:**\n\n```bash\nhttps://s.dikka.dev/?q=##OpenAI ChatGPT\n```\n\n**Explanation:**  \nThe above URL uses the default search engine defined in `bangs.yaml` to search for \"OpenAI ChatGPT\" by stripping the `##` from the query.\n\n### Command-Line Options\n\n| Option          | Short | Description                                     | Default         | Example                  |\n|-----------------|-------|-------------------------------------------------|-----------------|--------------------------|\n| `--bangs`       | `-b`  | Path to the YAML file containing bang definitions. | `bangs.yaml`    | `-b path/to/your/bangs.yaml` |\n| `--port`        | `-p`  | Port on which the server will run.              | `8080`          | `-p 9090`                |\n| `--verbose`     | `-v`  | Enable verbose debug logging.                   | `false`         | `-v`                     |\n| `--help`        | `-h`  | Show help message.                              | `false`         | `-h`                     |\n\n## Configuration\n\nBangs are defined in a `bangs.yaml` file. Each bang maps a unique identifier to a search URL containing a placeholder `{}` where the query will be inserted. Additionally, a `default` key can be specified to handle searches without a bang.\n\n**Example `bangs.yaml`:**\n\n```yaml\ndefault: 'https://www.google.com/search?q={}'\n\n# Other search engines:\n# default: 'https://www.bing.com/search?q={}'\n# default: 'https://duckduckgo.com/?q={}'\n\nGitHub:\n  bang: 'gh'\n  url: 'https://github.com/search?q={}'\n  description: 'Search code repositories on GitHub'\n\ng:\n  bang: \"g\"\n  url: \"https://www.google.com/search?q={}\"\n  description: 'Popular global search engine by Google.'\n```\n\n## Setting Bangs as the Default Search Engine\n\nThis capability varies based on your browser.\n\n### Chromium-Based Browsers\n\n[s.dikka.dev/g/chrome set default search engine](https://s.dikka.dev/g/chrome%20set%20default%20search%20engine)\n\n### Firefox\n\n[s.dikka.dev/g/firefox set default search engine](https://s.dikka.dev/g/firefox%20set%20default%20search%20engine)\n\n## Advanced Usage\n\nEnhance your Bangs experience with advanced configurations and persistent setups. For detailed instructions, please refer to the [Advanced Usage](./ADVANCED.md) guide.\n\n## Contributing\n\nContributions are highly welcome! If you have new bangs to add or improvements to the existing ones, feel free to submit a pull request to the `bangs.yaml` file.\n\n### How to Contribute\n\n- **Branch Naming**: Please name your feature branches in the format `bang/{chars}`, where `{chars}` represents the bang characters (e.g., `bang/y`, `bang/gh`).\n- **Adding Bangs**: Ensure your new bang is placed in the appropriate section within `bangs.yaml`.\n- **Non-Search Bangs**: If your contribution is not a search-related bang, please explain the use case clearly in your pull request description.\n- **Follow Templates**: There are issue and PR templates in place to guide your contributions. Please follow them.\n\n## Testing\n\nThe project includes a comprehensive Go test workflow that not only checks the functionality of the application but also validates the correctness of all bang URLs defined in `bangs.yaml`.\n\n### Running Tests Locally\n\n```bash\ngo test ./...\n```\n\n### Continuous Integration\n\nEvery pull request triggers the Go test workflow to ensure that new contributions do not break existing functionality and that all bang URLs remain valid.\n\n## Docker\n\n### Installation and Running with Docker\n\n\u003e **Note:** Docker support is forthcoming. Stay tuned for updates!\n\n- **Docker Image**: To be hosted on GitHub.\n- **Usage**: TBD\n\n## License\n\n[LICENSE](./LICENSE)\n\n---\n\nHappy Searching! 🚀\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdikkadev%2Fbangs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdikkadev%2Fbangs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdikkadev%2Fbangs/lists"}