Lepton README

The project's README from github.com/hackjutsu/Lepton. As one markdown file: README.md.

All Contributors MIT Licensed lepton

Star History Rank

Lepton is a lean code snippet manager powered by GitHub Gist. Check out the latest release.

Features

Screenshot

Light Theme Dark Theme
Screenshot Screenshot
Organize Markdown Jupyter Notebook
Screenshot Screenshot Screenshot
Search snippets (⇧ + Space) Immersive Mode (⌘/Ctrl + i) Dashboard (⌘/Ctrl + d)
Screenshot Screenshot Screenshot

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 GitHub Gist
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.

Check out the configuration docs to explore different customization options. Missing a locale? See How do I add a new interface locale?

Tech Stack

Based on

  1. Framework: Electron
  2. Bundler: Webpack, Babel, electron-builder
  3. Language: ES6, Sass/SCSS
  4. UI/state: React 19, Redux, React Redux, Redux Thunk
  5. Editor/rendering: CodeMirror, Highlight.js, Markdown/Jupyter rendering
  6. Tests/lint: Vitest, Electron smoke tests, ESLint

Now you can learn about Lepton project's code structure in DeepWiki!

Installation

brew install --cask lepton
snap install lepton

Based on

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.

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:

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:

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 snap package.

$ 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

--> Wiki FAQ

Contributors

CosmoX
CosmoX

💻 🎨 ⚠️ 🚧 📦 🤔
Jiaye Wu
Jiaye Wu

💻 🚧 🤔
Danila
Danila

💻 🎨 🚧
Meilin Zhan
Meilin Zhan

💻 🤔 🚧
lcgforever
lcgforever

💻
Yuer Lee
Yuer Lee

📖 📦
Su,Yen-Yun
Su,Yen-Yun

📖
Chen Tong
Chen Tong

💻 🤔 🚧
Jason Jiang
Jason Jiang

💻
Alan Pope
Alan Pope

📦
Tony Xu
Tony Xu

📦
Tegan Churchill
Tegan Churchill

💻
Angie Wang
Angie Wang

🎨
Batuhan Bayrakci
Batuhan Bayrakci

💻
Samuel Meuli
Samuel Meuli

💻
Alexandre Amado de Castro
Alexandre Amado de Castro

💻
Abner Soares Alves Junior
Abner Soares Alves Junior

💻
Sean
Sean

💻
Ole
Ole

💻
Gabriel Nicolas Avellaneda
Gabriel Nicolas Avellaneda

💻 📖
Dennis Ideler
Dennis Ideler

💻 🤔 📖
Anthony Attard
Anthony Attard

💻
ArLE
ArLE

💻
Pol Maresma
Pol Maresma

💻
PM Extra
PM Extra

💻
Zava
Zava

💻

Lepton (hackjutsu/Lepton)

Searching Database…

10.3K ·GitHub
这是什么?Lepton 是一个基于 GitHub Gist 的免费、轻量的代码片段管理工具——它可以在 macOS、Windows 和 Linux 上管理你的代码片段,所有内容都通过你的 GitHub 账号同步。
它是桌面应用还是网页服务?它是一个基于 Electron 的跨平台桌面应用,界面用 React/Redux 构建;代码片段本身保存在你的 GitHub Gist 里,而不是什么 Lepton 云端。
我怎么把它装到电脑上?从 GitHub Releases 下载 macOS、Windows 或 Linux 的安装包,也可以在 macOS 上用 Homebrew、在 Linux 上用 Snap Store 安装,然后用你的 GitHub 账号登录。
用的时候必须有 GitHub 账号吗?需要。代码片段就是 GitHub Gist,所以这个应用是围绕 GitHub 登录设计的,支持 OAuth 或个人令牌(token);GitHub Enterprise 账号也可以用。
我的代码片段能保持私密吗?可以创建不限量的公开(public)和私密(secret)片段,但要注意 GitHub 的一个特性:secret gist 只是不公开列出——任何拿到链接的人仍然能看到它。
它真的免费吗?有没有付费版本?完全免费,而且是基于 MIT 许可证的开源项目——这个项目甚至不接受捐款。
一个代码片段里到底能放什么?任何语言的代码(片段会按语言分组并支持语法高亮),还可以放 Markdown 笔记和 Jupyter notebook——两者都能在应用里正常渲染。
以后我怎么找到某个代码片段?按 Shift + Space 可以打开片段搜索;还有仪表盘(Cmd/Ctrl + D),以及创建(Cmd/Ctrl + N)、编辑、同步(Cmd/Ctrl + R)和沉浸模式(Cmd/Ctrl + I)的快捷键。
这个应用可以自定义到什么程度?自定义空间挺大,通过 .leptonrc 配置文件可以设置:13 个内置主题(dracula、solarized、catppuccin 等)、编辑器选项、自定义快捷键、缩放、代理、通知以及 8 种界面语言。
它支持 GitHub Enterprise 账号吗?支持——GitHub Enterprise 是官方列出的功能,通过 .leptonrc 配置文件中的 enterprise 部分即可启用。
Creator
hackjutsu
Size
47.1 MB
Stars
10.3K
Age
9y
Commits · 90 Days