Musheer360/SwiftSlate-Desktop
소개
System-wide AI text transformation for Windows
생산성 및 자동화측정된 스타 증가
- in 24h
- 0
- in 7 days
- +1
- in 15 days
- +2
- in 1 month
- +3
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalSwiftSlate Desktop
System-wide AI text transformation for Windows
Type a trigger like ?fix at the end of any text, in any app, and watch it get replaced — instantly.
Linux support coming soon.
📋 Table of Contents
- Quick Demo
- Features
- Getting Started
- Built-in Commands
- Supported AI Providers
- API Key Management
- Configuration
- Custom Commands
- How It Works
- Debug Mode
- Privacy & Security
- Tech Stack
- Building from Source
- Known Limitations
- Contributing
- Support the Project
- License
⚡ Quick Demo
You type: "i dont no whats hapening ?fix"
You see: "i dont no whats hapening ◐" (spinner animates)
Result: "I don't know what's happening."
You type: "hey can u send me that file ?formal"
You see: "hey can u send me that file ◐" (spinner animates)
Result: "Could you please share the file at your earliest convenience?"
You type: "Hello, how are you? ?translate:es"
You see: "Hello, how are you? ◐" (spinner animates)
Result: "Hola, ¿cómo estás?"
✨ Features
🌐 Works EverywhereIntegrates at the system level via Windows Raw Input API. Works in every app — browsers, editors, messaging apps, terminals, IDEs, and more. ⚡ Instant Inline ReplacementType, trigger, done. The AI response replaces your text directly in the same field — no copy-pasting, no app switching. While processing, an animated spinner appends to your text (e.g., 🔑 Multi-Key RotationAdd multiple API keys for automatic round-robin rotation. If one key hits a rate limit, SwiftSlate seamlessly switches to the next. |
🤖 Multi-Provider AIShips with Google Gemini, Groq, or connect any OpenAI-compatible endpoint — cloud providers, or local LLMs like Ollama, LM Studio, and others running locally. 🛠️ Two Command TypesAI commands send text to your provider for intelligent transformation. Text replacer commands run locally and need no API key, except 🔄 Hot ReloadEdit your config or commands file and changes apply within 2 seconds — no restart needed. |
🚀 Getting Started
One-Line Install
irm https://raw.githubusercontent.com/Musheer360/SwiftSlate-Desktop/master/install.ps1 | iex
If that fails, use the jsDelivr CDN mirror:
irm https://cdn.jsdelivr.net/gh/Musheer360/SwiftSlate-Desktop@master/install.ps1 | iex
[!NOTE] After a release, the jsDelivr CDN can serve the previous version for up to ~12 hours. If an update reports the old version, re-run using the GitHub raw command above.
Run the installer in a normal (non-admin) window. Uninstalling removes everything, including
config.jsonandcommands.json(the installer asks for confirmation first).
The installer handles everything — downloads a portable Python runtime if needed, sets up the config, and optionally adds to startup.
Run the same command again to update or uninstall.
Prerequisites
| Requirement | Details |
|---|---|
| Windows | Windows 10 or 11 (64-bit) |
| API Key | Free Gemini key at aistudio.google.com, or Groq at console.groq.com/keys, or any OpenAI-compatible provider. Text replacer commands don't consume a key, but the app requires at least one API key in config.json to start. |
[!NOTE] Python is not required on your system. If not found, the installer downloads an embedded Python runtime (~11 MB) that lives entirely inside the
.swiftslatefolder.
🧩 Built-in Commands
SwiftSlate ships with 9 AI-powered commands, dynamic translation, 3 built-in shell replacers (?date, ?time, ?ip), and clipboard commands — ready to use out of the box:
| Trigger | Action | Example |
|---|---|---|
?fix |
Fix grammar, spelling & punctuation | i dont no whats hapening → I don't know what's happening. |
?improve |
Improve clarity and readability | The thing is not working good → The feature isn't functioning properly. |
?shorten |
Shorten while keeping meaning | I wanted to let you know that I will not be able to attend → I can't attend. |
?expand |
Expand with more detail | Meeting postponed → The meeting has been postponed. We'll share the updated schedule soon. |
?formal |
Rewrite in professional tone | hey can u send me that file → Could you please share the file at your earliest convenience? |
?casual |
Rewrite in friendly tone | Please confirm your attendance → Hey, you coming? Let me know! |
?emoji |
Add relevant emojis | I love this new feature → I love this new feature! 🎉❤️✨ |
?human |
Humanize AI-generated text | I hope this email finds you well → Hope you're doing well |
?reply |
Generate a contextual reply | Do you want to grab lunch? → Sure! What time works for you? |
?undo |
Restore text before last replacement | Reverts to your original text |
?translate:XX |
Translate to any language | Hello ?translate:es → Hola |
Text Replacers (instant, offline)
| Trigger | Action |
|---|---|
?date |
Today's date |
?time |
Current time |
?ip |
Public IP address (queries ifconfig.me) |
Clipboard Commands
| Trigger | Action |
|---|---|
?copy |
Copy preceding text to internal clipboard |
?cut |
Cut preceding text |
?paste |
Paste after existing text (falls back to system clipboard if internal stack is empty) |
?replace |
Replace all text with clipboard content (falls back to system clipboard if internal stack is empty) |
🤖 Supported AI Providers
| Provider | Recommended Models | Notes |
|---|---|---|
| Google Gemini (default) | gemini-3.5-flash-lite (default), gemini-3.6-flash |
Free tier at aistudio.google.com. Thinking level set per model for fast inline transforms. |
| Groq | openai/gpt-oss-120b (default), qwen/qwen3.6-27b |
Free tier at console.groq.com. Per-model reasoning params applied automatically. |
| Custom (OpenAI-compatible) | Any model your endpoint supports | Works with Ollama, LM Studio, vLLM, any /v1/chat/completions endpoint |
[!TIP] For local LLMs, set the endpoint to your machine's local address (e.g.,
http://localhost:11434/v1for Ollama).
🔑 API Key Management
SwiftSlate supports multiple API keys with intelligent rotation:
| Feature | Details |
|---|---|
| Round-Robin Rotation | Keys are used in turn to spread usage evenly |
| Rate-Limit Handling | If a key gets rate-limited (HTTP 429), SwiftSlate tracks the cooldown and skips it automatically |
| Invalid Key Detection | Keys returning 401/403 errors are marked invalid and excluded from rotation |
| Automatic Retry | Transient network errors wait 1 second before retrying (per attempt); server errors rotate to the next key |
[!TIP] Adding 2–3 API keys helps avoid rate limits during heavy use.
⚙️ Configuration
All settings live in %USERPROFILE%\.swiftslate\ and hot-reload automatically:
config.json
{
"api_keys": ["your-key-1", "your-key-2"],
"model": "gemini-3.5-flash-lite",
"provider": "gemini",
"temperature": 0.5,
"prefix": "?",
"key_delay": 200,
"spinner": "animated"
}
| Field | Description |
|---|---|
api_keys |
Array of API keys (supports multiple for rotation) |
model |
Model name for your provider |
provider |
groq, gemini, or custom |
temperature |
Response creativity (0.0 = deterministic, 1.0 = creative) |
prefix |
Trigger prefix character (default: ?) |
endpoint |
Required for custom provider (e.g., http://localhost:11434/v1) |
key_delay |
Milliseconds between dependent keystrokes (default: 200). Decrease to 100 on fast machines for snappier response, increase to 300 on very slow machines if text replacement glitches. The spinner animation speed automatically scales with this value. |
spinner |
Progress indicator mode: animated (default — spinning ◐◓◑◒), static (shows [Processing...] with zero animation keystrokes — the most reliable option for slow machines), or off (no visual feedback). |
[!TIP] The installer's model prompt fetches the live model list from Gemini/Groq using the key you enter, so newly released models show up immediately. If a
modelinconfig.jsonisn't one of the app's tuned defaults, SwiftSlate checks it against that same live catalog on load (and on every hot-reload) before falling back — so any model your key can access is usable, not just the curated ones. Only models the provider has explicitly retired are always replaced with the default.
🛠️ Custom Commands
Add your own commands in commands.json:
[
{ "trigger": "email", "type": "replacer-text", "value": "[email protected]" },
{ "trigger": "sig", "type": "replacer-text", "value": "Best regards,\nYour Name" },
{ "trigger": "uuid", "type": "replacer-shell", "value": "powershell -NoProfile -Command \"[guid]::NewGuid()\"" },
{ "trigger": "eli5", "type": "ai", "prompt": "Explain this like I'm five years old." },
{ "trigger": "bullet", "type": "ai", "prompt": "Convert this text into bullet points." }
]
Command Types
| Type | How It Works | Needs API Key? | Latency |
|---|---|---|---|
ai |
Sends text to your AI provider with your custom prompt | Yes | ~1–3 seconds |
replacer-text |
Replaces the trigger with a fixed string, entirely offline | No | Instant |
replacer-shell |
Runs a shell command and replaces with its output | No | Instant |
[!CAUTION] Shell commands run unsandboxed. The
replacer-shelltype executes arbitrary commands with your user privileges. Never importcommands.jsonfiles from untrusted sources — a malicious command could compromise your system the moment you type its trigger.
🔧 How It Works
flowchart TD
A["📝 You type: 'Hello wrld ?fix'"] --> B{"🔍 Raw Input API\ndetects trigger"}
B -- "Text Replacer" --> C["⚡ Instant local replacement\n(no network call)"]
B -- "AI Command" --> D["🔑 Selects next API key\n(round-robin)"]
D --> E["🤖 Sends text + prompt\nto AI provider"]
E --> F["⏳ Spinner appended to text\nhow r u ◐ ◓ ◑ ◒"]
F --> G["✅ Replaces text in-place"]
C --> G
style A fill:#1a1a2e,stroke:#e94560,color:#fff
style B fill:#1a1a2e,stroke:#0f3460,color:#fff
style C fill:#1a1a2e,stroke:#00b894,color:#fff
style D fill:#1a1a2e,stroke:#0f3460,color:#fff
style E fill:#1a1a2e,stroke:#0f3460,color:#fff
style F fill:#1a1a2e,stroke:#e94560,color:#fff
style G fill:#16213e,stroke:#00b894,color:#fff
🔧 Technical deep-dive
- Keystroke Capture — Registers a hidden window with Windows Raw Input API to receive all keyboard events system-wide (same API class used by accessibility tools)
- Fast Exit Optimization — Checks if the last character matches any known trigger's last character before doing a full scan
- Longest Match — When a potential match is found, searches for the longest matching trigger at the end of the buffer
- Buffer Safety — Buffer clears automatically on window change, navigation keys, Enter, Escape, and Tab to prevent cross-app trigger collisions
- Command Routing — Text replacer commands execute immediately on-device. AI commands proceed to the API call path with retry logic
- Key Rotation & Retry — Rotates through available keys, skipping rate-limited or invalid ones. Retries on network errors and server failures
- Inline Spinner — While waiting for the AI response, the trigger is replaced with an animated spinner appended to your original text (e.g.,
how r u ◐) to show progress - Text Replacement — Uses Ctrl+A / Ctrl+V via SendInput to replace field content
- Clipboard Safety — All clipboard operations use exclusion flags to prevent pollution of Windows clipboard history
- Singleton Guard — File lock prevents duplicate instances from running simultaneously
🐛 Debug Mode
cd $env:USERPROFILE\.swiftslate
python SwiftSlate.pyw --debug
If using the embedded runtime:
cd $env:USERPROFILE\.swiftslate
.\runtime\python.exe SwiftSlate.pyw --debug
This runs in the foreground with full logging — shows every keystroke match, API call, and error.
🔒 Privacy & Security
| Concern | How SwiftSlate Desktop Handles It | |
|---|---|---|
| 👁️ | Text Monitoring | Raw Input transiently inspects a bounded keystroke suffix to detect configured triggers. Non-trigger text is not logged, persisted, or transmitted. |
| 📡 | Data Transmission | AI-command text is sent only to the configured AI provider (Google Gemini, Groq, or your custom endpoint). No user text or API keys are sent to other servers. A bare TCP connect to public DNS on port 443 checks connectivity after a network error; ?ip separately contacts ifconfig.me to look up your public IP. |
| 🔐 | API Key Storage | API keys are stored locally in config.json so the app can use your configured provider. Setup prompts use secure string input to avoid terminal history leaks. Protect your Windows account and do not share this file. |
| 📊 | Analytics | None. Zero telemetry, zero tracking, zero crash reporting. |
| 📖 | Open Source | The entire codebase is open for inspection under the MIT License. |
| 🔑 | Permissions | Runs as a standard user process — no admin/elevated privileges required. |
| 📋 | Clipboard Safety | SwiftSlate marks clipboard data it writes to avoid history/cloud sync where Windows honors those flags. Reading an active field requires Windows copy/paste automation, so sensitive fields may still be handled by the target app's normal clipboard path. |
| ✅ | Installer Integrity | install.ps1 pins the SHA-256 of SwiftSlate.pyw, commands.json, and the embedded Python runtime; CI fails the build if an app-file pin goes stale. Files are downloaded from GitHub raw first (no caching) with a jsDelivr CDN fallback; a hash mismatch is rejected rather than installed. |
🏗️ Tech Stack
| Language | Python (runs on 3.10+) |
| Input Capture | Windows Raw Input API |
| Key Simulation | SendInput (KEYBDINPUT) |
| Message Loop | GetMessageW (blocking, zero CPU when idle) |
| HTTP | urllib (zero external dependencies) |
| JSON | json (stdlib) |
| Concurrency | threading (API calls run off main thread) |
| Config Watch | Polling mtime every 2 seconds (hot reload) |
Zero third-party dependencies — uses only Python standard library and Windows APIs via ctypes.
The installer's embedded runtime has
sitedisabled, so SwiftSlate must stay pip-free.
🔨 Building from Source
Prerequisites
- Windows 10/11 (64-bit)
- Python 3.10+ (or use the embedded runtime from the installer)
Run
# Clone the repository
git clone https://github.com/Musheer360/SwiftSlate-Desktop.git
cd SwiftSlate-Desktop
# Run in debug mode
python SwiftSlate.pyw --debug
Verify Syntax
python -c "import py_compile; py_compile.compile('SwiftSlate.pyw', doraise=True)"
[!NOTE] The entire app is a single
SwiftSlate.pywfile with zero pip dependencies. No build step required.
⚠️ Known Limitations
- Text replacement uses Ctrl+A → Ctrl+V — this selects all and pastes, which works in most standard text fields. In apps with non-standard input handling (e.g., some terminal emulators, certain game overlays), replacement may not work as expected.
- Single-line buffer — SwiftSlate tracks keystrokes in a buffer that clears on window switch, Enter, Escape, and Tab. Triggers must be typed in a single uninterrupted sequence within the same field.
- Windows only — currently requires Windows 10/11. Linux support is planned.
🤝 Contributing
Contributions are welcome! See CONTRIBUTING.md for full details.
# 1. Fork the repository, then:
git clone https://github.com/YOUR_USERNAME/SwiftSlate-Desktop.git
cd SwiftSlate-Desktop
# 2. Create a feature branch
git checkout -b feature/amazing-feature
# 3. Make your changes and test
python SwiftSlate.pyw --debug
# 4. Verify syntax
python -c "import py_compile; py_compile.compile('SwiftSlate.pyw', doraise=True)"
# 5. Push and open a Pull Request
git push origin feature/amazing-feature
Ideas for Contributions
- 🐧 Linux support (porting keystroke detection and text replacement)
- 🧩 New built-in commands
- 🤖 Additional AI provider integrations
- 🐛 Bug fixes for text replacement edge cases
- 📖 Documentation improvements
❤️ Support the Project
SwiftSlate Desktop is free, open source, and built in my spare time. If it's useful to you, consider supporting its development:
- ⭐ Star this repo — it helps others discover SwiftSlate
- 💖 Sponsor on GitHub — even a small contribution keeps the project going
📄 License
This project is licensed under the MIT License — see the LICENSE file for details.
Part of the SwiftSlate family.
Made with ❤️ by Musheer Alam
If SwiftSlate makes your typing life easier, consider giving it a ⭐
관련 프로젝트 살펴보기
불러오는 중…