Space CLI: Manage Flashcards with AI in Your Terminal
You learn a new framework, dive into system design, or prep for a technical interview. A week later, 80% of it is gone. Spaced repetition fixes that. Reviewing cards feels best in the Space app, on your phone or laptop. But creating decks, analyzing them, and optimizing them? That is work for a command line and an AI.
Space CLI gives your AI direct access to your decks. Export as JSON, full-text search, write new cards back. Claude Code, ChatGPT, Ollama, whatever you prefer. It is the piping layer between your flashcards and any LLM.
What is Space CLI?
Space CLI is a command-line companion to the Space desktop app. The app keeps every flashcard in a local SQLite database on your machine. The CLI reads and writes that same file directly. No server round-trips, no API keys, no separate CLI login. It runs on macOS (Apple Silicon), Linux, and Windows.
| Command | Purpose |
|---|---|
space deck list | List all decks with card counts and due cards |
space deck cards <id> | Show cards of a deck with due status |
space card show <id> | Detailed view: FSRS stability, retrievability, strength |
space card search <query> | Full-text search across fronts and backs |
space deck stats <id> | Learning stats with maturity distribution |
space deck export <id> | Export as JSON or CSV |
space deck create <name> | Create a new deck |
space card create --deck <id> | Add a new card to a deck |
space card edit <id> | Edit card content |
Installation
Before you install the CLI, install the Space app and open it once so the local database exists. Then, the fastest path on macOS and Linux:
brew install space-org/tap/space-cli
Or, without Homebrew:
curl -fsSL https://raw.githubusercontent.com/space-org/space-cli/main/scripts/install.sh | sh
For Windows or manual installs, grab the binary from the latest release and drop it on your PATH. Verify:
space --version
# space-cli 0.1.0
Space CLI finds your database automatically. Paths and troubleshooting live on the CLI page.
Custom database path
If auto-detection fails, set the path manually: space --db-path /path/to/space.db deck list
Space CLI in action
See decks and learning status at a glance
$ space deck list
ID Name Cards Due Created
──────── ──────────────────── ───── ─────── ──────────
a1b2c3d4 Spanish Vocabulary 342 12 due 2025-08-14
e5f6g7h8 System Design 89 0 due 2025-11-03
i9j0k1l2 Rust Ownership 56 3 due 2026-01-20
3 deck(s) total
One glance: 12 Spanish cards are due, System Design is clean.
Analyze learning progress
$ space deck stats a1b2c3d4
Spanish Vocabulary
Maturity Distribution
New ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 3% (10)
Learning ████░░░░░░░░░░░░░░░░░░░░░░░░░░ 12% (41)
Young ████████████░░░░░░░░░░░░░░░░░░ 38% (130)
Mature ██████████████░░░░░░░░░░░░░░░░ 47% (161)
Total Cards: 342
Due Now: 12
Avg Retrievability: 91.3%
Avg Strength: 74.8%
Review History (30 days)
Total Reviews: 287
Known: 246
Unknown: 41
Accuracy: 85.7%
Stats come from FSRS-6: retrievability is the probability you’d answer correctly right now, strength combines stability and retrievability into one score.
Export your data
$ space deck export a1b2c3d4 --format json
{
"deck": {
"id": "a1b2c3d4-7b33-461c-b40f-c4ee786b54ea",
"name": "Spanish Vocabulary",
"description": "A1-B1 Core Vocabulary",
"frontLanguage": "es-ES",
"backLanguage": "en-US"
},
"cards": [
{
"id": "82ae9e66-b21b-4db5-956d-8d1062d4c835",
"front": "el gato",
"back": "the cat",
"position": 0
},
{
"id": "7507eef0-808d-410d-ba1c-e0f325e5012b",
"front": "la casa",
"back": "the house",
"position": 1
}
]
}
JSON or CSV: both pipe straight into any tool.
Bring your own AI, bring your own source
Space CLI is not a closed AI system. It emits structured data and accepts structured input. What sits in between is up to you: Claude for long contexts, a local Ollama model for privacy, ChatGPT for speed, Gemini for multimodal. Your source material is just as open: an EPUB you read last week, a PDF stack, your own notes, a Markdown doc set. Pipe any of it through the model of your choice and land the output back in Space.
Find confusion pairs in an existing deck
Export a deck and let the AI surface semantic overlap:
space deck export a1b2c3d4 --format json | claude \
"Here are my Spanish flashcards. Which words have similar
meanings I could easily confuse? Generate mnemonics for
the most confusing pairs."
The AI sees the whole deck at once and spots false friends and overlapping meanings you miss when studying one card at a time.
Generate explanations for tough cards
Research on the elaboration effect shows that linking new knowledge to existing knowledge creates more retrieval paths.
space card show m3n4o5p6 | claude \
"Explain this concept with a hands-on example and an
analogy to something I already know as a developer."
Turn any source into cards
The generation effect says that attempting your own answer before seeing the solution anchors knowledge deeper. Pipe any source into your model, let it draft cards, then write them back:
pandoc book.epub -t plain | claude \
"Extract the 20 most testable ideas from this text as
flashcards. Format: JSON array with 'front' and 'back'."
space card create --deck e5f6g7h8 \
--front "How does eventual consistency differ from strong consistency?" \
--back "Eventual: all replicas converge eventually. Strong: every read returns the latest write. Trade-off: latency vs. consistency (CAP theorem)."
Your data, your model, your sources
Space CLI is agnostic. Claude, ChatGPT, Ollama, LM Studio, Gemini, whatever you prefer. With a local model your flashcard data never leaves your machine, and your source material can be anything: EPUBs, PDFs, articles, your own notes.
Why AI plus flashcards works
The pairing rides three well-documented principles: retrieval practice is 2 to 3x more effective than rereading (Roediger and Karpicke, 2006), the generation effect anchors knowledge you produce yourself, and elaboration builds extra retrieval paths when new knowledge links to the old.
Sync across all your devices
Cards you create in the CLI show up on your phone, tablet, and desktop. PowerSync pushes every CLI change to the server and from there to your other devices, with no manual sync and no cloud login in the CLI itself.
Who Space CLI is for
The CLI is not a replacement for the app. Reviewing cards is more pleasant on a phone or laptop. The CLI is for the work around reviewing: building decks, analyzing them with your AI, exporting, scripting.
- Developers learning new technologies. Pipe an EPUB, a doc set, or a conference talk transcript into the model of your choice, get a deck back, review on any device. Your source, your AI, your data.
- Language learners going systematic. Auto-generate example sentences from an existing vocabulary deck, or extract new vocab from articles and subtitles. One pipe command does it.
Ready? One command:
brew install space-org/tap/space-cli
Then space deck list opens your decks to any AI you want to pair them with. Review on your phone, tablet or desktop, where it feels best. Your data stays yours, exports as JSON or CSV whenever you want (unlike Quizlet), and syncs to the Space app across every device.