# 知识库 **Repository Path**: opentj/kb ## Basic Information - **Project Name**: 知识库 - **Description**: 本机构知识库,集中在软件方面 - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-09-21 - **Last Updated**: 2026-11-16 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # OpenTJ **[简体中文](README.md) | English** The open-source project collection of the Innovation Research Institute, Taiji Computer Corporation Limited. All projects are hosted in the Gitee organization **[gitee.com/opentj](https://gitee.com/opentj)**. This repository (`kb`) is the single entry point: **download guide + project index + quick start**. --- ## 1. Downloads (no build required) Pre-built binaries are published as releases of the **[dl](https://gitee.com/opentj/dl)** repository. Current release: **[Common Base Software v1.0](https://gitee.com/opentj/dl/releases/tag/v1.0)**. | Tool | Version | Platform | Download | | :--- | :--- | :--- | :--- | | **terminal** | 1.1.4 | Windows amd64 | [`.msi`](https://gitee.com/opentj/dl/releases/download/v1.0/terminal_1.1.4_windows_amd64.msi) · [`.exe` (installer)](https://gitee.com/opentj/dl/releases/download/v1.0/terminal_1.1.4_windows_amd64-setup.exe) | | **terminal** | 1.1.4 | macOS arm64 | [`.dmg`](https://gitee.com/opentj/dl/releases/download/v1.0/terminal_1.1.4_macos_arm64.dmg) | | **terminal** | 1.1.4 | macOS amd64 | [`.dmg`](https://gitee.com/opentj/dl/releases/download/v1.0/terminal_1.1.4_macos_amd64.dmg) | | **terminal** | 1.1.4 | Linux amd64 | [`.deb`](https://gitee.com/opentj/dl/releases/download/v1.0/terminal_1.1.4_linux_amd64.deb) · [`.rpm`](https://gitee.com/opentj/dl/releases/download/v1.0/terminal_1.1.4_linux_amd64.rpm) · [`.AppImage`](https://gitee.com/opentj/dl/releases/download/v1.0/terminal_1.1.4_linux_amd64.AppImage) | | **which** | 1.1.1 | Windows amd64 | [`which_1.1.1_windows_amd64.exe`](https://gitee.com/opentj/dl/releases/download/v1.0/which_1.1.1_windows_amd64.exe) | | **which** | 1.1.1 | Windows arm64 | [`which_1.1.1_windows_arm64.exe`](https://gitee.com/opentj/dl/releases/download/v1.0/which_1.1.1_windows_arm64.exe) | | **add-truetype** | 1.0.2 | Windows amd64 | [`add-truetype_1.0.2_windows_amd64.exe`](https://gitee.com/opentj/dl/releases/download/v1.0/add-truetype_1.0.2_windows_amd64.exe) | | **add-truetype** | 1.0.2 | Windows arm64 | [`add-truetype_1.0.2_windows_arm64.exe`](https://gitee.com/opentj/dl/releases/download/v1.0/add-truetype_1.0.2_windows_arm64.exe) | | **add-truetype** | 1.0.2 | Linux amd64 | [`add-truetype_1.0.2_linux_amd64`](https://gitee.com/opentj/dl/releases/download/v1.0/add-truetype_1.0.2_linux_amd64) | | **add-truetype** | 1.0.2 | Linux arm64 | [`add-truetype_1.0.2_linux_arm64`](https://gitee.com/opentj/dl/releases/download/v1.0/add-truetype_1.0.2_linux_arm64) | | **add-truetype** | 1.0.2 | macOS amd64 | [`add-truetype_1.0.2_darwin_amd64`](https://gitee.com/opentj/dl/releases/download/v1.0/add-truetype_1.0.2_darwin_amd64) | | **add-truetype** | 1.0.2 | macOS arm64 | [`add-truetype_1.0.2_darwin_arm64`](https://gitee.com/opentj/dl/releases/download/v1.0/add-truetype_1.0.2_darwin_arm64) | For more versions and newly added tools, watch the **[dl releases](https://gitee.com/opentj/dl/releases)**. > **Notes** > > - **Windows**: `terminal` ships both a `.msi` (WiX) and a `-setup.exe` (NSIS) installer — either one works. The binaries are not code-signed; if SmartScreen appears on first run, choose "More info → Run anyway". Only an amd64 package is available for Windows today — there is no ARM64 build yet. > - **macOS**: the `.dmg` files are neither signed nor notarized. On first launch, **right-click → Open** (or allow it under System Settings → Privacy & Security). > - **Linux**: install the `.deb` / `.rpm` directly; for the `.AppImage`, `chmod +x` it and run — no installation needed. > - On Linux / macOS, `which` and `add-truetype` are extension-less executables — `chmod +x` after downloading. --- ## 2. Projects at a glance ### Tools and libraries | Project | Description | Stack | Platforms | Version | License | | :--- | :--- | :--- | :--- | :--- | :--- | | **[terminal-ts](https://gitee.com/opentj/terminal-ts)** | Cross-platform desktop terminal emulator with a real PTY, tabs and renaming | Rust + Tauri 2 + Vue 3 + xterm.js | Windows / Linux / macOS | 1.1.4 | MIT | | **[which-cli](https://gitee.com/opentj/which-cli)** | A Rust implementation of Unix `which(1)`, bringing command lookup to Windows | Rust | Windows | 1.1.1 | MIT | | **[add-truetype-rs](https://gitee.com/opentj/add-truetype-rs)** | Install `.ttf` / `.otf` / `.ttc` fonts for the current user from the command line | Rust | Windows / Linux / macOS | 1.0.2 | MIT | | **[ai-desk](https://gitee.com/opentj/ai-desk)** | The AI Desk desktop application plus its in-package install/packaging flow | Tauri 2 + Vue 3 + TypeScript | Windows / Linux / macOS | 0.6.0 | MIT | | **[gpm-go](https://gitee.com/opentj/gpm-go)** | gpm (GUI Package Manager): a single-app install/uninstall CLI | Go | Windows / Linux / macOS | 1.0.1 | MIT | | **[gsetup-go](https://gitee.com/opentj/gsetup-go)** | GUI-Setup: the graphical installer for gpm packages | Go + Wails v3 | Windows / Linux / macOS | 2.0.2 | MIT | | **[portable-pty](https://gitee.com/opentj/portable-pty)** | A Go cross-platform PTY library (Go port of wezterm's portable-pty) | Go (pure Go, no cgo) | Windows / Linux / macOS / three BSDs | 0.3.0 | MIT | | **[qcode](https://gitee.com/opentj/qcode)** | A coding agent written in Rust: one shared kernel, TUI + desktop GUI + ACP | Rust + GPUI | Windows / Linux / macOS | 0.12.2 | MIT | ### Resources and documentation | Project | Description | Stack | Version | License | | :--- | :--- | :--- | :--- | :--- | | **[dl](https://gitee.com/opentj/dl)** | Release host for pre-built binaries (download center) | — | v1.0 | Apache-2.0 | | **[fonts](https://gitee.com/opentj/fonts)** | Curated CJK/Latin open-source fonts, download links and install guides | Markdown / HTML | — | MIT | | **[scripts](https://gitee.com/opentj/scripts)** | Development scripts and tooling | Python / Shell | — | MIT | | **[kb](https://gitee.com/opentj/kb)** | This repository: project index and knowledge base | Markdown | — | MIT | --- ## 3. The projects ### 1. terminal-ts — a cross-platform desktop terminal A desktop terminal emulator built on [Tauri 2](https://tauri.app): the Rust backend drives a real PTY via `portable-pty` (ConPTY on Windows, Unix PTY elsewhere), while the frontend renders it with Vue 3 + xterm.js in a WebView. Interactive programs such as `vim` and `htop` work fully. **Highlights** - **Shell auto-detection**: on Windows it tries `pwsh` → `powershell` → `cmd`; elsewhere it takes the nearest interactive shell in the parent chain, then the account's login shell (`dscl` on macOS, `/etc/passwd` elsewhere), then `$SHELL`, falling back to `/bin/sh` - **Tabs**: new (`Ctrl+Shift+T`), close (`Ctrl+Shift+W` / middle click), switch (`Ctrl+Tab`) — switching keeps the full scrollback - **Rename tabs**: double-click a tab or press `F2` to rename it in place; the context menu restores the shell-provided title, and OSC updates never clobber your name - **Copy/paste**: `Ctrl+Shift+C` / `Ctrl+Shift+V`; right click copies or pastes smartly - **Quit confirmation**: closing the window (or `Cmd+Q` on macOS) lists tabs that were renamed or still have a running process (a foreground job, or a background child older than 2s) and asks first; click an entry to jump back to that tab, Esc / Cancel aborts. Closing a single tab only asks when that tab still has a running process - **In-terminal search**: `Ctrl+Shift+F`; **font zoom**: `Ctrl+=` / `Ctrl+-` / `Ctrl+0` (the tab bar and context menu scale with it; default 20px) - **`config.json`**: override shell, font, font size, theme, scrollback, starting directory, etc. — generated on first run - **Themes**: dark / light / solarized-dark / dracula / tokyo-night, or follow the system dark mode - **CJK and icon rendering**: the font chain is probed as "ligature Nerd Font → ligature-only monospace → Nerd Font → system monospace → CJK (preferring Sarasa Mono SC)", so Private Use Area glyphs from oh-my-posh are not remapped into CJK mojibake by the Chinese font - **Single instance**, **window position/size memory**, and window title following the shell's OSC 0/2 Installers are listed under [Downloads](#1-downloads-no-build-required). Building from source: ```bash git clone https://gitee.com/opentj/terminal-ts.git cd terminal-ts npm install npm run tauri dev # development npm run tauri build # package installers ``` ### 2. which-cli — a usable `which` on Windows Windows has no Unix `which(1)`, and command lookup there has to account for `PATHEXT`, `App Paths` and more. `which-cli` reimplements the same experience in Rust and prints the full path of each command. ```console $ which cat /usr/bin/cat $ which zed cat C:\Users\\AppData\Local\Programs\Zed\bin\zed /usr/bin/cat ``` - Query several commands at once; commands that are not found simply print nothing and only affect the exit code - Exit codes: `0` all found / `1` some missing / `2` usage error; `--help`, `-h` and `--version` always return `0` - With no arguments it prints nothing and returns `0` Build it yourself: `cargo build --release` → `target/release/which` ### 3. add-truetype-rs — install fonts with one command Installs `.ttf` / `.otf` / `.ttc` fonts for the **current user** (no administrator rights) on macOS / Linux / Windows. It pairs well with the [fonts](https://gitee.com/opentj/fonts) repository. ```bash add-truetype # scan the current directory (including ttf/ and otf/) and install add-truetype --dry-run # preview only, change nothing add-truetype file.otf font.zip # named files or archives add-truetype somedir # a directory, processed recursively with the same rules ``` - Recognizes `.zip` / `.7z` / `.tar.gz` / `.tgz` / `.tar.zst` / `.tar` archives, installs the fonts inside and cleans up the temporary files - A font that fails to install does not affect the others; failures are summarized at the end - Runs `fc-cache -f` on Linux; registers the fonts in the current user's font directory on Windows Build it yourself: `cargo build --release` → `target/release/add-truetype` ### 4. ai-desk — the AI Desk desktop application A cross-platform desktop application (app identifier `dev.taiji.ai-desk`, currently 0.6.0) built with Tauri 2 + Vue 3 + TypeScript. Most of the repository today is the **in-package packaging and installation flow**: `tools/package.sh`, `tools/fetch-deps.sh`, `tools/smoke-test.sh`. At runtime the application depends on the `cot` / `tdp` toolchain shipped with the package, where [gpm-go](https://gitee.com/opentj/gpm-go) performs the installation and [gsetup-go](https://gitee.com/opentj/gsetup-go) provides the graphical installer. 0.6.0 ships GUI-Setup 2.0.2 and, on Linux, the **GTK3/4.1** build — the application itself depends on `webkit2gtk-4.1`, so the installer matches it. The frontend (`src/`) is still a starting skeleton. Building: ```bash npm install npm run tauri dev # development npm run tauri build # package ``` On Linux you first need the GTK and `libwebkit2gtk-4.1-dev` development packages (the list is in the repository README), and packaging produces a bare executable only: ```bash ./node_modules/.bin/tauri build --no-bundle ``` ### 5. gpm-go — a single-app installer (GUI Package Manager) A command-line installer written in Go that installs a "distribution package" into the current user's home directory and keeps it cleanly removable: - Unpacks the distribution and verifies integrity with `SHA256SUMS` - Drops the payload into the home directory, generates terminal launchers and writes a PATH block - Keeps a ledger of what was installed, enabling a clean uninstall - Can bootstrap `cot` / `tdp` offline - If the package carries a `setup:` section it can ship a GUI installer (see [gsetup-go](https://gitee.com/opentj/gsetup-go)) Go 1.27.1, with `gopkg.in/yaml.v3` as the only third-party dependency. Design documents: `docs/DESIGN.md`, `docs/REQUIREMENTS.md`, `docs/PACKAGE-FORMAT.md`. ### 6. gsetup-go — the graphical installer for gpm packages A GUI installer written in Go + Wails **v3.0.0** (CGO plus the system webview; the frontend assets are committed, so no npm is needed to build, and the build entry point is `wails3`). It turns the choices made in the UI (install `cot` or `tdp`, which home directory, whether to write PATH) into an `install.sh` / `install.cmd` / `install.ps1`, shows it read-only for confirmation, then executes it through [portable-pty](https://gitee.com/opentj/portable-pty) while streaming the output live. Settings collapse during install/uninstall and the log pane fills the window. Linux defaults to **GTK4 + webkitgtk-6.0**; since 2.0.2 there is also a **GTK3 + webkit2gtk-4.1** build for older distributions such as Ubuntu 22.04 (the one ai-desk bundles). Before `application.New` the program probes with `bwrap --ro-bind / / true`: on failure it sets `WEBKIT_DISABLE_SANDBOX_THIS_IS_DANGEROUS=1` and warns; with `GSETUP_REQUIRE_SANDBOX=1` it refuses to start. Dependencies: `github.com/qiuzhanghua/portable-pty v0.2.1`, `wails/v3 v3.0.0`. Each of the six platforms is built natively, with two Linux variants (GTK4 by default, GTK3 for older distributions), producing a macOS `.app`, a Windows `.exe` and a plain Linux binary. ### 7. portable-pty — a cross-platform PTY library for Go `github.com/qiuzhanghua/portable-pty` ports the Rust crate portable-pty (part of wezterm, MIT) to Go: - `Native().OpenPty`, `Master.Spawn` / `Resize`, `Command` / `LoginShell` / `Environ` - Distinguishes exit statuses caused by signals; `Kill` does not depend on `Wait` - The `serial` subpackage exposes serial ports as a `pty.Master` - Pure Go, no cgo; CI covers Linux / macOS / Windows (ConPTY), three BSDs are implemented but unverified, and other platforms return `ErrUnsupported` - Fixes the correctness problem in the `creack/pty` lineage where handles never enter the netpoller - Since 0.3.0, `Shell()` returns the shell you are actually typing in: the nearest interactive shell in the parent chain → the account's login shell (`dscl` on macOS, `/etc/passwd` elsewhere) → `$SHELL` → `/bin/sh`; `sh` / `dash` do not count as interactive, and the `SHELL` filled in by `Environ()` matches it Used by [terminal-ts](https://gitee.com/opentj/terminal-ts) (the Rust side uses the Rust crate of the same name) and [gsetup-go](https://gitee.com/opentj/gsetup-go). ### 8. qcode — a coding agent written in Rust A local coding agent that shares one kernel across its TUI, GPUI desktop GUI and ACP endpoint; the command is `qc`, current version 0.12.2. - **Tool loop**: 15 built-ins (`read_file` / `write_file` / `edit_file` / `apply_patch` / `list_dir` / `glob` / `grep` / `run_shell` / `web_fetch` / `todo_write` / `ask_user` / `schedule_create` / `schedule_list` / `schedule_view` / `schedule_edit`) plus `web_search`, `subagent` and `skill`; up to 4 read-only calls run concurrently in one batch while writes, shell and MCP calls stay serial, and `tool_result` entries are always logged in call order; the same tool with identical arguments three turns in a row ends the turn with `no_progress` - **One `qc`, the frontend follows how it was launched**: `qc tui` in a terminal opens the TUI while bare `qc` just prints usage and exits 0 (since 0.11, ADR-0089); clicking an icon / double-clicking opens a window and goes through single-instance, raising the existing one (the `qc gui` subcommand was removed in 0.10, ADR-0086). All three frontends share the same tool set and event log — they differ only in who can hand a capability to the user (`--json` event stream and `--max-turns` / `--timeout` exist only in `qc run`) - **Approval and sandboxing**: a three-valued policy (allow / ask / deny) matched on tool name (globs included — one `mcp__server__*` covers a whole server), command prefix and path; `deny` always wins and otherwise the most specific rule wins. Optional `sandbox-exec` on macOS, `bwrap` / `landlock` on Linux, `windows-acl` on Windows, with `extra_read` / `extra_writable` / `allow_pty` opening things up item by item; the default is `none`, so approval remains the main boundary. MCP servers get a separate per-server grant: runtime directories read-only + executable, writes only to the workspace and a private `HOME`, credentials via presets such as `credentials = ["github"]` - **Tasks and multiple directories**: a Task can mount several directories (read / write / primary); file tools resolve `@label/path`, and boundary edits take effect when the turn ends; the GUI sidebar renames, deletes and adds directories - **Tray, queue and scheduled tasks**: a system tray on macOS / Linux / Windows with closing the window minimized to it (no "new task" entry since 0.9); a running turn can be queued or steered into its next step — `/queue`, `/steer N` and `/drop N` in the TUI, while the GUI queue dock supports move up/down, delete and push. Scheduled tasks can be registered from all three frontends and are driven by the GUI; since 0.12 you can also `qc schedule create/list/delete` without opening a session - **Built-in terminal** (0.8): a "terminal" panel in the GUI — a separate executor, one entry point with multiple tabs, so running a command no longer needs a second window - **Rollback**: `write_file` / `edit_file` / `apply_patch` snapshot the previous content first, and with `snapshot_shell` on, every `run_shell` is preceded by a bounded workspace snapshot; `/checkpoint`, `/rollback` and `/diff` revert and show what changed - **Budget and timeouts**: exhausting `max_turns` / `max_cost_usd` pauses the turn rather than erroring out (`qc run` exits 75), and `--timeout` caps the whole turn by wall clock (exit 124); `Ctrl-C` goes down the same cancellation path — SIGTERM to the whole group, SIGKILL 2s later - **In-process network egress**: providers and `web_fetch` / `web_search` are forced through a local CONNECT proxy, with a domain allowlist and private-network / loopback blocking against SSRF; the audit goes to `logs/network.jsonl` - **MCP and Skills**: stdio and remote Streamable HTTP servers, with tools / resources / prompts all supported, tool names `mcp____`, `qc mcp add/remove` for configuration and `qc doctor --probe` to compare declared capabilities with what a server actually answers; Skills use the public Agent Skills format, `qc skills list` shows what was discovered and `/` activates one directly - **Also**: an append-only JSONL event log (schema v11, older logs still replay) with `sessions resume/fork/gc`, AGENTS.md, context compaction, `qc logs --grep/--since`, `qc doctor`, `qc update --check` and `qc acp` Building (Rust 2024 edition, Rust 1.95+): ```bash cargo build --workspace cargo test --workspace make list # show the release matrix make archive # build the per-platform archives make linux-desktop # Linux: install the menu entry, the counterpart of make app ``` GitHub Actions runs the full matrix on `v*` tags and renders the Homebrew / Scoop / winget manifests; the Gitee side mirrors the source and tags but has no releases yet. Design and decision documents: `docs/design/SPEC.md`, `docs/design/DECISIONS.md`. ### 9. fonts — set up CJK and monospace fonts once A curated list of tested, free, open-source fonts with official download links and per-platform install instructions, including: - **CJK**: Source Han Sans / Serif, Noto Serif CJK, Sarasa Gothic - **Monospace and ligatures**: JetBrains Mono (including Nerd Font builds), DejaVu - **Others**: Latin Modern Math and more [`sample01.html`](https://gitee.com/opentj/fonts/blob/main/sample01.html) in the repository is a **cross-platform font test page** (Kylin / Windows / macOS / Linux) for checking that CJK text, ligatures and Nerd Font icons all render correctly. For installing fonts from the command line see [add-truetype](https://gitee.com/opentj/add-truetype-rs). The repository stores only the list and the test page, never the font binaries. ### 10. dl — the download center Holds no code; it is only the release host, and its `README` lists the currently downloadable tools. To publish a new tool: tag the corresponding repository and produce the installers first, then upload them to this repository's releases and update the `README`. ### 11. scripts — development scripts Development scripts and tooling for \*nix, still at the initialization stage. Prerequisites: a \*nix system, Python 3.12 and [uv](https://github.com/astral-sh/uv). ### 12. kb — this project index This repository: the organization's introduction, the project index and the download guide. --- ## 4. Getting the source ```bash for p in kb terminal-ts which-cli add-truetype-rs ai-desk gpm-go gsetup-go portable-pty qcode fonts scripts dl; do git clone https://gitee.com/opentj/$p.git done ``` Just one project: ```bash git clone https://gitee.com/opentj/terminal-ts.git git clone https://gitee.com/opentj/gpm-go.git git clone https://gitee.com/opentj/qcode.git ``` `ai-desk`, `gpm-go`, `gsetup-go`, `portable-pty` and `qcode` are also mirrored on GitHub under `qiuzhanghua/*`: GitHub is the primary repository (CI and releases run there) while Gitee mirrors it, with `main` and the tags kept at the same SHA. --- ## 5. Contributing - File issues and feature requests against the **relevant repository**; send code contributions as pull requests. - Before submitting, make the repository's build and tests pass locally — each repository's `README.md` and `AGENTS.md` document the exact commands. ## 6. License Unless stated otherwise, this project collection is released under the **MIT** license, © 2026 the Innovation Research Institute of Taiji Computer Corporation Limited; see each repository's `LICENSE` file. [dl](https://gitee.com/opentj/dl) is Apache-2.0.