Skip to content

liufei/ai-dictionary

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI Dictionary

Ask AI to explain the word in sentence and save definition to Anki.

Ask AI to explain the word in sentence

Requirements

  • Node.js >=20.12.0
  • LLM API Key

Usage

  1. Open terminal, set environment variables
    • OpenAI, Deepseek, etc.
      export OPENAI_BASE_URL=https://api.deepseek.com/v1; export OPENAI_API_KEY=sk-***; export OPENAI_MODEL=deepseek-r1
    • Ollama
      export OPENAI_BASE_URL=http://localhost:11434/v1; export OPENAI_API_KEY=ollama; export OPENAI_MODEL=gemma3:27b
  2. Run command npx ai-dictionary
  3. Paste sentence and word into command line
    • press Enter to ask AI
    • press Ctrl+L to clear console
    • press Ctrl+C to exit program

Example

Screenshot 2025-03-27 at 14 02 34

Save definition to Anki

Requirements

  • Anki Desktop
  • AnkiConnect

Usage

  1. Open Anki, create deck AI Dictionary.
Screenshot 2025-03-26 at 14 37 54
  1. Click Tools -> Manage Note Types from Anki menu, add note type AI Dictionary.
Screenshot 2025-03-26 at 14 38 43
  1. Add card template.
Screenshot 2025-03-26 at 14 39 09

Example

Screenshot 2025-03-26 at 12 03 43

About

Ask AI to explain the word in sentence and save definition to Anki.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published