In the plugin-based architecture of DeepSeek Harness (DSH), agent developers often face the disconnect between Overleaf projects and local development environments. Traditional synchronization methods rely on manual copying or external scripts, which are inefficient and error-prone. The dsh-better-overleaf plugin maps Overleaf projects to local Git repositories and integrates them directly into the DSH sidebar workbench, solving this pain point.

What It Is

This is a plugin maintained by Hoemr, built on the workbench of dsh-better-sidebar. It creates a one-to-one mapping between an Overleaf project and a local Git mirror (located at <workspace>/overleaf/<name>/), allowing the sidebar’s file manager, editor, previewer, and Git panel to directly operate on Overleaf content.

The plugin is a hot-pluggable component and depends on dsh-better-sidebar as an optional peer. When dsh-better-sidebar is not installed or loaded, this plugin remains silent and harmless.

Core Features

Local Mirroring and Bidirectional Synchronization

Each Overleaf project corresponds to a real local Git repository.

  • Git synchronization: Supports full pull and push via the Git repository. pull uses the pull --ff-only strategy, while push uses the push HEAD strategy. The Git panel can display actual diffs.
  • API synchronization: Supports pulling Overleaf API snapshots. When only a Cookie is available, API snapshot pulling serves as a fallback to Git pulling.
  • Note: API transport mode cannot push content; to push, you must use Git bridge credentials.

Secure Login Mechanism

Uses direct CDP (Chrome DevTools Protocol) login, without needing to download Playwright or ChromeDriver.

  • Credential handling: Credentials are resolved via ctx.credentials and never enter browser packages or route payloads.
  • Persistent and temporary profiles: By default, a persistent browser profile is used (~/.dsh/plugin-data/dsh-better-overleaf/browser-profile), so no repeated login entry is needed afterward. You can also set loginProfile: temporary to clean the profile after each login.
  • Third-party browser support: Supports third-party Chromium browsers such as CentBrowser, Brave, and Vivaldi. You can specify the browser executable path via browserPath or the browser channel via browserChannel (auto, real, etc.).

Deep Sidebar Integration

Through the capabilities provided by dsh-better-sidebar, the plugin exposes Overleaf content directly in the sidebar:

  • File management: View and edit files in the sidebar explorer.
  • Preview: Use the sidebar’s image/PDF preview feature.
  • Mentions: Supports using @ to reference Overleaf files in conversations.

Installation and Enabling

Before installing, make sure dsh-better-sidebar is installed (version range >=0.13.1 <0.25.0-0).

  1. Run the following command to install the plugin:
dsh plugin --profile desktop add dsh-better-overleaf@0.2.4
  1. Restart the DSH application to load the plugin. If dsh-better-sidebar is not installed, the plugin will not be mounted.

Typical Usage

1. Configure the Sync Transport Mode

Set transport: auto in the DSH configuration. When the environment variable OVERLEAF_GIT_TOKEN exists, Git transport is preferred; when only a Cookie exists, it falls back to API snapshots.

- insert:
    - id: overleaf
      name: dsh-better-overleaf
      config:
        transport: auto          # auto | git | api

2. Configure the Browser Path

Specify the executable file path of a third-party Chromium browser to ensure the login flow can find the target browser.

- insert:
    - id: overleaf
      name: dsh-better-overleaf
      config:
        browserPath: '/path/to/your/chrome.exe'

3. Handle Ignored Build Scripts

If pnpm reports that the build script for node-pty was ignored, add the build allowance option to the configuration file.

allowBuilds: { node-pty: true }

Use Cases and Precautions

Use cases:

  • Developers who manage files with Git and frequently interact with Overleaf.
  • Agent developers who need to preview PDFs directly in the DSH environment, edit LaTeX files, and use the @ mention feature.

Precautions:

  • API push limitation: API transport mode cannot push content. Pushing must rely on Git bridge credentials.
  • pnpm configuration: If terminal features (node-pty) are unavailable, check the allowBuilds setting in pnpm-workspace.yaml.
  • Compatibility: The plugin depends on dsh-better-sidebar; confirm that its version meets the requirement before installing.

Summary

dsh-better-overleaf eliminates the hassle of manual synchronization by converting Overleaf projects into local Git mirrors and integrating them into the DSH sidebar. By leveraging direct CDP login and sidebar capabilities, it provides developers with a seamless collaboration environment.

Documentation and source code:

  • GitHub: https://github.com/Hoemr/dsh-better-overleaf
  • Directory: https://www.skillhub.cn/plugins/Hoemr/dsh-better-overleaf