This repository contains an integration for Kotlin notebooks that provides access to the IntelliJ Platform APIs and plugins directly from your notebooks.
Install this integration by running %use intellij-platform
in your notebook.
After that, your code can use IntelliJ Platform APIs without declaring any additional dependencies.
Important: This integration can only run inside the IntelliJ IDE process, not as a standalone. Enable embedded mode to run it.
- Access to IntelliJ Platform APIs directly from your notebook
- Load bundled and installed plugins into your notebook
- Run code in the Event Dispatch Thread (EDT) for UI operations
- Automatic cleanup of resources when the kernel is restarted
You can load bundled plugins from the IDE by their IDs:
loadBundledPlugins("intellij.jupyter", "org.jetbrains.kotlin")
Or load installed plugins from your IDE:
loadPlugins("com.github.b3er.idea.plugins.arc.browser")
For UI operations, you need to run code in the Event Dispatch Thread:
runInEdt {
// Your UI code here
}
The full integration experience requires IntelliJ IDE version 2025.2 or higher. Some features like notebookDisposable
and loadPlugins()
may not be fully supported in earlier versions.
Here's a simple example of using the IntelliJ Platform integration:
%use intellij-platform
// Load the Kotlin plugin
loadPlugins("org.jetbrains.kotlin")
// Access IntelliJ Platform APIs
import com.intellij.openapi.project.Project
import com.intellij.openapi.application.ApplicationManager
// Get the current project
val project = currentProjectFromNotebook(notebook)
// Run UI operations in EDT
runInEdt {
// Your UI code here
println("Current project: ${project?.name}")
}
This integration is currently in an experimental state. APIs may change in future releases.
This project is licensed under the Apache License, Version 2.0.