# og
> A smart file opener acting as a routing gateway.
`og` (Open Gateway) is a rule-based file opener. It works like a network gateway, but for your local files: it intercepts "open" requests and routes them to different applications based on rules you define.
Most operating systems enforce a simple "1-to-1" mapping between file extensions and applications, but `og` allows for "1-to-many" logic based on context.
For example, you can tell `og` to:
- Open `.md` files in your `~/work` directory with **Obsidian**.
- Open `.md` files in `~/dev` with **VS Code**.
- Open `.ts` files that are actually MPEG-TS video with **QuickTime Player**, while keeping your TypeScript files in your code editor.
## Features
- Context-aware Routing: Match files using glob patterns, file extensions, MIME types, or magic bytes.
- TUI Config Manager(WIP): Includes a terminal user interface for managing rules and testing matches without editing TOML files manually.
- Performance: Written in Rust for minimal latency.
- System Fallback: Seamlessly falls back to system defaults when no rules match.
## Installation
```bash
cargo install og
```
## Usage
```bash
# Routes according to your rules
og README.md
# Shows which rule would match this file
og test ./build/output.bin
# Show help for more function
og help
```
### Configuration
See toml config files in [example/](example/)
## License
MIT License