Skip to content

hackjutsu/Lepton

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

741 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

All Contributors

MIT Licensed lepton

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

Features

  • Unlimited public/secret snippets
  • Unlimited tags
  • Language groups
  • Markdown/JupyterNotebook
  • GitHub Enterprise
  • GitHub token
  • Immersive mode
  • Customizable
  • Built-in themes
  • macOS/Win/Linux
  • Dashboard
  • Search
  • Proxy
  • Free

Screenshot

Light Theme Dark Theme
Screenshot Screenshot
Organize Markdown Jupyter Notebook
Screenshot Screenshot Screenshot
Search (⇧ + 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 with remote Gist server
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 the search bar

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, or ayu)
  • Snippet
  • Gist
  • Editor
  • Logger
  • Proxy
  • Shortcuts
  • Enterprise
  • Notifications
  • Interface language (i18n.locale: en, es, fr, ja, ko, tr, zh-Hans, or zh-Hant)

Check out the configuration docs to explore different customization options.

Example:

{
  "i18n": {
    "locale": "ja"
  }
}

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

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>
}

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, Gist 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 verification
  • electron-smoke: Electron renderer smoke test
  • packaged-smoke: packaged app smoke test

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.

Build Installer App

Read electron-builder docs and check out the code signing wiki before building the installer app.

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

πŸ’»
Jason R Alexander
Jason R Alexander

πŸ’»
Sebastian Hojas
Sebastian Hojas

πŸ“–
董雨θˆͺ
董雨θˆͺ

πŸ’»
sxyazi
sxyazi

πŸ“¦
Brian Zalewski
Brian Zalewski

πŸ“¦

License

MIT Β© hackjutsu