Skip to content

PapyrusOR/Papyrus_Cli

╔═══════════════════════════════════════════════════════════════╗
║                          PAPYRUS CLI                          ║
╠═══════════════════════════════════════════════════════════════╣
║                                                               ║
║ █████████████████████████████████████████████████████████████ ║
║ █                    •                                      █ ║
║ █               •          •∙                       ·       █ ║
║ █  ▓▓▓▓▓▓▓  ▓▓▓▓▓  ▓▓▓▓▓▓▓ ▓▓   ▓▓ ▓▓▓▓▓▓▓ ▓▓   ▓▓  ▓▓▓▓▓▓  █ ║
║ █  ▓▓   ▓▓ ▓▓   ▓▓ ▓▓   ▓▓ ▓▓   ▓▓ ▓▓   ▓▓ ▓▓   ▓▓ ▓▓       █ ║
║ █  ▓▓   ▓▓ ▓▓   ▓▓ ▓▓   ▓▓ ▓▓   ▓▓ ▓▓   ▓▓ ▓▓   ▓▓ ▓▓       █ ║
║ █  ▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓∙ ▓▓▓▓▓  ▓▓▓▓▓▓▓ ▓▓   ▓▓  ▓▓▓▓▓   █ ║
║ █  ▓▓      ▓▓   ▓▓ ▓▓         ▓▓   ▓▓ ▓▓  ∙▓▓·  ▓▓      ▓▓  █ ║
║ █ ·▓▓   ·  ▓▓   ▓▓ ▓▓         ▓▓ • ▓▓  ▓▓∙ ▓▓∙  ▓▓      ▓▓  █ ║
║ █  ▓▓ ·    ▓▓   ▓▓ ▓▓         ▓▓   ▓▓   ▓▓  ▓▓▓▓▓  ▓▓▓▓▓▓   █ ║
║ █                      ·       ∙                            █ ║
║ █       ·                                   ·               █ ║
║ █       •    •     ▓▓▓▓▓▓  ▓▓       ▓▓▓▓▓▓▓                 █ ║
║ █•              · ▓▓       ▓▓        ·▓▓▓           ·•      █ ║
║ █  ∙              ▓▓       ▓▓         ▓▓▓    ••         •   █ ║
║ █       ·         ▓▓       ▓▓         ▓▓▓         ∙         █ ║
║ █  ·              ▓▓       ▓▓ ·  ·    ▓▓▓               ·   █ ║
║ █              ∙  ▓▓•      ▓▓         ▓▓▓                   █ ║
║ █               •  ▓▓▓▓▓▓  ▓▓▓▓▓▓▓ ·▓▓▓▓▓▓▓          ∙ •  · █ ║
║ █             •              •          ·•·           ·     █ ║
║ █       ·                     •             •          ∙    █ ║
║ █████████████████████████████████████████████████████████████ ║
║                                                               ║
╚═══════════════════════════════════════════════════════════════╝

npm version License: MIT Node.js Version TypeScript

A powerful command-line interface for Papyrus - the SRS (Spaced Repetition System) learning application.

Running papyrus without any arguments will display the ASCII art banner above.

✨ Features

  • 🎴 Card Management - Create, edit, delete, and search flashcards
  • 📚 Interactive Review - Terminal-based review sessions with SM-2 algorithm
  • 📊 Statistics - Track your learning progress
  • 💾 Data Management - Backup, restore, import, and export your data
  • 🚀 Server Control - Start and manage the Papyrus API server
  • ⚙️ Configuration - Flexible CLI configuration

📦 Installation

npm install -g @alpacali/papyrus-cli

Or use with npx:

npx @alpacali/papyrus-cli <command>

🚀 Quick Start

# 1. Start the Papyrus server
papyrus serve

# 2. Add a card
papyrus card add "What is the capital of France?" "Paris"

# 3. Start reviewing
papyrus review

# 4. Check your stats
papyrus stats

📖 Commands

Card Management

# List all cards
papyrus card list
papyrus card list --tags "language" --detailed

# Show card details
papyrus card show <id>

# Add a new card
papyrus card add "Question" "Answer" --tags "tag1,tag2"

# Edit a card
papyrus card edit <id> --question "New question" --tags "updated"

# Delete a card
papyrus card delete <id>
papyrus card delete <id> --force

# Search cards
papyrus card search "keyword"

# Import from text file
papyrus card import cards.txt

# Export to JSON
papyrus card export --output cards.json

# List due cards
papyrus card due

Review

# Start interactive review session
papyrus review

# Show review statistics
papyrus stats

Data Management

# Create backup
papyrus data backup
papyrus data backup --output my-backup.db

# Restore from backup
papyrus data restore my-backup.db

# List backups
papyrus data list-backups

# Clean old backups
papyrus data clean-backups --keep 5

# Export data
papyrus data export data.json

# Import data
papyrus data import data.json

# Show data stats
papyrus data stats

Server Management

# Start server
papyrus serve
papyrus serve --port 8080 --detach

# Check server status
papyrus status

# Stop server
papyrus stop

# Open API docs
papyrus docs

Configuration

# Show configuration
papyrus config

# Get specific value
papyrus config --get apiUrl

# Set value
papyrus config --set apiUrl=http://localhost:8080

# Reset to defaults
papyrus config --reset

📝 Import Format

When importing cards from a text file, use the following format:

Question 1 === Answer 1

Question 2 === Answer 2

# Lines starting with # are ignored
Question 3 === Answer 3

⚙️ Configuration

Configuration is stored in ~/.papyrus/config.json:

{
  "apiUrl": "http://127.0.0.1:8000",
  "dataDir": "~/Documents/Papyrus"
}

🛠️ Development

# Clone repository
git clone https://github.com/Papyrus/Papyrus-cli.git
cd Papyrus-cli

# Install dependencies
npm install

# Run in development mode
npm run dev

# Run quality checks
npm run quality

# Build
npm run build

🔧 Requirements

  • Node.js 18+
  • Papyrus API server running

🤝 Contributing

Contributions are welcome! Please see CONTRIBUTING.md for guidelines.

📄 License

MIT License - see the LICENSE file for details.


Papyrus CLI - Learn smarter, remember longer.

About

Papyrus的命令行工具

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors