Getting started
OneBook is distributed as source. There is no signed build to download yet — packaging runs locally with electron-builder.
Requirements
Section titled “Requirements”- Node.js 20 or newer
- A platform that can compile native modules:
better-sqlite3andnodejiebaare both C++ addons
On Windows that means a Visual Studio Build Tools installation. If npm install finishes but the app
cannot open a database, rebuild the native modules:
npm run rebuildRun it
Section titled “Run it”git clone https://github.com/ambitear/onebookcd onebooknpm installnpm run devnpm run dev starts Electron with hot reload in the renderer. Other scripts worth knowing:
| Command | What it does |
|---|---|
npm run typecheck |
Type-checks the main process and the renderer separately |
npm run build |
Type-check, then bundle main / preload / renderer |
npm run build:unpack |
Build, then produce an unpacked app directory — the quickest way to check packaging |
npm run build:win / :mac / :linux |
Build an installer for that platform |
Artifacts land in release/ and are named onebook-<version>.<ext> (Windows adds -setup).
First project
Section titled “First project”When the app opens it creates a project called default under ~/.onebook/projects/. A project is
just a directory, and it holds its own database, so you can keep research apart from work by making
two of them.
To write something:
- Create a block. It appears at the top level of the tree.
- Type Markdown into it. The 编辑 / Edit action in the block’s toolbar swaps the rendered preview for the CodeMirror editor; 预览 / Preview swaps it back.
- Drag a block onto another block to make it a child. The whole subtree moves with it.
Blocks are ordered by their position key, and the order you see is the order you dragged into.
- The block model if you want to know what a block actually is.
- Data and files if you would rather read the SQLite file yourself.