How thansheer/obsidian-omnichat works
OmniChat is an Obsidian plugin that combines embedded web-based AI services with an agent chat studio. Users open the persistent chat view, choose a mode, then either use a web service or send a prompt to a CLI/API agent; agent chats can incorporate vault context and retain session history. The graph also includes settings and onboarding/feedback capabilities documented or referenced in the source index. Some links rely on README descriptions or import references; unsampled implementation details are not inferred.
Main entry points: main.ts Plugin lifecycle · AgentChatUI.ts Agent chat UI · AIChatView.ts Chat view · settings.ts Settings and diagnostics
Components 23
Plugin experience
- Plugin lifecycle
src/main.ts - Commands
src/commands/index.ts - Chat view
src/views/AIChatView.ts
Browser AI
- Web AI services
src/constants.ts - Webview theming
src/services/WebviewThemeService.ts
Agent studio
- Agent chat UI
src/views/AgentChatUI.ts - CLI execution
src/services/AgentCliService.ts - Model APIs
src/services/AgentApiService.ts - Agent engines
src/types/agent.ts
Vault context and history
- Vault search
src/services/VaultQueryService.ts - Context selection
src/modals/ContextSearchModal.ts - Chat history
src/services/ChatHistoryService.ts
Settings and support
- Settings and diagnostics
src/settings.ts - Welcome and updates
src/modals/WelcomeModal.ts - Release notes
src/feedback/github.ts - Update modal
src/modals/UpdateNotesModal.ts - Feedback forms
src/modals/FeedbackModal.ts
Other components
- Obsidian user
- External AI websites
- External model APIs
- Local CLI agents
- Obsidian vault
- GitHub releases
Connections 27
- Obsidian user → Commands: invokes
src/commands/index.ts - Commands → Plugin lifecycle: dispatches
src/commands/index.ts - Plugin lifecycle → Chat view: registers view
src/main.ts - Obsidian user → Chat view: uses
README.md - Chat view → Web AI services: selects service
src/views/AIChatView.ts - Chat view → External AI websites: loads web interface
README.md - Chat view → Webview theming: applies theme
src/views/AIChatView.ts - Chat view → Agent chat UI: hosts agent mode
src/views/AIChatView.ts - Agent chat UI → Agent engines: uses engine definitions
src/views/AgentChatUI.ts - Agent chat UI → CLI execution: runs CLI prompt
src/views/AgentChatUI.ts - Agent chat UI → Model APIs: streams model requests
src/views/AgentChatUI.ts - CLI execution → Local CLI agents: spawns process
- Model APIs → External model APIs: calls model APIs
README.md - Agent chat UI → Context selection: opens context search
src/views/AgentChatUI.ts - Agent chat UI → Vault search: searches vault
src/views/AgentChatUI.ts - Vault search → Obsidian vault: reads notes
README.md - Chat view → Obsidian vault: stages note context
README.md - Agent chat UI → Chat history: loads and saves sessions
src/views/AgentChatUI.ts - Plugin lifecycle → Chat history: loads store
src/main.ts - Plugin lifecycle → Settings and diagnostics: loads settings
src/main.ts - Settings and diagnostics → CLI execution: detects CLI tools
src/settings.ts - Plugin lifecycle → Welcome and updates: opens onboarding
src/main.ts - Plugin lifecycle → Release notes: fetches release notes
src/main.ts - Plugin lifecycle → Update modal: shows updates
src/main.ts - Update modal → Release notes: requests release data
src/modals/UpdateNotesModal.ts - Settings and diagnostics → Feedback forms: opens feedback
src/settings.ts - Release notes → GitHub releases: requests releases
src/feedback/github.ts