Overseas access: www.kdjingpai.com
Ctrl + D Favorites

Spegel is an open source terminal web browser. It uses artificial intelligence (AI) to convert the HTML content of web pages into a concise markdown format suitable for browsing in terminals. Users can customize the browsing view , such as simplifying the content or extracting key information . Spegel uses a lightweight framework litellm , supports a variety of language models , the default use of the Gemini 2.5 Flash Lite. It's easy to configure and has a user-friendly interface for those who prefer terminal operation. The project is hosted on GitHub, maintained by developer SimEdw, with an active community and continuous updates.Spegel was designed to make web content more readable, reduce redundant information, and provide an efficient browsing experience.

Spegel: using AI to transform web pages into an end-user browsing experience-1

Function List

  • Web Content Conversion: Convert HTML of complex web pages into clean markdown format.
  • Customized Views: Supports user-defined multiple viewing modes via profiles, such as simplifying to child level (ELI5) or extracting key actions.
  • Support for multiple AI models: Compatible with multiple native or external language models through the litellm framework.
  • Terminal interface optimization: use Textual framework to render markdown, providing an intuitive terminal browsing experience.
  • Dynamic Configuration: Supports real-time view and cue word adjustments during browsing.
  • Lightweight operation: only supports GET requests, does not rely on JavaScript, runs efficiently.
  • Open source community support: hosted on GitHub, users are welcome to contribute code and feedback.

Using Help

Installation process

The installation process of Spegel is simple and suitable for users who are familiar with command line operations. The following are the detailed steps:

  1. cloning project
    Run the following command in the terminal to clone the Spegel project locally:

    git clone https://github.com/simedw/spegel.git
    cd spegel
    
  2. Installation of dependencies
    Use Python's pip to install the necessary dependencies and command-line tools:

    pip install -e .
    

    This will install Spegel and its Python dependencies, including litellm and Textual.

  3. Configuring Environment Variables
    Spegel uses the Gemini 2.5 Flash Lite model by default and requires an API key to be set. Creating a .env file, refer to the project's env_example.txt, add the following:

    GEMINI_API_KEY=你的API密钥
    

    You can get the key through Gemini or other supported model providers.

  4. Start Spegel.
    After the installation is complete, start Spegel with the following command:

    spegel bbc.com
    

    This will load the specified web page directly and display the welcome screen. You can use it if you want to skip the welcome screen and browse the web page directly:

    spegel <网页URL>
    

Configuring Custom Views

The core feature of Spegel is the support for user-defined browsing views. The configuration file is located in the ~/.spegel.toml, which can be modified by a text editor. An example of the default configuration file is shown below:

[settings]
default_view = "terminal"
app_title = "Spegel"
[ai]
default_model = "gpt-4.1-nano"
[[views]]
id = "raw"
name = "Raw View"
hotkey = "1"
order = "1"
prompt = ""
[[views]]
id = "terminal"
name = "Terminal"
hotkey = "2"
order = "2"
prompt = "Transform this webpage into the perfect terminal browsing experience!"
  • default_view: Sets the default browser view, e.g. terminalThe
  • default_model: Specify the AI model to be used, defaults to gpt-4.1-nano or other supported models.
  • views: Define different view modes. Each view contains an ID, a name, a shortcut and a prompt word. For exampleterminal The view will optimize the web page for the terminal browsing format.
  • prompt: Users can customize prompts to control how the AI handles web content. For example, a setting of "Simplify web pages to be understood by 5 year olds" would produce simpler output.

After modifying the configuration file, save and re-run Spegel and the new view will take effect immediately.

Main Functions

  1. browse the web
    importation spegel <URL> The page can be loaded. Example:

    spegel https://simedw.com
    

    Spegel processes web content through AI, converts it to markdown format, and renders it in the terminal.

  2. Toggle View
    During browsing, you can use shortcut keys (e.g. 1,2) to switch between different views. For example.terminal view optimized for content layout.recipe The view specializes in extracting ingredients and steps for recipes. Shortcuts are defined in the configuration file.
  3. Dynamic Adjustment Cues
    Users can change the prompts in real time while browsing. For example, if you enter the new prompt "Extract key actions from a web page" and save it, Spegel will re-process the current web page to highlight the action steps.
  4. Handling large web pages
    For content-heavy pages, Spegel processes HTML in chunks to ensure completeness. The developers have fixed the problem of large page truncation in earlier versions, so users can browse complex pages with confidence.

Featured Function Operation

  • Recipe Extraction
    Spegel provides a specialized recipe view, suitable for quick access to recipe information. For example, when browsing a recipe website, Spegel extracts key information in the following format:

    # Ingredients
    * 1 tbsp salt
    * 400 g beef
    # Steps
    1. Preheat the oven to 200°C.
    2. Wash and chop the carrots.
    

    To use this feature, make sure that the configuration file has enabled the recipe View (enabled = true), and then switch to that view with a shortcut key.

  • Terminal Optimization Experience
    Spegel uses the Textual framework to render markdown with a clear interface that supports scrolling and interaction. Users can navigate through the content with up and down arrows, press q Exit.
  • Multi-model support
    With litellm, Spegel supports a wide range of AI models. Users can change the default_model, or specify other models (e.g., GPT-4) via environment variables. This provides the user with the flexibility to choose a more powerful model as required.

caveat

  • Ensure that your internet connection is stable, as Spegel requires GET requests for web content.
  • If the markdown renders with formatting errors, check that the correct view is enabled, or make sure that the page content is fully loaded.
  • For dynamic web pages that require JavaScript, Spegel does not currently support it and recommends choosing static content-rich web pages.

application scenario

  1. Quickly extract the core content of a web page
    Users need to extract key information from lengthy web pages, such as recipes, news summaries, or step-by-step tutorials, and Spegel's customizable views quickly simplify complex content into an easy-to-read markdown format.
  2. Web browsing for end-users
    Programmers or users who prefer command line operations want to browse the web in a terminal without having to open a graphical interface browser.Spegel provides a lightweight and fast solution.
  3. Personalized Content Processing
    Users want to customize the presentation of web pages according to their needs, such as simplifying technical documentation into something beginners can understand or optimizing a shopping site for key product information.
  4. Learning and Debugging AI Cues
    Developers can learn how to process web content with AI by tweaking Spegel's cue words for users studying AI cue engineering.

QA

  1. What AI models does Spegel support?
    Spegel supports a variety of models through the litellm framework, including Gemini 2.5 Flash Lite, GPT-4, and others. The user can specify the model in a configuration file.
  2. How do you handle large web pages?
    Spegel processes HTML content in chunks to ensure that no information is truncated. If you encounter problems, check your internet connection or update to the latest version.
  3. Do I need programming experience to use Spegel?
    Not required. Installation and basic use is a simple command line operation. Customizing the view requires editing the configuration file, but the documentation provides detailed examples.
  4. Does Spegel support dynamic web pages?
    Currently, only static pages (GET requests) are supported. JavaScript content on dynamic pages cannot be processed.
0Bookmarked
0kudos

Recommended

Can't find AI tools? Try here!

Just type in the keyword Accessibility Bing SearchYou can quickly find all the AI tools on this site.

inbox

Contact Us

Top

en_USEnglish