📦antigluten / amgi
← 返回首页
An open-source, offline-first Anki-compatible iOS flashcard client with sync server support, powered by the official Anki Rust backend via C FFI.
⚖️ NOASSERTION#anki#flashcards#fsrs#ios#rust📅 创建于 2026-03-28🔄 更新于 2026-10-28
🔗 GitHub Swift

📄 仓库 README

在 GitHub 查看 ↗
来自 GitHub 仓库自述文件 · 版权归原作者所有

Amgi

암기 (amgi) — Korean for "memorization"

An open-source, offline-first Anki-compatible iOS flashcard client with sync server support.

Swift 6.2 iOS 18+ watchOS 11+ Rust FFI AGPL-3.0


Amgi wraps the official ankitects/anki Rust backend via C FFI, giving you a native SwiftUI experience backed by the same battle-tested engine that powers Anki Desktop and AnkiDroid. Sync your decks with any compatible sync server (including self-hosted), study with FSRS scheduling, and keep your review history in perfect sync across all your devices.

Screenshots

Library — due-today hero card with streak, and the deck tree with per-state counts Study — today's queue across every deck, with an up-next list Review — a card showing the next interval on every rating button Browse — Anki search with deck and tag filter chips Statistics — streak, last-month summary, and the future-due forecast

Highlights

  • The real FSRS engine — scheduling, templates, search and sync are the upstream Rust code, not a reimplementation.
  • Offline-first — everything works without a connection; sync when you have one.
  • Any sync server — AnkiWeb or self-hosted, with a safe merge when collections diverge.
  • Built-in EPUB reader — with offline Yomitan-compatible dictionary lookup, so cards come from what you are reading.
  • Beyond the phone — home-screen widgets, an Apple Watch app that runs the engine on-device, and Shortcuts/Siri actions.
  • Image occlusion, card templates, FSRS simulator — the power-user surface, not a cut-down mobile client.

The full list is in Documentation/FEATURES.md.

Quick start

Install the toolchain first — Xcode 26, Rust (stable and nightly, for the watchOS slice), protoc and xcodegen. Documentation/BUILDING.md has the exact commands, plus how to run the tests.

git clone --recursive https://github.com/antigluten/amgi.git
cd amgi

./scripts/build-xcframework.sh            # Rust engine → xcframework
./scripts/generate-protos.sh              # protobuf → Swift types
cd AmgiApp && xcodegen generate && cd ..  # project is generated, not checked in
open AmgiApp/AmgiApp.xcodeproj

Documentation

Document What it covers
Features Everything the app does today
Building Requirements, setup, build, tests, the watch target
Architecture Layers, package layout, design decisions
Rust bridge The C FFI seam, protobuf dispatch, the build pipeline
Data flows Sync, study, browse, stats and widgets, RPC by RPC
Code style Swift conventions and the module boundaries that matter
Contributing Issues, branches, commits, pull requests
Changelog What changed in each release

AGENTS.md at the repo root routes a coding agent to a per-package guide (AmgiFeatures/AGENTS.md, Sources/AGENTS.md, …) plus the reference notes in agents/.

Architecture in one diagram

SwiftUI feature modules (AmgiFeatures)
    |
@DependencyClient structs (AnkiClients)
    |
Service facades (AnkiServices)
    |
Typed protobuf requests (AnkiProtoBridge)
    |
AnkiBackend (Swift wrapper)
    |
C FFI (4 functions)
    |
Rust dynamic framework (ankitects/anki rslib)

Swift owns the UI. Rust owns everything else — database, sync, FSRS scheduling, card templates, search, import/export, statistics.

Tech stack

  • UI: SwiftUI with strict concurrency (Swift 6.2, language mode v6)
  • Dependency Injection: swift-dependencies (@DependencyClient struct-closure pattern)
  • Backend: ankitects/anki Rust crate via C FFI
  • Serialization: Protocol Buffers (25 .proto service definitions)
  • Database: SQLite (owned by Rust backend)
  • EPUB: vendored EPUBKit (MIT), with hoshidicts for Yomitan dictionaries
  • Build: SPM for library and feature modules, xcodegen for the app, widget, and watch targets

License

This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0) because it incorporates ankitects/anki (copyright Ankitects Pty Ltd), which is also AGPL-3.0. See LICENSE for the full license text.

The AGPL requires that if you distribute this software or run it as a network service, you must make the complete source code available under the same license.

Contributing

Contributions are welcome. See CONTRIBUTING.md for guidelines, code style, and the development setup. A list of contributors is maintained in CONTRIBUTORS.md.

Acknowledgments

  • Damien Elmes and the ankitects/anki contributors for the Rust backend that powers this app
  • DreamAfar for the v0.0.3 fork that contributed Image Occlusion, the multi-theme system, the Settings tab, the card template editor, retrievability stats, tag management, the rich note editor, and the GitHub Actions IPA workflow
  • AnkiDroid for pioneering the Rust backend bridge pattern on mobile
  • Point-Free for swift-dependencies

📈 近 7 天 Star 趋势

每日新增 Star(柱)与累计 Star(线)· 数据来自 GitHub

🏆 排名变化趋势

在各榜单中的排名历史(数字越小越靠前)

📋 历史上榜记录

每次快照的详细数据
日期 榜单 排名 周期新增 总 STAR