- 日常查片段:写代码时按全局快捷键呼出搜索,比开浏览器、登录、翻 gist 列表少几步;用纯本地文件或 IDE 内置片段库则拿不到跨机器同步。
- 多账号或多平台片段并存:GitHub 和 GitLab 的片段放在同一个标签/语言分组下检索,换别的工具通常只认一家。
- 需要渲染的笔记型片段:Markdown 和 Jupyter Notebook 直接在客户端里看,不用为一段笔记开 Jupyter 或预览器。
- 团队共享公开片段:靠 gist 本身的公开性做分发,客户端只负责组织和检索,不需要自建服务端。

Lepton
hackjutsuMIT活跃维护 有专家点评跨平台代码片段管理器,用 GitHub Gist 做云端同步,支持标签分类和 Markdown 编辑,解决零散代码片段散落各处、难以检索复用的问题。
💻 Democratizing Snippet Management (macOS/Win/Linux)
专家点评
上手难度:进阶更新于 2026-11-11把 GitHub Gist 和 GitLab 片段收进本地桌面端,替代浏览器标签页里翻 gist 的工作流
适用场景
踩坑
- 从源码构建时门槛集中在认证:必须自建 configs/account.js 填 GitHub OAuth 的 client id/secret,否则登录走不通;只想改点 UI 的人会卡在这一步。
- 代理环境:issue 里有「Cannot use behind a proxy」被提出,说明企业网络下同步链路可能先撞墙,且 .leptonrc 的代理配置需要提前确认。
- 功能缺口是反复被提的:搜索只覆盖标题还是正文(有 search gist content 的请求)、离线可用性(offline mode 请求)、深色主题都在 issue 列表里挂着,别指望 README 之外还有隐藏实现。
- 自动化 smoke 测试不覆盖 OAuth、片段增删改查和同步,升级或自行构建后这些路径只能手动验。
同类对比
如果只需要单机、不依赖 gist 的片段库,直接用编辑器内置 snippets 或纯文本文件更省事;如果核心诉求是跨设备笔记同步而非代码片段,Obsidian 这类基于文件同步的工具分流更合适。
brew install --cask lepton
snap install leptonREADME 未说明;作为 Electron 桌面应用,在 macOS、Windows、Linux 上运行,无需 GPU 或显存。
项目说明
由 README 自动翻译提炼基于 Electron 的轻量代码片段管理器,把 GitHub Gist 和 GitLab 片段统一到本地桌面端管理
跨平台代码片段管理器,用 GitHub Gist 做云端同步,支持标签分类和 Markdown 编辑,解决零散代码片段散落各处、难以检索复用的问题。
核心能力
- 用标签和语言分组组织无限量的公开/私密片段
- 支持 Markdown 与 Jupyter Notebook 渲染
- 通过 GitHub token 或 GitLab 个人访问令牌同步片段
- 内置搜索、仪表盘与沉浸模式,配全局快捷键
- 用 .leptonrc 自定义主题、编辑器、代理和界面语言
容易踩的坑
从源码构建需 Node.js 24 LTS 与 npm 11.x,且需自建 configs/account.js 填入 GitHub OAuth 的 client id/secret,否则无法真实登录;Linux 构建 snap 包需要运行中的 Docker 守护进程;自动化 smoke 测试不覆盖 GitHub OAuth、片段增删改查与同步等真实后端行为,需手动验证。
- v2.0.1-beta.42.0.1-beta.4pre-release2026-11-02 · 2026-11-02 09:10 UTC
查看更新说明
Traceability
- Version: 2.0.1-beta.4
- Source commit: 3db9e8815afa8f134e81933069cb6d50ac3bc7f0
- Source branch: master
- Workflow run: https://github.com/hackjutsu/Lepton/actions/runs/41417932558
- Previous release: v2.0.1-beta.3
- Changes: https://github.com/hackjutsu/Lepton/compare/v2.0.1-beta.3...v2.0.1-beta.4
- v2.0.1-beta.32.0.1-beta.3pre-release2026-10-05 · 2026-10-05 09:16 UTC
查看更新说明
Traceability
- Version: 2.0.1-beta.3
- Source commit: 1744e17f1532bccc50cfe10d410241ae46482542
- Source branch: master
- Workflow run: https://github.com/hackjutsu/Lepton/actions/runs/37288704426
- Previous release: v2.0.1-beta.2
- Changes: https://github.com/hackjutsu/Lepton/compare/v2.0.1-beta.2...v2.0.1-beta.3
- v2.0.1-beta.22.0.1-beta.2pre-release2026-09-07 · 2026-09-07 09:11 UTC
查看更新说明
Changes
- Editable Settings page (#671)
Cmd/Ctrl + ,opens Settings with Preferences and About tabs. Users can edit.leptonrcoptions through validated controls, with restart-required settings clearly identified. - Find within the current page (#667)
Cmd/Ctrl + Fopens an in-page search bar with highlighted matches, result counts, and active-result navigation. - New-snippet draft recovery (#669)
Failed snippet submissions are saved locally with their description, privacy setting, filenames, and contents. Users can load or discard the timestamped draft. - More reliable login persistence (#666)
Cached GitHub tokens now safely fall back to local storage when Electron secure storage is unavailable. - Safer link processing (#660)
Updatedlinkify-itfrom 5.0.1 to 5.0.2 to prevent excessive processing of pathological links. - Optimized images (#668)
Reduced affected application and documentation image sizes by approximately 4.3%.
Traceability
- Version: 2.0.1-beta.2
- Source commit: b9160760a8ee9a1633d749a81311708a0a994f3d
- Source branch: master
- Workflow run: https://github.com/hackjutsu/Lepton/actions/runs/34104364132
- Previous release: v2.0.1-beta.1
- Changes: https://github.com/hackjutsu/Lepton/compare/v2.0.1-beta.1...v2.0.1-beta.2
- Editable Settings page (#671)
- v2.0.1-beta.12.0.1-beta.1pre-release2026-08-03 · 2026-08-03 10:19 UTC
查看更新说明
Changes
- Improved About-page scrollbars (#659)
Applied Lepton’s subdued scrollbar styling to contributor, license, and path sections in the About modal.
Traceability
- Version: 2.0.1-beta.1
- Source commit: bbbe2c5ef4690940f85dcd8f236ca21fdeb32ac0
- Source branch: master
- Workflow run: https://github.com/hackjutsu/Lepton/actions/runs/30804947033
- Previous release: v2.0.0
- Changes: https://github.com/hackjutsu/Lepton/compare/v2.0.0...v2.0.1-beta.1
- Improved About-page scrollbars (#659)
- v2.0.02.0.0最新正式版2026-07-05 · 2026-07-05 22:29 UTC
Substantial foundation upgrades
- Major components upgrades: Electron 42, Webpack 5, React 19, etc.
- Secure token storage https://github.com/hackjutsu/Lepton/issues/319
- More efficient memory management https://github.com/hackjutsu/Lepton/issues/465
- Bug fixes https://github.com/hackjutsu/Lepton/issues/539 https://github.com/hackjutsu/Lepton/issues/537 https://github.com/hackjutsu/Lepton/issues/532
New features
- All snippets/gists download + full content search https://github.com/hackjutsu/Lepton/issues/527 https://github.com/hackjutsu/Lepton/issues/254 https://github.com/hackjutsu/Lepton/issues/82 https://github.com/hackjutsu/Lepton/issues/208 https://github.com/hackjutsu/Lepton/issues/501
To enable full content download in
.leptonrc.- Built-in themes https://github.com/hackjutsu/Lepton/issues/541 https://github.com/hackjutsu/Lepton/issues/550
Supported values in .leptonrc's
theme: light, dark, one-dark, atom-one-dark, github-light, github-dark, catppuccin-latte, catppuccin-mocha, solarized-light, solarized-dark, dracula, material-theme, ayuExample: dracula
-
Internationalization(i18n) support https://github.com/hackjutsu/Lepton/issues/459 https://github.com/hackjutsu/Lepton/issues/331 https://github.com/hackjutsu/Lepton/issues/411
-
Option
tag.coloredto enable colored tags https://github.com/hackjutsu/Lepton/issues/484 -
Option
startAtLoginto start at system startup https://github.com/hackjutsu/Lepton/issues/551 -
Option
window.closeToTrayandwindow.minimizeToTrayto minimize to tray https://github.com/hackjutsu/Lepton/issues/553
Platforms
macOS
Notice: I do not have a paid Apple developer account to sign the app. Pls enable Lepton in the security settings preference to install the app.
- Lepton-2.x.x-xxx-mac-arm64.dmg
- Lepton-2.x.x-xxx-mac-x64.dmg
Windows
- Lepton-2.x.x-xxx-win-ia32.exe
- Lepton-2.x.x-xxx-win-x64.exe
Linux
sudo snap install lepton # to install th e released version sudo snap install lepton --edge # to install the beta version sudo snap refresh lepton --edge # to update to the latest beta version if lepton was installed
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。

Lepton is a lean code snippet manager for GitHub Gist and GitLab personal snippets. Check out the latest release.
Features
- Unlimited public/secret snippets
- Unlimited tags
- Language groups
- Markdown/JupyterNotebook
- GitHub Enterprise
- GitHub token
- GitLab.com and self-managed GitLab personal snippets (personal access token)
- Immersive mode
- Customizable
- Built-in themes
- macOS/Win/Linux
- Dashboard
- Search snippets
- Proxy
- Free

| Light Theme | Dark Theme |
|---|---|
![]() | ![]() |
| Organize | Markdown | Jupyter Notebook |
|---|---|---|
![]() | ![]() | ![]() |
| Search snippets (⇧ + Space) | Immersive Mode (⌘/Ctrl + i) | Dashboard (⌘/Ctrl + d) |
|---|---|---|
![]() | ![]() | ![]() |
Shortcuts
| Function | Shortcut | Note |
|---|---|---|
| New Snippet | Cmd/Ctrl + N | Create a snippet |
| Edit Snippet | Cmd/Ctrl + E | Edit a snippet |
| Delete Snippet | Cmd/Ctrl + Del | Delete selected snippet |
| Submit | Cmd/Ctrl + S | Submit the changes from the editor |
| Sync | Cmd/Ctrl + R | Sync snippets with the selected provider |
| Immersive Mode | Cmd/Ctrl + I | Toggle the Immersive mode |
| Dashboard | Cmd/Ctrl + D | Toggle the dashboard |
| About Page | Cmd/Ctrl + , | Toggle the About page |
| Search | Shift + Space | Toggle snippet search |
See the Search FAQ for searchable fields and content-search behavior.
Customization
Lepton's can be customized by <home_dir>/.leptonrc! You can find its exact path in the About page by Command/Ctrl + ,. Create the file if it does not exist.
- Theme (
light,dark,one-dark,atom-one-dark,github-light,github-dark,catppuccin-latte,catppuccin-mocha,solarized-light,solarized-dark,dracula,material-theme, orayu) - Snippet
- Editor
- Logger
- Proxy
- Shortcuts
- Zoom
- Snippet provider (
githuborgitlab) - Enterprise
- Notifications
- Interface language (
i18n.locale:en,es,fr,ja,ko,tr,zh-Hans, orzh-Hant)
Check out the configuration docs to explore different customization options. Missing a locale? See How do I add a new interface locale?
Tech Stack

- Framework: Electron
- Bundler: Webpack, Babel, electron-builder
- Language: ES6, Sass/SCSS
- UI/state: React 19, Redux, React Redux, Redux Thunk
- Editor/rendering: CodeMirror, Highlight.js, Markdown/Jupyter rendering
- Tests/lint: Vitest, Electron smoke tests, ESLint
Now you can learn about Lepton project's code structure in DeepWiki!
Installation
- macOS/Windows/Linux: Download the released packages
- macOS: Install via Homebrew
brew install --cask lepton
- Linux: Install via Snap Store
snap install lepton

Support
Lepton is a free and open source project. We do not accept project donations, but if you would like to support the maintainer, you can buy me a coffee.
We also recommend donating to Wikimedia Foundation, which helps sustain free knowledge through Wikipedia and its sister projects.
Development
Runtime requirements
Lepton's current development toolchain is known to work with Node.js 24 LTS and
npm 11.x. This is the host runtime used to install dependencies and run the
webpack build; the bundled Electron app runtime is managed by the Electron
version in package.json.
Recommended:
- Node.js 24.18.0
- npm 11.16.x
If you use nvm, the repository includes an .nvmrc:
$ nvm install
$ nvm use
Apple Silicon development should use the native arm64 Node.js runtime.
Install dependencies
$ git clone https://github.com/hackjutsu/Lepton.git
$ cd Lepton
$ npm ci
# inspect stale dependencies
$ npm run check-outdated
Client ID/Secret
Register your application, and put your client id and client secret in ./configs/account.js.
module.exports = {
client_id: <your_client_id>,
client_secret: <your_client_secret>
}
configs/account.js is intentionally ignored by Git. If it is missing, the app
falls back to configs/accountDummy.js, which is useful for rendering tests but
will not support real GitHub login. Release builds create configs/account.js
from GitHub Actions secrets before packaging.
Run
$ npm run build && npm start
For iterative renderer work, run webpack in watch mode in one terminal and restart Electron from another terminal when needed:
$ npm run webpack-watch
$ npm start
Build
# Development bundle
$ npm run build
# Production bundle
$ npm run webpack-prod
Automated Validation
Use these commands before opening a pull request:
# Lint application source
$ npm run lint
# Normal local check: Vitest unit tests plus webpack development build
$ npm test
# Unit tests only
$ npm run test:unit
# Unit tests in watch mode
$ npm run test:unit:watch
The project also has Electron smoke checks. These are useful for Electron, React, layout, preload, or packaging changes, and are run by CI.
# Launches Electron with isolated config/user-data and verifies login plus
# fixture-backed authenticated renderer surfaces
$ npm run test:smoke
# Builds an unpacked app and verifies the packaged app can render the login UI.
# This is primarily for macOS CI or release verification.
$ npm run test:packaged-smoke
Renderer smoke fixtures are opt-in through the smoke runner and use deterministic
mock state to check initial rendering. Fixture names include active, edit,
new, about, dashboard, search, delete, raw, pinned-tags, and
immersive.
# Launch one fixture directly when debugging the automated smoke check
$ npm run build
$ LEPTON_RENDER_FIXTURE=active npm start
Fixtures verify that important React surfaces mount without renderer warnings, errors, failed loads, or crashes. They do not verify GitHub OAuth, snippet CRUD, sync behavior, real API responses, OS shortcut delivery, or full interaction flows.
GitHub Actions currently runs:
lint-test-build: lint, unit tests, and webpack build verificationelectron-smoke: Electron renderer smoke testpackaged-smoke: packaged app smoke testrelease: tag-driven cross-platform packaging and publishing
The smoke jobs are currently configured as non-blocking CI checks while the cross-platform Electron validation continues to mature.
Manual Verification
For UI or Electron changes, also launch the app locally:
$ npm run build && npm start
Confirm the login page visibly renders. After login, manually verify the surfaces affected by your change, such as new snippet, edit snippet, settings/about, dashboard, search, sync, and GitHub Gist backend interactions. Manual verification is still required for visual quality and real GitHub behavior; automated smoke checks do not replace backend workflow testing.
Local Packaging
Build an unpacked app for the current platform.
$ npm run pack
Build apps for macOS.
$ npm run dist -- -m
Build apps for Windows.
$ npm run dist -- -w
Build apps for Linux.
Need a running Docker daemon to build a
snappackage.
$ npm run dist -- -l
Build apps for macOS, Windows and Linux.
$ npm run dist -- -wml
Build apps for the current OS with the current arch.
$ npm run dist
FAQ
Contributors
License
MIT © hackjutsu






