Temper Server is a lightweight local userscript server designed to simplify and streamline userscript development. It hosts your scripts locally, making them easily accessible and automatically updateable through userscript extensions. With built-in version tracking, Temper Server ensures your scripts stay in sync and reliably update during development.
- ⚡ Lightweight Local Server – Run a minimal server optimized for userscript development.
- 📂 Local Hosting – Serve your userscripts directly from your machine.
- 🔄 Automatic Updates on Sync – Userscripts update automatically in supported extensions when you trigger a sync (e.g., by clicking “Update” in the extension).
- 📈 Automatic Version Increment – The
@versionfield in your userscript updates whenever the file changes, ensuring extensions detect and fetch the latest version. - 🛠️ Development-Friendly – Simplifies testing and iteration, reducing friction in userscript development.
- 🌐 Extension Compatibility – Works with popular userscript managers (e.g., Tampermonkey, Violentmonkey).
Before running Temper Server, ensure you have:
- Python 3.9+
- pip (Python package manager)
- A userscript manager extension installed in your browser, such as:
Temper Server is built with:
- Flask – lightweight Python web framework to serve userscripts locally
- Watchdog – monitors file changes and triggers automatic updates
- pip – package management for Python dependencies
git clone https://github.com/ThoriqFathurrozi/temper-server.git
cd temper-serverpython -m venv venv
source venv/bin/activate # On Linux / macOS
venv\Scripts\activate # On Windowspip install -r requirements.txtpython3 config.py📌 Note: This is will create a config.ini file that u can store the configuration for temper server
Here’s a sample config.ini for Temper Server:
[Paths]
# Base directory for your project (root location of scripts or assets)
base_directory = /path/to/base
# Directory containing the userscripts you want to serve
target_directory = /path/to/target
[Server]
# Host address for the Flask server (use 0.0.0.0 for LAN access)
host = localhost
# Port number for the server (customize as needed)
port = 7000python app.py
⚠️ Important: Always run the server with this command. Running it differently may prevent the Watchdog from detecting file changes properly. 🚀 Done! Your userscripts are now being served locally. 🌐 Open http://localhost:7000
To enable automatic versioning and updates through your userscript manager, ensure your script includes the correct @updateURL and @downloadURL fields pointing to your local server.
Example:
// ==UserScript==
// @name My Userscript
// @namespace http://example.com/
// @version 0.1
// @description Example userscript served from Temper Server
// @updateURL http://localhost:7000/userscript.meta.js
// @downloadURL http://localhost:7000/userscript.user.js
// @match *://*/*
// @grant none
// ==/UserScript==📌 Note: If the .meta.js file does not exist in your target directory, Temper Server will automatically generate it when you run the server, based on your existing .user.js file. 🔄 This ensures that version tracking and update checks work seamlessly with Tampermonkey, Violentmonkey, and other managers.
- 🌐 Open http://localhost:7000 in your browser to view the list of available userscripts.
- 📥 Click on a script (e.g.,
myscript.user.js) to open it in your userscript manager (Tampermonkey / Violentmonkey).
Once your userscript is installed and configured:
- Make changes to your
.user.jsfile in your target directory. - Temper Server will automatically increment the
@versionin your script. - In your userscript manager (Tampermonkey, Violentmonkey, etc.):
- Open the extension dashboard.
- Click Check for Updates (or Sync) for the script.
- The extension will fetch the new version from the
@updateURLand update automatically.
⚡ Now you can start development with auto version increment + sync-based updates, ensuring your extension always stays up to date. 💡 Tip: This workflow lets you iterate quickly — edit locally, then sync in your extension with one click.
flowchart LR
A["`Edit *.user.js`"] --> B["`Temper Server detects changes
and increments @version`"]
B --> C["`Userscript Manager`"]
C --> D["`Click 'Check for Updates' / 'Sync'`"]
D --> E["`Fetch from @updateURL<br/>and refresh script`"]
style A fill:#f9f,stroke:#333,stroke-width:1px
style B fill:#bbf,stroke:#333,stroke-width:1px
style C fill:#bfb,stroke:#333,stroke-width:1px
style D fill:#ffb,stroke:#333,stroke-width:1px
style E fill:#fdd,stroke:#333,stroke-width:1px
Contributions are welcome! 🎉
If you’d like to improve Temper Server, here’s how you can help:
- Fork the repository
- Create a new branch (
git checkout -b feature/your-feature) - Commit your changes (
git commit -m 'Add new feature') - Push to your branch (
git push origin feature/your-feature) - Open a Pull Request
💡 Please make sure your code follows the existing style and includes relevant documentation or examples.
This project is licensed under the MIT License – see the LICENSE file for details.