Skip to content

navio/pplx-bangs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

configurable-bangs

A Cloudflare Worker that simplifies web search by providing "bang" shortcuts for popular search engines. By default, all queries are redirected to Kagi Search, but you can use special "bang" commands to instantly redirect your search to Google, Perplexity, DuckDuckGo, or Metaphor.

Features

  • Default Search: All queries go to Kagi Search unless a bang is used.
  • Bang Shortcuts: Use special commands in your query to search with a different engine:
    • !g → Google Search
    • !p → Perplexity
    • !d → DuckDuckGo
    • !met → Metaphor
    • ! (at start/end/standalone) → DuckDuckGo
  • Recall Last Query: Use !! in your query to recall and reuse your previous search (stored in a 1-deep cache).
  • Customizable: Easily modify the default engine or add new bangs in src/index.ts.

How It Works

  • Enter a search query as usual.
    • Example: how to make sourdough → redirects to Kagi.
  • Add a bang to use a different engine:
    • how to make sourdough !g → Google
    • !p sourdough starter → Perplexity
    • !met bread science → Metaphor
    • !d privacy search → DuckDuckGo
    • ! what is a bang → DuckDuckGo
  • Use !! to recall your last query and combine it with a new bang:
    • !! !g → sends your previous query to Google.

Setup & Deployment

  1. Clone the repository:

    git clone <repo-url>
    cd pplx-bangs
  2. Install dependencies:

    bun install
  3. Create the KV namespace for query caching:

    bunx wrangler kv:namespace create QUERY_CACHE
    • Add the output to your wrangler.toml as instructed.
  4. Publish the Worker:

    bunx wrangler publish
  5. Set the published Worker URL as your browser's default search engine.

Customization

  • To change the default search engine or add new bangs, edit src/index.ts.
  • The bang logic is in the handleSearch function.

License

MIT

About

tiny duckduckgo style bangs for perplexity, google and metaphor

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • TypeScript 100.0%