FooSoft / anki-connect

Anki plugin to expose a remote API for creating flash cards.
https://foosoft.net/projects/anki-connect/
Other
1.92k stars 218 forks source link

Connect to a headless Anki instance #411

Open AllenEllis opened 10 months ago

AllenEllis commented 10 months ago

I wanted to resurrect either #87 or #62 to find out I it's possible to use anki-connect with a headless instance of Anki (maybe its GUI-free sync server?)

My use case is that I've written a web app to track my learned vocabulary. It uses Anki-Connect to automatically create new cards in Anki. All of this runs directly on my laptop.

I'd like to move it all to a headless remote Ubuntu server so that I can create new cards and sync them on mobile without my laptop needing to be online somewhere.

The problem with doing this is simply getting Anki-Connect to install, because this is done with the "Get Add-ons" GUI that isn't available on a remote Ubuntu Server.

I've tried setting up remote X11 forwarding but every guide I've followed still fails to get the remote server to recognize any "displays", so Anki crashes when launching.

Is there any way I can manually install this addon without using the Anki GUI?

antistic commented 10 months ago

I don't know how to get a headless Anki instance working so this has only been tested with gui Anki, but

The problem with doing this is simply getting Anki-Connect to install, because this is done with the "Get Add-ons" GUI that isn't available on a remote Ubuntu Server.

Is there any way I can manually install this addon without using the Anki GUI?

You don't need the get add-ons gui to install a plugin. It's possible to clone this repository and move (or symlink) it into your Anki add-ons folder, which on linux should be in ~/.local/share/Anki2/addons21. This repo also includes the script link.sh which links it for you.