MCPcopy Index your code
hub / github.com/Kotlin/kotlin-interactive-shell

github.com/Kotlin/kotlin-interactive-shell @v0.5.2

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.5.2 ↗ · + Follow
2,994 symbols 4,575 edges 55 files 347 documented · 12%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Kotlin Language Interactive Shell

Kotlin Stable JetBrains team project Maven Central

The shell is an extensible implementation of Kotlin REPL with reach set of features including:

  • Syntax highlight
  • Type inference command
  • Downloading dependencies in runtime using Maven coordinates
  • List declared symbols

History

The project is the former Sparklin shell migrated to the new Kotlin scripting and REPL infrastructure and converted to a generic Kotlin Language Interactive Shell.

The Apache Spark adaptation of it is located in a separate repository.

The previous version of the Sparklin is accessible in the sparklin branch.

Installation and Usage

Manual

You can download archive from Maven Central: 1. Go to Releases page 2. Download desired version there 3. Unpack it to desired place 4. Launch bin/ki.sh for Linux/Mac or bin\ki.bat for Windows

SDKMAN!

Install with SDKMAN! with the following command:

sdk install ki

After installation you can launch ki with either ki or ki.sh comman.

Arch Linux

On Arch Linux, there's an AUR package available. After installation, you can run the shell through ki.

Homebrew

Install with Homebrew with the following command:

brew install ki

MacPorts

Install with MacPorts with the following command:

sudo port install ki-shell

Build From Source

To build from source use:

git clone https://github.com/Kotlin/kotlin-interactive-shell
cd kotlin-interactive-shell
mvn -DskipTests package

It may be useful to build the project with a specific version of Kotlin. To do so use:

mvn -Dkotlin.version=1.4.10 -DskipTests package

To start the shell, run bin/ki.sh on Linux and macOS. On Windows, use bin\ki.bat instead.

To exit the shell, type :q or :quit.

Adding maven repositories that require auth

The following options are supported:

:repository https://myrepo.org username=user password=pwd
:repository https://myrepo.org username:user password:pwd

:repository https:myrepo.org ./path/to/file
# properties file should contain
# username=john
# password=johnpwd

Extension points exported contracts — how you extend this code

KotlinParserListener (Interface)
This interface defines a complete listener for a parse tree produced by KotlinParser. [1 implementers]
ki-shell/src/main/kotlin/org/jetbrains/kotlinx/ki/shell/parser/KotlinParserListener.java
Action (Interface)
(no doc)
ki-shell/src/main/kotlin/kotlinx/cli/Actions.kt
FlagAction (Interface)
(no doc)
ki-shell/src/main/kotlin/kotlinx/cli/Actions.kt
ArgumentAction (Interface)
(no doc)
ki-shell/src/main/kotlin/kotlinx/cli/Actions.kt
CommandAction (Interface)
(no doc)
ki-shell/src/main/kotlin/kotlinx/cli/Actions.kt

Core symbols most depended-on inside this repo

enterRule
called by 171
ki-shell/src/main/kotlin/org/jetbrains/kotlinx/ki/shell/parser/KotlinParser.java
exitRule
called by 171
ki-shell/src/main/kotlin/org/jetbrains/kotlinx/ki/shell/parser/KotlinParser.java
get
called by 36
ki-shell/src/main/kotlin/org/jetbrains/kotlinx/ki/shell/configuration/CachedInstance.kt
expression
called by 28
ki-shell/src/main/kotlin/org/jetbrains/kotlinx/ki/shell/parser/KotlinParser.java
simpleIdentifier
called by 25
ki-shell/src/main/kotlin/org/jetbrains/kotlinx/ki/shell/parser/KotlinParser.java
type
called by 23
ki-shell/src/main/kotlin/org/jetbrains/kotlinx/ki/shell/parser/KotlinParser.java
highlight
called by 20
ki-shell/src/main/kotlin/org/jetbrains/kotlinx/ki/shell/ContextHighlighter.kt
add
called by 20
ki-shell/src/main/kotlin/org/jetbrains/kotlinx/ki/shell/plugins/RuntimePlugin.kt

Shape

Method 2,637
Class 272
Function 65
Interface 20

Languages

Java73%
Kotlin27%

Modules by API surface

ki-shell/src/main/kotlin/org/jetbrains/kotlinx/ki/shell/parser/KotlinParser.java1,838 symbols
ki-shell/src/main/kotlin/org/jetbrains/kotlinx/ki/shell/parser/KotlinParserListenerForHighlighting.kt358 symbols
ki-shell/src/main/kotlin/org/jetbrains/kotlinx/ki/shell/parser/KotlinParserListener.java343 symbols
ki-shell/src/main/kotlin/org/jetbrains/kotlinx/ki/shell/Shell.kt36 symbols
ki-shell/src/main/kotlin/org/jetbrains/kotlinx/ki/shell/plugins/RuntimePlugin.kt31 symbols
ki-shell/src/main/kotlin/kotlinx/cli/Events.kt28 symbols
ki-shell/src/test/kotlin/org/jetbrains/kotlinx/ki/shell/plugins/KotlinHighlighterTest.kt22 symbols
ki-shell/src/main/kotlin/org/jetbrains/kotlinx/ki/shell/configuration/ReplConfiguration.kt19 symbols
ki-shell/src/test/kotlin/org/jetbrains/kotlinx/ki/shell/plugins/DependenciesPluginTest.kt18 symbols
ki-shell/src/main/kotlin/kotlinx/cli/HelpPrinter.kt16 symbols
ki-shell/src/main/kotlin/org/jetbrains/kotlinx/ki/shell/parser/KotlinLexer.java15 symbols
ki-shell/src/main/kotlin/org/jetbrains/kotlinx/ki/shell/plugins/PromptPlugin.kt14 symbols

For agents

$ claude mcp add kotlin-interactive-shell \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact