pi-julia

Julia TTFX eliminator for pi — persistent DaemonMode server + exec tools

Packages

Package details

extension

Install pi-julia from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:pi-julia
Package
pi-julia
Version
0.1.0
Published
May 11, 2026
Downloads
31/mo · 6/wk
Author
jordimanyer
License
MIT
Types
extension
Size
51.4 KB
Dependencies
0 dependencies · 3 peers
Pi manifest JSON
{
  "extensions": [
    "./extensions"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

pi-julia

A pi extension that eliminates Julia's TTFX (time-to-first-execution) problem and brings full code intelligence to LLM-driven Julia workflows.

It runs two background services:

  • DaemonMode.jl — a persistent warm Julia process so the agent can execute code without paying compilation cost on every call.
  • LanguageServer.jl — a full LSP server for hover docs, diagnostics, completions, and go-to-definition.

Requirements

  • Julia ≥ 1.9
  • pi installed

Installation

pi install pi-julia

On first use, pi-julia will automatically install DaemonMode.jl into Julia's global environment. This is a one-time step and does not touch your project's Project.toml. LanguageServer.jl is resolved from your VS Code Julia extension if installed, or installed into the global environment otherwise.

Usage

Start both servers for a project:

/julia-start /path/to/project

Or pass no path to auto-detect the nearest Project.toml, falling back to Julia's global environment if none is found:

/julia-start

Stop both servers:

/julia-stop

Once started, the agent has access to these tools:

Tool Description
julia_start Start (or restart) both servers
julia_stop Stop both servers
julia_run_file Execute a .jl file via DaemonMode (no TTFX)
julia_run_expr Execute a Julia code block via DaemonMode (no TTFX)
julia_doc Fetch a docstring by symbol name via LSP
julia_hover Docstring and type at a file position via LSP
julia_diagnostics Errors and warnings for a file (or all open files) via LSP
julia_complete Completion suggestions at a file position via LSP
julia_definition Go-to-definition for a symbol via LSP

Configuration

Persist a project path and enable auto-start in ~/.pi/agent/settings.json:

{
  "pi-julia": {
    "projectPath": "/path/to/your/julia/project",
    "autoStart": true
  }
}

How it works

pi-julia
  │
  ├─ DaemonMode server
  │     julia --project=<path> -e 'using Revise; using DaemonMode; serve(<port>)'
  │     port is deterministic per project path — multiple projects run simultaneously
  │
  └─ LanguageServer.jl
        julia --project=<ls-env> -e 'using LanguageServer; runserver(stdin, stdout, <path>)'
        resolves env from VS Code extension, global env, or installs automatically

Revise.jl is loaded on the DaemonMode server so source edits are hot-reloaded without a restart. It is expected to be in your global Julia environment (standard for Julia development).

Limitations

  • ~400 ms overhead per julia_run_* call (Julia client process startup), independent of what the code does.
  • Adding a new package requires restarting the server (/julia-start again), since DaemonMode cannot load new packages into a running process.
  • LanguageServer.jl on Julia 1.12 has a known upstream stability issue (#1366).