TidGi is an privatcy-in-mind, automated, auto-git-backup, freely-deployed Tiddlywiki knowledge management Desktop note app, with local REST API. 「 太记 」是一个基于「 太微 TiddlyWiki 」的知识管理桌面应用,能保护隐私内容、高级自动化、自动Git云备份、部署为博客,且可通过RESTAPI与Anki等应用连接。(迭代开发中欢迎试用,开发进度见下方链接)(Under active development, see website below for details)
Find a file
lin onetwo 6384fd8bd1
Fix/misc bug (#677)
* fix: not removed

* Optimize tidgi.config.json writes for workspace updates

Update logic to write tidgi.config.json only for the modified workspace instead of all wiki workspaces on each update. This reduces redundant file operations and improves performance during workspace updates.

* Refactor workspace saving and UI update logic

Introduced a private saveWorkspacesToSettings method to centralize logic for saving workspaces and removing syncable fields from wiki workspaces. The set and setWorkspaces methods now support skipping UI updates for batch operations, improving performance. Fixed minor issues in legacy migration and error messages.

* Add 'Ask AI' context menu and wiki embed split view

Introduces an 'Ask AI' option to the wiki context menu, enabling users to send selected text to an agent chat in a split view with the wiki embedded. Implements new tab type WIKI_EMBED, updates tab and channel types, adds localization, manages BrowserView bounds for embedding, and ensures persistence and IPC wiring for the new workflow.

* Update wiki

* electron chrome mcp mode sometimes wont show browser view

Clarified troubleshooting steps in docs/MCP.md regarding browser view issues and updated the instructions. Reordered the 'start:dev:mcp' script in package.json for better organization.

* Add agent selection to 'Talk with AI' context menu

Replaces the 'Ask AI' context menu with 'Talk with AI' and adds a submenu for selecting different agent definitions. Updates translations for all supported languages, modifies the askAIWithSelection channel to support agentDefId, and refactors tab creation logic to support split view with agent selection. Improves robustness in view management by handling case-insensitive workspace IDs and custom bounds logic.

* Add e2e test and refactor 'Talk with AI' split view logic

Introduces a new Cucumber feature for 'Talk with AI' from wiki selection, adds a step definition to trigger the workflow via IPC, and refactors split view tab creation to reuse existing tabs when possible. Updates the agent browser service to support finding or creating the appropriate split view tab, and adjusts menu and view services for improved robustness and code clarity. Also adds test IDs to relevant components for more reliable UI testing.

* Update defaultWiki.feature

* Add config error handling and i18n for agent errors

Introduces a new feature test for configuration error handling, adds step definition to remove AI settings for testing, and updates error message rendering to support new error types. Internationalized error messages and button labels for configuration issues are added in both English and Chinese locales. The error message renderer now uses a data-testid for easier testing and recognizes additional error types as fixable in settings.

* Refactor feature files to use two-column selector tables

Updated all feature files to use a standardized two-column format for selector tables, with explicit 'element description' and 'selector' columns. Step definitions in ui.ts were refactored to support this format, improving readability and maintainability of test steps and error handling.

* Delete tiddlywiki

* test: allow parallel

* test: implement scenario isolation for E2E tests

- Isolate each test scenario in test-artifacts/{scenarioSlug}/ directory
- Use dynamic ports for mock OpenAI server to avoid port conflicts
- Log VIEW_LOADED event via did-finish-load in main process (more reliable)
- Search all .log files when waiting for log markers
- Increase timeout for log marker steps to 15 seconds
- Fix ts-node cache issues by clearing cache before tests
- Move application launch to individual scenarios (required for mock server setup)

All 45 E2E test scenarios now pass consistently.

* refactor: optimize agent.feature by moving common steps to Background

- Add MockOpenAIServer.addRules() method to append responses dynamically
- Add 'I have started the mock OpenAI server without rules' step for Background
- Add 'I add mock OpenAI responses:' step to inject responses per scenario
- Move application launch and navigation to Background (shared by all scenarios)
- Keep scenario-specific mock responses in individual scenarios

This improves test maintainability by reducing duplication while keeping
scenario-specific configuration flexible.

* lint

* Refactor scenario path helpers into shared module

Moved scenario-specific path helper functions from individual step definition files to a centralized 'features/supports/paths.ts' module. Updated imports in step definitions to use the shared helpers, improving code reuse and maintainability. Also enhanced test for ContextService to skip optional runtime keys.

* Refactor slug generation to use shared slugify helper

Introduced a new src/helpers/slugify.ts utility for consistent slug generation across the codebase. Updated appPaths.ts to use the shared slugify function, improving maintainability and ensuring identical behavior for test scenario slugs. Added documentation and clarified slugification rules in relevant files. Minor comments and clarifications were added to E2E and mock server code.

* Enforce strict timeout rules in E2E test steps

Added and clarified critical warnings for AI agents regarding timeout modifications in application, cleanup, and wiki step definitions. All timeouts are now strictly limited to 5s local and 10s CI, with explicit comments and environment-based values. Updated documentation and code comments to reinforce that timeouts indicate real bugs and should not be increased.

* Update features/stepDefinitions/application.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Refactor E2E helpers, improve test reliability and cleanup

Centralizes data table parsing for UI step definitions, refactors mock OpenAI server setup, and improves workspace settings path handling for tests. Adjusts timeouts for window and app closing to better reflect real-world performance. Fixes type usage in workspace ID lookups and adds error handling for resize observer and cleanup in WikiEmbedTabContent. Enhances agent browser tab logic and view service cleanup to prevent memory leaks and catch workspace ID casing issues.

* Update agent.ts

* fix: resolve all E2E test timeout issues

* fix: improve CI test reliability with better timing and cleanup

- Use exponential-backoff library for agent creation retry logic
- Extend agent cancel delay to 1000ms for CI environments
- Fix git log refresh marker timing with queueMicrotask
- Improve cleanup timeout handling with force close strategy

All E2E tests passing locally including previously failing CI tests.

* Improve Git log E2E signal and add debug logging

Renames the test artifact in the CI workflow for clarity. Moves the E2E test timing log in useGitLogData to after entries are rendered, using a more reliable signal. Adds a debug log to notifyGitStateChange for better traceability.

* test-artifacts-ci

* Optimize test artifact handling and Git log logging

Update CI workflow to clean up large cache folders in test artifacts and only upload logs, settings, and screenshots to reduce artifact size. Refactor useGitLogData to log immediately after state updates for improved E2E test reliability, removing unnecessary setTimeout.

* Update useGitLogData.ts

* Improve Git log E2E test logging and .gitignore

Added 'test-artifacts-ci.zip' to .gitignore. Moved the '[test-id-git-log-refreshed]' log to immediately after data load for more reliable E2E test detection, and removed redundant logging from the render effect in useGitLogData.ts.

* Update useGitLogData.ts

* Update useGitLogData.ts

* Fix git log refresh marker not appearing in CI

- Move git-log-refreshed marker before RAF to ensure it's recorded
- RAF callbacks may not execute reliably in headless CI environments
- Add debug logging to track loadGitLog execution
- Add try-catch around log call to catch any errors
- Keep git-log-data-rendered in useEffect for UI tracking

* Update useGitLogData.ts

* Update useGitLogData.ts

* Add comprehensive logging to diagnose git-log-refreshed issue

- Log before RAF and inside RAF to pinpoint exact failure location
- Add try-catch to capture any errors
- Two log markers: before-raf and in-raf
- This will definitively show where the logging fails in CI

* Fix race condition: prevent concurrent loadGitLog calls

Root cause: commit triggers 2 refreshes (gitStateChange$ + handleCommitSuccess)
- First loadGitLog (refreshTrigger=1) succeeds
- Second loadGitLog (refreshTrigger=2) starts but never completes
- Add loadGitLogInProgress guard to prevent concurrent execution
- Log when loadGitLog is skipped due to in-progress call

This ensures git-log-refreshed is always logged after commit.

* Remove redundant triggerRefresh calls causing race condition

- handleCommitSuccess/Revert/Undo no longer call triggerRefresh
- gitStateChange\$ observable already triggers refresh for these operations
- Redundant calls caused 2 concurrent loadGitLog, causing CI test failures
- Local tests passed because both completed; CI failed because 2nd never completed

This ensures only 1 loadGitLog runs per git operation.

* Remove unused triggerRefresh parameter from useCommitSelection

- triggerRefresh no longer used in handlers
- Remove from interface and call site
- Clean up lint errors

* Remove triggerRefresh completely - no longer needed

- Observable subscription handles all git state changes
- Remove function definition and exports
- Fix all lint errors

Root cause resolved: commit triggered double refresh causing race condition.
Now only single refresh via observable.

* Remove fixed time waits from gitLog.feature and fix race condition

- Remove all fixed time wait steps from gitLog.feature (14 instances)
- Remove redundant triggerRefresh calls in handleCommitSuccess/Revert/Undo
- Add loadGitLogInProgress guard to prevent concurrent loadGitLog
- Root cause: commit triggered 2 refreshes causing race condition
- Only gitStateChange\$ observable now triggers refresh
- All 4 gitLog tests pass locally

* Fix clear timing: clear log BEFORE commit, not after

Root cause: test cleared git-log-refreshed AFTER commit completed
- But commit already triggered refresh and logged git-log-refreshed
- Clear deleted it, then test waited for new log that would never come
- Solution: clear BEFORE clicking commit button
- This way commit's git-log-refreshed is the first one after clear

Test now passes locally.

* Update cleanup.ts

* Initial commit when init a new git.

* Refactor feature steps for multi-element and log marker tables

Updated multiple feature files and step definitions to support table-driven steps for clicking and asserting multiple elements, and for waiting for multiple log markers in sequence. This reduces redundant waits, improves test reliability, and streamlines Gherkin syntax for multi-element actions and assertions. Also removed unnecessary manual wait steps where content or element checks now handle waiting automatically.

* Minor code cleanup and formatting improvements

Reordered imports in browserView.ts, fixed whitespace in cleanup.ts and useGitLogData.ts, and improved line formatting in GitLog/index.tsx for better readability and consistency.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: tidgi <tiddlygit@gmail.com>
2026-01-20 11:11:28 +08:00
.github Fix/misc bug (#677) 2026-01-20 11:11:28 +08:00
.vscode Fix/sync sub wiki (#672) 2025-12-17 22:08:26 +08:00
build-resources Feat/mini window (#642) 2025-10-21 20:07:04 +08:00
docs Fix/misc bug (#677) 2026-01-20 11:11:28 +08:00
features Fix/misc bug (#677) 2026-01-20 11:11:28 +08:00
localization Fix/misc bug (#677) 2026-01-20 11:11:28 +08:00
patches Feat/Native AI Agent (#640) 2025-10-10 17:16:56 +08:00
scripts Fix/misc bug (#677) 2026-01-20 11:11:28 +08:00
src Fix/misc bug (#677) 2026-01-20 11:11:28 +08:00
template Fix/misc bug (#677) 2026-01-20 11:11:28 +08:00
.editorconfig refactor: initial transform to ts 2020-12-19 22:33:59 +08:00
.env feat: add SKIP_PREFLIGHT_CHECK=true to skip silly react check 2020-08-22 19:36:24 +08:00
.gitattributes Create .gitattributes 2021-07-08 23:23:59 +08:00
.gitignore Fix/misc bug (#677) 2026-01-20 11:11:28 +08:00
.gitmodules refactor: make template wiki a git submodule 2021-09-09 00:16:43 +08:00
.npmrc Feat/Native AI Agent (#640) 2025-10-10 17:16:56 +08:00
.nvmrc chore: upgrade deps 2024-11-24 16:59:21 +08:00
.pnpmfile.cjs Feat/Native AI Agent (#640) 2025-10-10 17:16:56 +08:00
dprint.json fix: dprint conflict 2023-05-19 11:06:29 +08:00
eslint.config.mjs Feat/subwiki external attachment (#671) 2025-12-16 17:01:09 +08:00
forge.config.ts Fix/start error (#654) 2025-11-20 17:17:11 +08:00
forge.env.d.ts Feat/Native AI Agent (#640) 2025-10-10 17:16:56 +08:00
index.html Feat/Native AI Agent (#640) 2025-10-10 17:16:56 +08:00
LICENSE Initial 2019-08-30 11:41:23 +07:00
package.json Fix/misc bug (#677) 2026-01-20 11:11:28 +08:00
pnpm-lock.yaml Fix/edit agent and several bugs (#670) 2025-12-15 17:33:59 +08:00
PrivacyPolicy.md refactor: rename tiddlygit to tidgi in code 2021-12-18 13:16:26 +08:00
README.md Feat/Native AI Agent (#640) 2025-10-10 17:16:56 +08:00
reviewpad.yml feat: add reviewpad.yml file 2023-07-04 20:29:50 +08:00
tsconfig.json Feat/allow watch fs change on git sync 2025-10-31 02:00:40 +08:00
tsconfig.test.json Feat/Native AI Agent (#640) 2025-10-10 17:16:56 +08:00
vite.main.config.ts Feat/Native AI Agent (#640) 2025-10-10 17:16:56 +08:00
vite.preload.config.ts Feat/Native AI Agent (#640) 2025-10-10 17:16:56 +08:00
vite.renderer.config.ts Fix/edit agent and several bugs (#670) 2025-12-15 17:33:59 +08:00
vite.worker.config.ts Feat/Native AI Agent (#640) 2025-10-10 17:16:56 +08:00
vitest.config.ts Chore/upgrade (#646) 2025-10-23 23:42:06 +08:00

TidGi

Customizable personal knowledge-base with git as backup manager and blogging platform.

License: MPL 2.0 GitHub Actions Build Status Lin Onetwo! Power by tiddlywiki!


Pronounce: Same as Tai Chi /ˌtaɪ ˈtʃiː/

🇬🇧 English | 🇨🇳 简体中文

ShowCases And Demo

Demo

Screenshot

Screenshot of main-window

Load NodeJS Wiki
Screenshot of main-window
Create Local Wiki Clone Online Wiki
Screenshot of add-workspace Screenshot of clone-workspace
Translation, Preferences
Screenshot of preference
Interactive code
Screen recording of zx-script in tiddlywiki
Community Plugin Library
Screenshot of add-workspace
For mac users, since I haven't buy Apple developer key yet, so you have to entrust App to open it, click here to expand details.◀

First of all, you need to drag this App into Applications folder! Otherwise there will be an error.

Click "Cancel" ↓

step00001

step00002

step00003

Click "Open" ↓

step00004

Click "OK" ↓

step00005

No English posts yet...Please help sharing!

About TidGi-Desktop

TidGi is a cross-platform Note Taking & GTD & Fragment Knowledge Management desktop app powered by nodejs-TiddlyWiki, it ship with a lot of tiddlywiki plugins from the TiddlyWiki community.

You can call it TG-Note, it is totally free and you own all your data. Code by the people, build for the people.

It used to named TiddlyGit, means TiddlyWiki with easy Git backup, short for TidGi now.

Download

Packaging status

For Windows MacOS normal user

Download
GitHub Releases

For arch user

yay tidgi

For MacOS CLI user

brew install TidGi # Not tested

Mobile App

  • TidGi-Mobile is the official pair with TidGi-Desktop, developed by @linonetwo, fast for 100MB+ wiki.
  • See Tiddloid for Android App developed by @donmor. Good for smaller wiki, and you can have access to your HTML wiki.

You can switch between them, and sync data between them and TidGi at any time. All of them are local-first, open-sourced and compatible with TiddlyWiki ecosystem.

Data Privacy Protection

You can choose storage provider for your wiki workspace:

  1. "Github" as unlimited storage and gh-pages blogging platform.
  2. "Local" will create a local git repo for you, you can use GithubDesktop to sync manually.
  3. "Gitlab" and "Gitee" is on the way

Differences

Differences from TiddlyDesktop?

  1. NodeJS version of TiddlyWiki have seamless auto-save experience, which is taking the advantage of SyncAdaptor instead of Saver, TG have better support for NodeJS wiki
  2. Using NodeJS wiki, We can have separated tiddler files, which can be modified by hand, or by other programs (e.g. VSCode with VSCode-TW5-Syntax)
  3. Though TiddlyDesktop can also load wiki folder generated by nodejs-TiddlyWiki, TG can backup that folder to the Github easily
  4. With the Electron technology, we can use fs, git and many other nodejs things within TiddlyWiki, which greatly extend the hackability, which is the reason why I choose TiddlyWiki as my daily KM tool

Why Github?

Because Github is one of the best free civil level BaaS:

  1. Its storage is basically free, allow us to store unlimited images and PDF files, which can have permanent URIs for public download
  2. It has GraphQL API that allow us programmatically update our wiki
  3. It has free CI to automatically deploy our TiddlyWiki blog
  4. It provides unlimited repository, public and private, which enables us to store private content into our TiddlyWiki

Development

Read Dev doc for details.

Credits

The desktop app shell is based on https://github.com/atomery/singlebox and atomery/webcatalog, they provide lots of utils around website-generated-app, much powerful than generating app from website simply using Chrome. Also the independent developer @quanglam2807 behind these great tools helps me a lot when I develop TidGi.

Current Icon is download from iconsdb under Creative Commons Attribution-NoDerivs 3.0 , if you are a designer, please feel free to contribute your ICON if you have a better idea.

Stargazers over time

Please give a star if you like it!

Stargazers over time