Skip to main content

CLI tool for managing Mochi flashcards with local-first sync

Project description

mochimochi

mochimochi

🍡 Local-first CLI for curating Mochi flashcard decks with AI-powered deduplication and quality grading ✨

mochimochi is a Python CLI for managing Mochi flashcards from local markdown files. Pull a deck from Mochi, edit it in your own folder, review changes with git, then push or sync the result back to Mochi.

It also includes optional AI workflows for finding semantic duplicates and improving card quality before you sync.

Install

uv tool install git+https://github.com/tsilva/mochimochi.git
mochimochi decks

The first command installs the CLI. The second lists your Mochi decks and prompts for a Mochi API key if one has not been saved yet.

For local development:

git clone https://github.com/tsilva/mochimochi.git
cd mochimochi
uv sync --extra dev
uv run mochimochi decks

Commands

mochimochi decks                         # list available Mochi decks
mochimochi pull <deck_id>                # download a deck to deck-<name>-<deck_id>.md
mochimochi push deck-python-abc123.md    # push local markdown changes to Mochi
mochimochi sync deck-python-abc123.md    # sync local changes and handle remote deletions
mochimochi push                          # push every deck-*.md file in the current directory
mochimochi sync                          # sync every deck-*.md file in the current directory
mochimochi dedupe deck-python-abc123.md  # find and remove semantic duplicates
mochimochi curate deck-python-abc123.md  # grade and improve low-quality cards

Useful options:

mochimochi push deck-python-abc123.md --force       # skip duplicate detection
mochimochi sync deck-python-abc123.md --force       # skip duplicate detection
mochimochi dedupe deck-python-abc123.md --threshold 0.9
mochimochi curate deck-python-abc123.md --threshold 9

Card Format

Deck files are markdown. Existing cards keep their Mochi card_id; new cards use null.

---
card_id: abc123
tags: ["python", "basics"]
---
What is a list comprehension?
---
A concise way to create lists: [x for x in iterable]
---
card_id: null
---
New card question
---
New card answer

Notes

  • Requires Python 3.10 or newer.
  • Config is stored in ~/.mochimochi/config.
  • MOCHI_API_KEY is required for all commands and is prompted on first use.
  • OPENROUTER_API_KEY is required for dedupe and curate.
  • AI caches are stored in ~/.mochimochi/cache.
  • New local decks can be created as deck-<name>.md; the first push creates the Mochi deck and renames the file to include the deck ID.
  • Run unit tests with uv run pytest -m "not integration". Live API tests require TEST_DECK_ID.

Architecture

mochimochi architecture diagram

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mochimochi-0.1.1.tar.gz (28.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mochimochi-0.1.1-py3-none-any.whl (22.6 kB view details)

Uploaded Python 3

File details

Details for the file mochimochi-0.1.1.tar.gz.

File metadata

  • Download URL: mochimochi-0.1.1.tar.gz
  • Upload date:
  • Size: 28.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mochimochi-0.1.1.tar.gz
Algorithm Hash digest
SHA256 138d90191f36ca4d955d2768932bcf35a71fc6292f4d4f420525612a9563f73f
MD5 b330203f925d5983d33e99b631e4dbfe
BLAKE2b-256 2232cd8c221aedc38a0f5344a663f6f4c161467a4ed6ee02ca9754b3e3c39774

See more details on using hashes here.

Provenance

The following attestation bundles were made for mochimochi-0.1.1.tar.gz:

Publisher: release.yml on tsilva/mochimochi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mochimochi-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: mochimochi-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 22.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mochimochi-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ea94b162b5721e3ff1c1fb2bbf4fcf9bacc6d37decfd892f757950e938eb2033
MD5 75d259a097d6997427bc52b495630675
BLAKE2b-256 e3ffb1732c4c55668e25c6cf04a91d8165285d3263e87ca4d250b52a272db5b4

See more details on using hashes here.

Provenance

The following attestation bundles were made for mochimochi-0.1.1-py3-none-any.whl:

Publisher: release.yml on tsilva/mochimochi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page