Enable Chrome's built-in Gemini AI features outside the US
⚡ A Rust CLI application to bypass Chrome Gemini's region restrictions and unlock AI features for non-US users
Features • Quick Start • Installation • Usage • How it Works
Made by @flyingzl
- 🚀 One-Command Setup - Enable Gemini features in seconds
- 🛡️ Safe & Reversible - Automatic backups, easy restore
- 🔒 Type-Safe - Built with Rust, uses serde_json for reliable parsing
- 🌍 Cross-Platform - Supports macOS, Linux, and Windows
- 📦 Zero Dependencies - Single binary, no runtime requirements
- 🧪 Well-Tested - 100% test coverage with 22+ tests
- 📝 Clean Logs - Structured logging for debugging
- ⚡ Lightning Fast - Optimized for minimal overhead
# Install (macOS/Linux)
cargo install gemini-unlock
# Run (Chrome must be closed first)
gemini-unlock
# Or automatically close Chrome, patch, and restart
gemini-unlock --kill-chromeThat's it! Restart Chrome and enjoy Gemini features. 🎉
Download the latest release for your platform from Releases:
# macOS (Apple Silicon)
curl -LO https://github.com/flyingzl/gemini-unlock/releases/latest/download/gemini-unlock-aarch64-apple-darwin.tar.gz
tar -xzf gemini-unlock-aarch64-apple-darwin.tar.gz
mv gemini-unlock /usr/local/bin/
# macOS (Intel)
curl -LO https://github.com/flyingzl/gemini-unlock/releases/latest/download/gemini-unlock-x86_64-apple-darwin.tar.gz
tar -xzf gemini-unlock-x86_64-apple-darwin.tar.gz
mv gemini-unlock /usr/local/bin/
# Linux
curl -LO https://github.com/flyingzl/gemini-unlock/releases/latest/download/gemini-unlock-x86_64-unknown-linux-gnu.tar.gz
tar -xzf gemini-unlock-x86_64-unknown-linux-gnu.tar.gz
mv gemini-unlock /usr/local/bin/
# Windows
# Download .exe from Releases pagecargo install gemini-unlockgit clone https://github.com/flyingzl/gemini-unlock.git
cd gemini-unlock
cargo install --path .# Apply patches (Chrome must be closed)
gemini-unlock
# Automatically close Chrome before patching
gemini-unlock -k
# Restore from backup
gemini-unlock -r
# Show help
gemini-unlock --help
# Enable debug logging
RUST_LOG=debug gemini-unlock| Option | Short | Description |
|---|---|---|
--kill-chrome |
-k |
Close running Chrome before applying patches |
--restore |
-r |
Restore Local State from backup instead of patching |
--help |
-h |
Print help information |
--version |
-V |
Print version information |
| Variable | Description |
|---|---|
RUST_LOG=info |
Enable info-level logging (default) |
RUST_LOG=debug |
Enable debug-level logging |
RUST_LOG=warn |
Enable only warnings |
RUST_LOG=error |
Enable only errors |
Before using this tool, make sure to configure the following:
Set Google Chrome's language to English:
- Open Chrome settings
- Go to Languages section
- Set Display Google Chrome in this language to English
- Relaunch Chrome
Configure your VPN/proxy tool to use United States region:
- Set your proxy location to US servers
- Ensure the proxy is active before using Gemini features
- Some features may require a US IP address to function properly
Why these requirements? While this tool modifies Chrome's configuration to indicate US region, Google's servers may perform additional checks. Using US language settings and a US proxy helps ensure maximum compatibility with Gemini features.
This tool modifies Chrome's Local State configuration file to enable Gemini features by:
- Detecting your operating system and Chrome config location
- Backing up your original Local State file (as
Local State.bak) - Patching specific configuration fields:
is_glic_eligible:false→truevariations_country:<current>→"us"variations_permanent_consistency_country:<current>→["us"]
- Validating the modified JSON to ensure Chrome can read it
- Logging all operations for debugging
Chrome checks these configuration fields to determine Gemini availability. By setting them to US region values, Gemini features become unlocked even if you're in a different region.
Important Notes:
- This only modifies local configuration
- No network requests are made
- No data is sent to external servers
- Changes are reversible via the
--restoreflag
- Rust 1.85.0 or later (with Rust 2024 edition support)
- Cargo
# Debug build
cargo build
# Release build (optimized)
cargo build --release
# Run tests
cargo test
# Run with logging
RUST_LOG=debug cargo run -- --helpThe release binary will be at target/release/gemini-unlock.
We maintain 100% test coverage with 22+ tests:
# Run all tests
cargo test
# Run tests with output
cargo test -- --nocapture
# Run specific test
cargo test test_complete_patch_workflow
# Show test coverage (requires tarpaulin)
cargo tarpaulin --out HtmlTest suites include:
- Unit Tests: 13 tests for core functionality
- Integration Tests: 8 tests for end-to-end workflows
- Documentation Tests: 1 test for code examples
The tool operates on Chrome's Local State file:
| Platform | Location |
|---|---|
| macOS | ~/Library/Application Support/Google/Chrome/Local State |
| Linux | ~/.config/google-chrome/Local State |
| Windows | %LOCALAPPDATA%\Google\Chrome\User Data\Local State |
A backup is created as Local State.bak in the same directory.
This tool is designed with safety in mind:
- ✅ Type-Safe JSON Parsing
- Uses
serde_json, not regex
- Uses
- ✅ Input Validation
- Verifies JSON before and after modification
- ✅ Automatic Backups
- Creates
.bakfile before changes
- Creates
- ✅ Process Detection
- Refuses to run if Chrome is open
- ✅ Zero Network
- No external connections
- ✅ Open Source
- Fully auditable code
- ✅ Reversible
- Easy restore with
--restoreflag
- Easy restore with
This project was inspired by and built upon ideas from:
- Gemini-in-Chrome by appsail
- Original concept and implementation
Special thanks to the original author for the pioneering work on enabling Chrome Gemini features. This Rust implementation aims to provide a safer, cross-platform, and more maintainable solution with comprehensive testing and type-safe JSON handling.
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
# Clone your fork
git clone https://github.com/flyingzl/gemini-unlock.git
cd gemini-unlock
# Install development dependencies
cargo install cargo-tarpaulin # For coverage reports
# Run linter
cargo clippy -- -D warnings
# Format code
cargo fmt
# Run tests
cargo testThis project is licensed under either of:
- MIT License (LICENSE-MIT or https://opensource.org/licenses/MIT)
- Apache License, Version 2.0 (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
at your option.
- Built with Rust
- Uses serde and serde_json
- CLI powered by clap
- Error handling with thiserror and anyhow
- Gemini-in-Chrome by appsail - Original implementation
- ungoogled-chromium - Chromium without Google integration
- chromium - Chromium source code
Made with ❤️ and Rust by @flyingzl
⭐ Star this repo if it helped you!