Configuration
Configuration
Lepton reads user configuration from a .leptonrc JSON file in the home directory reported by Electron. In Lepton v1.9.0 and later, the exact path is shown on the About page (Command/Ctrl + ,).
The file is not generated automatically. Create it if you want to override the defaults below.
Template `.leptonrc`
{
"theme": "light",
"autoUpdate": false,
"startAtLogin": false,
"i18n": {
"locale": "en"
},
"window": {
"closeToTray": false,
"minimizeToTray": false
},
"avatar": {
"type": "github",
"boringAvatarVariant": "beam"
},
"userPanel": {
"hideProfilePhoto": false
},
"logger": {
"level": "info"
},
"security": {
"cachedAccessTokenStorage": "auto"
},
"proxy": {
"enable": false,
"address": "socks://localhost:1080"
},
"snippet": {
"sorting": "updated_at",
"sortingReverse": true,
"expanded": true,
"newSnippetPrivate": false,
"downloadAll": false
},
"tag": {
"showInSnippetList": false,
"colored": false
},
"editor": {
"tabSize": 4,
"validateFilename": true
},
"enterprise": {
"enable": false,
"host": "",
"token": "",
"avatarUrl": ""
},
"notifications": {
"success": true,
"failure": true
},
"zoom": {
"percent": 100
},
"shortcuts": {
"keyShortcutForSearch": "Shift+Space",
"keyNewGist": "CommandOrControl+N",
"keyEditGist": "CommandOrControl+E",
"keyDeleteGist": "CommandOrControl+Delete",
"keySubmitGist": "CommandOrControl+S",
"keyImmersiveMode": "CommandOrControl+I",
"keyAboutPage": "CommandOrControl+,",
"keyDashboard": "CommandOrControl+D",
"keySyncGists": "CommandOrControl+R"
}
}Options
| Field | Sub-field | Default | Description |
|---|---|---|---|
theme |
light |
UI theme. Supported values: light, dark, one-dark, atom-one-dark, github-light, github-dark, catppuccin-latte, catppuccin-mocha, solarized-light, solarized-dark, dracula, material-theme, ayu. |
|
autoUpdate |
false |
Enable automatic update downloads for packaged releases. | |
startAtLogin |
false |
Start Lepton when the user logs in. Not supported on every Linux environment. | |
i18n |
locale |
en |
Interface language. Supported values: en, es, fr, ja, ko, tr, zh-Hans, zh-Hant. |
window |
closeToTray |
false |
Hide Lepton to the tray/menu bar when the window is closed. On macOS, the normal close behavior hides the window without creating a tray item unless this is enabled. |
minimizeToTray |
false |
Hide Lepton to the tray/menu bar when the window is minimized. Currently applies on macOS. | |
avatar |
type |
github |
Profile image source. Use github for the GitHub avatar or boring for a generated avatar. |
boringAvatarVariant |
beam |
Variant used when avatar.type is boring. |
|
userPanel |
hideProfilePhoto |
false |
Hide the profile photo in the user panel. |
logger |
level |
info |
Logging level. Use info for normal use or debug when collecting diagnostic logs. |
security |
cachedAccessTokenStorage |
auto |
Cached GitHub OAuth token storage. Supported values: auto, encrypted, file. auto uses file storage in development builds and Electron safeStorage in packaged builds. |
proxy |
enable |
false |
Route GitHub API requests and Electron sessions through a proxy. |
address |
socks://localhost:1080 |
Proxy address. Supports normal proxy URLs, Chromium proxy rule lists, and pac+https://... PAC URLs. |
|
snippet |
sorting |
updated_at |
Snippet order. Supported values: updated_at, created_at, description. |
sortingReverse |
true |
Reverse the configured snippet order. | |
expanded |
true |
Expand snippets in the detail view by default. | |
newSnippetPrivate |
false |
Create new snippets as secret snippets by default. | |
downloadAll |
false |
Load all authenticated snippets and download their details during sync. Enable this for complete global content search across snippet file contents. | |
tag |
showInSnippetList |
false |
Show custom tags in snippet list rows. |
colored |
false |
Render custom tags with stable color badges. | |
editor |
tabSize |
4 |
Tab size in spaces. |
validateFilename |
true |
Validate snippet filenames before saving. | |
enterprise |
enable |
false |
Enable GitHub Enterprise mode. |
host |
"" |
GitHub Enterprise host, for example github.example.com. |
|
token |
"" |
Personal access token with the gist scope. This remains plain .leptonrc configuration and is not affected by security.cachedAccessTokenStorage. |
|
avatarUrl |
"" |
Optional avatar image URL for GitHub Enterprise users. | |
notifications |
success |
true |
Show notifications for successful actions. |
failure |
true |
Show notifications for failed actions. | |
zoom |
percent |
100 |
Default page zoom percentage. 100 is original size; use values like 80, 120, or 150. |
shortcuts |
keyShortcutForSearch |
Shift+Space |
Open snippet metadata and downloaded-content search. |
keyNewGist |
CommandOrControl+N |
Create a snippet. | |
keyEditGist |
CommandOrControl+E |
Edit the selected snippet. | |
keyDeleteGist |
CommandOrControl+Delete |
Delete the selected snippet. | |
keySubmitGist |
CommandOrControl+S |
Submit editor changes. | |
keyImmersiveMode |
CommandOrControl+I |
Toggle immersive mode. | |
keyAboutPage |
CommandOrControl+, |
Open the About page. | |
keyDashboard |
CommandOrControl+D |
Open the dashboard. | |
keySyncGists |
CommandOrControl+R |
Sync snippets with GitHub Gist. |
Debug Logging
Set logger.level to debug when collecting logs for an issue report:
{
"logger": {
"level": "debug"
}
}Home Directory Notes
macOS
On macOS, the home directory is your user folder under /Users. Place .leptonrc here:
/Users/<CurrentUserName>/.leptonrcIn Finder, use Go > Home to open the home directory. Because .leptonrc starts with a dot, it is hidden by default; press Command + Shift + . to show hidden files.
Windows
The home directory can vary by Windows distribution, but it usually starts here:
C:\Users\<CurrentUserName>\.leptonrcUse the About page (Command/Ctrl + ,) to find the exact path.
Linux Snap Package
For the snap package, Electron may report ~/snap/lepton/current as the home directory instead of ~. Use the About page (Command/Ctrl + ,) to find the exact path.
Questions Or Issues
Open issues and feature requests at https://github.com/hackjutsu/Lepton/issues.
Faq
FAQ
Why Is The Language Of My Snippet "Other"?
Lepton depends on GitHub's API to detect snippet language. If GitHub cannot classify the language, Lepton marks it as Other.
You can add a Vim modeline at the top of the snippet to give GitHub a language hint:
// vim: syntax=javascript
let test = 'This is a javascript file'Search
The default search shortcut is Shift + Space.
Lepton can search these fields:
- filename
- language
- description
- tag
- snippet id
- downloaded snippet file content
Complete global content search across every snippet requires thesnippet.downloadAll option to be enabled before syncing. When downloadAll is
disabled, content search only covers snippets whose details and file content have
already been downloaded locally, such as snippets opened during the session.
See Configuration for the snippet.downloadAll option.
Title And Tags
Use this pattern in the snippet description to set a title and custom tags:
[title] description #tag1 #tag2Legacy tag syntax is also supported:
[title] description #tags: tag1, tag2What Is `.leptonrc`, And Where Should I Put It?
.leptonrc is Lepton's user configuration file. It is parsed when the app starts and is not created automatically.
Create .leptonrc in the home directory reported by Electron. In Lepton v1.9.0 and later, the exact path is shown on the About page (Command/Ctrl + ,).
See Configuration for the current template and option list.
How Do I Add A New Interface Locale?
Adding a locale touches both the renderer catalog and the packaged Electron
locale resources:
- Add
app/utilities/i18n/locales/<locale>.js, usingen.jsas the complete
key reference. - Import the catalog in
app/utilities/i18n/index.js, add it tocatalogs,
and add the display name tosupportedLocales. - Update
tests/utilities/i18n.test.jsso the new catalog is checked for key
shape, translated values, and package-locale coverage. - Update the supported
i18n.localelists inREADME.mdandwiki/configuration.md. - Update
configs/electronLanguages.jsif the new Lepton locale needs a
different Electron/Chromium resource name in packaged apps.electron-builder.jsderives the packaged locale list fromgetSupportedLocales(), so do not add a separate hard-coded list topackage.json. - Validate with
npm run test:unitandnpm run test:packaged-smoke. For
packaged builds, confirm every Lepton-supported locale is present and
intentionally unsupported Electron locales are absent.
Proxy
Put proxy settings in .leptonrc:
{
"proxy": {
"enable": true,
"address": "socks://localhost:1080"
}
}See Configuration for all proxy-related options.
Enable GitHub Enterprise
Create a GitHub personal access token with the gist scope enabled. Then add your GitHub Enterprise host and token to .leptonrc:
{
"enterprise": {
"enable": true,
"host": "github.example.com",
"token": "token_with_gist_scope",
"avatarUrl": ""
}
}See Configuration for the full enterprise option list.
Scope For GitHub Access Token
Lepton can use token login instead of GitHub OAuth credentials. Create a
GitHub personal access token with the gist scope, then paste that token into
Lepton's token login screen.
The fastest path is GitHub's prefilled token page:
Create a Lepton token with the gist scope.
If you create the token manually:
- Open GitHub, then go to Settings -> Developer settings -> Personal access
tokens -> Tokens (classic). - Select Generate new token -> Generate new token (classic).
- Enter a descriptive note, such as
Lepton, and choose an expiration. - Under Select scopes, enable only
gist. - Click Generate token and copy the token immediately. GitHub only shows it
once.
For GitHub Enterprise, create the token on your Enterprise host with the samegist scope.
About Data Collection
Lepton is a desktop snippet client backed by GitHub Gist and does not run its own sync service. Data is stored locally by the app or remotely in GitHub Gist.
Donation
Lepton does not accept personal donations. If you want to donate, consider donating to the Wikimedia Foundation, which helps sustain free knowledge through Wikipedia and related projects.
You are welcome to create an issue to share how much you contributed.
Publish Flow
Publish Flow
Lepton publishes desktop builds through the Release GitHub Actions workflow.
Merging release-flow changes does not publish anything by itself. Publishing
starts only when a version tag is pushed or when the workflow is run manually.
Release Types
| Flow | Tag example | GitHub release | Snap channel | Stable users notified |
|---|---|---|---|---|
| Stable release | v1.10.2 |
Published release | stable |
Yes, when autoUpdate is enabled |
| Prerelease | v1.11.0-beta.1 |
Prerelease | edge |
No |
| Manual dry run | No tag | No release by default | No store publish by default | No |
Stable tags must be plain semver tags:
git tag v1.10.2
git push origin v1.10.2Prerelease tags must include a semver prerelease suffix:
git tag v1.11.0-alpha.1
git push origin v1.11.0-alpha.1
git tag v1.11.0-beta.1
git push origin v1.11.0-beta.1
git tag v1.11.0-rc.1
git push origin v1.11.0-rc.1The workflow rejects tags that do not look like v1.2.3 orv1.2.3-beta.1.
Required Secrets
Configure these in GitHub Actions secrets before publishing:
| Secret | Used by | Required for |
|---|---|---|
LEPTON_GITHUB_CLIENT_ID |
All packaging jobs | All release builds |
LEPTON_GITHUB_CLIENT_SECRET |
All packaging jobs | All release builds |
SNAPCRAFT_STORE_CREDENTIALS |
Linux | Snap Store publish |
The workflow uses GitHub's built-in GITHUB_TOKEN for GitHub Release uploads.
configs/account.js is not committed. Each release job generates it fromLEPTON_GITHUB_CLIENT_ID and LEPTON_GITHUB_CLIENT_SECRET before packaging so
release artifacts use the configured GitHub OAuth app.
Use GitHub Environments if prerelease and production should have different
secret values or approval rules.
Stable Release Flow
Use this flow for versions intended for all users.
merge release-ready code to master
|
v
create plain semver tag, for example v1.10.2
|
v
push tag to origin
|
v
Release workflow
|
+--> resolve context:
| publish_policy=always
| github_release_type=release
| environment=production
| snap_channels=stable
|
+--> validate:
| npm run lint
| npm run test:unit
| npm run test:build
|
+--> build macOS:
| dmg + zip for x64
| dmg + zip for arm64
| ad-hoc signed, not notarized
|
+--> build Windows:
| NSIS installer for x64 and ia32
| 7z archive for x64 and ia32
| unsigned by policy
|
+--> build Linux:
| AppImage for x64
| snap for x64
|
v
publish GitHub Release and release assets
|
v
publish Snap to stable channel
|
v
stable auto-update metadata is availableThe macOS job builds Intel and Apple Silicon artifacts in one electron-builder
run so latest-mac.yml is generated once for the full macOS artifact set.
macOS Gatekeeper And Windows SmartScreen
Lepton does not require paid Apple Developer Program or Windows code-signing
certificates for publishing. macOS artifacts are ad-hoc signed so the app
bundle is structurally valid for local code-signing checks, but they are not
Developer ID signed or notarized. The workflow does not read Apple certificate
secrets.
Expected user-facing behavior:
- macOS users should expect Gatekeeper to say Apple cannot verify Lepton is
free of malware. They may need to open Lepton from Finder's context menu or
approve it in Privacy & Security settings. - If macOS still reports that Lepton is damaged after the app is dragged into
/Applications, advanced users can clear the downloaded-app quarantine flag:xattr -dr com.apple.quarantine /Applications/Lepton.app. - Windows users should expect Microsoft Defender SmartScreen warnings until the
unsigned app has enough reputation. - macOS and Windows auto-update metadata is still published for stable tags,
but ad-hoc-signed macOS updates and unsigned Windows updates should be
manually verified before they are advertised as fully supported update paths.
If Developer ID signing or notarization is added later, update.github/workflows/release.yml, electron-builder.js, this wiki page, and the
README together.
Stable app builds are eligible to check for updates when the user's.leptonrc has:
{
"autoUpdate": true
}Only newer stable versions should notify users. Prerelease candidates are
ignored by the updater policy.
Prerelease Flow
Use this flow for testing builds that should be public but should not notify
stable users.
merge prerelease-ready code to master
|
v
create semver prerelease tag, for example v1.11.0-beta.1
|
v
push tag to origin
|
v
Release workflow
|
+--> resolve context:
| publish_policy=always
| github_release_type=prerelease
| environment=prerelease
| snap_channels=edge
|
+--> validate:
| npm run lint
| npm run test:unit
| npm run test:build
|
+--> build macOS, Windows, and Linux artifacts
|
v
publish GitHub prerelease and prerelease assets
|
v
publish Snap to edge channel
|
v
no stable-user auto-update notificationPrerelease app versions do not check for updates. Stable app versions also do
not notify for prerelease update candidates.
Manual Release Workflow Runs
The workflow can be started manually from the GitHub Actions UI.
Manual inputs:
| Input | Default | Purpose |
|---|---|---|
publish |
never |
Use never for a packaging dry run. Use always to publish. |
release_type |
draft |
GitHub release type for manual publishing: draft, prerelease, or release. |
snap_channels |
edge |
Comma-separated Snap channels for manual publishing. |
Manual runs default to publish=never, so they build artifacts and upload
workflow artifacts without creating a GitHub Release or publishing to the Snap
Store.
Expected Artifacts
Artifact names include product name, version, operating system, architecture,
and extension:
Lepton-1.10.2-mac-x64.dmg
Lepton-1.10.2-mac-arm64.zip
Lepton-1.10.2-win-x64.exe
Lepton-1.10.2-win-ia32.7z
Lepton-1.10.2-linux-x64.AppImage
Lepton-1.10.2-linux-x64.snapUpdater metadata files such as latest.yml and latest-mac.yml are also
generated and published with GitHub release assets.
Failure Handling
If validation fails, fix the branch and create a new tag after the fix is
merged. Do not reuse a published version tag unless the failed workflow did not
publish any artifacts.
If publishing partially succeeds:
- Remove or repair the incomplete GitHub Release assets.
- Remove incorrect Snap channel revisions or close the affected channel in the
Snap Store. - Create a new patch or prerelease tag.
- Run the release flow again from the new tag.
Avoid force-moving public release tags after users may have downloaded assets.
Local Packaging Fallback
Local packaging is still available for diagnosing build issues:
npm ci
npm run dist -- -m
npm run dist -- -w
npm run dist -- -lLocal release-like packaging still needs configs/account.js to exist. The
GitHub Actions workflow generates this file from secrets; local builds must
create it manually.
README
Lepton Wiki
These pages are the canonical, versioned replacement for the old GitHub wiki.
README
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 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 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.
- 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
- 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 leptonSupport
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 useApple 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-outdatedClient 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 startFor iterative renderer work, run webpack in watch mode in one terminal and
restart Electron from another terminal when needed:
$ npm run webpack-watch
$ npm startBuild
# Development bundle
$ npm run build
# Production bundle
$ npm run webpack-prodAutomated 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:watchThe 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-smokeRenderer 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, andimmersive.
# Launch one fixture directly when debugging the automated smoke check
$ npm run build
$ LEPTON_RENDER_FIXTURE=active npm startFixtures 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 startConfirm 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 packBuild apps for macOS.
$ npm run dist -- -mBuild apps for Windows.
$ npm run dist -- -wBuild apps for Linux.
Need a running Docker daemon to build a
snappackage.
$ npm run dist -- -lBuild apps for macOS, Windows and Linux.
$ npm run dist -- -wmlBuild apps for the current OS with the current arch.
$ npm run distFAQ
Contributors
License
MIT ยฉ hackjutsu