mix phoenix_kit_knowledge_base.rescan (PhoenixKitKnowledgeBase v0.1.0)

Copy Markdown View Source

Reconciles vault indexes with the markdown files on disk.

The web UI has a Rescan button; this is the same operation from a shell, so it can run from cron, from a deploy script, or from a git hook after a pull.

# every vault
mix phoenix_kit_knowledge_base.rescan

# one vault, by slug
mix phoenix_kit_knowledge_base.rescan research

# quiet: only print vaults that actually changed, and errors
mix phoenix_kit_knowledge_base.rescan --quiet

Exits non-zero if any vault reported an error, so a cron job or CI step fails loudly rather than logging into the void.

This is a separate OS process from the running app, with no PubSub: browsers open on a vault pick its changes up on their next navigation, not at once. To refresh them immediately, call PhoenixKitKnowledgeBase.Rescan.run/1 on the live node instead (a release's bin/<app> rpc).