Skip to main content
The lsp command manages the Gleeb Language Server Protocol (LSP) server, which provides IDE features like autocomplete, error checking, and code navigation for Fern development.

Usage

fern lsp <command> [options]

Commands

start

Start the Gleeb LSP server:
fern lsp start [options]
--background
flag
Run server in background (daemon mode)
-b
flag
Short form of --background
--port
number
TCP port to listen on (otherwise uses stdio)
Examples:
# Start in foreground (for debugging)
fern lsp start

# Start in background
fern lsp start --background

# Start on specific port
fern lsp start --port 9000 --background

stop

Stop the running LSP server:
fern lsp stop
LSP server stopped

status

Show LSP server status and configuration:
fern lsp status
LSP Server Status
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Gleeb LSP installed: Yes
Server path: ~/.fern/gleeb/dist/server.js
Server running: Yes
Process ID: 12345
VS Code configured: Yes
Node.js available: Yes

config

Configure editor integration:
fern lsp config [options]
--editor
string
default:"vscode"
Editor to configure (currently only vscode supported)
Example:
fern lsp config --editor vscode
Configuring VS Code for Gleeb LSP...

VS Code configured successfully
Install the 'Gleeb LSP for Fern UI' extension from VS Code marketplace
Extension ID: fernkit.gleeb-lsp

install

Install or reinstall the Gleeb LSP server:
fern lsp install
Installing Gleeb LSP...
Production mode: Cloning from GitHub

Cloning Gleeb LSP from GitHub...
Copying to ~/.fern/gleeb...
Installing dependencies...
Building LSP server...
Created launcher script

Gleeb LSP installed successfully

restart

Restart the LSP server:
fern lsp restart
Equivalent to running stop then start --background.

Installation

The LSP server must be installed before use:
fern lsp install
This:
  1. Clones Gleeb LSP from GitHub (or uses local copy if in development)
  2. Installs Node.js dependencies
  3. Builds the TypeScript source
  4. Creates launcher scripts in ~/.local/bin/

IDE Integration

VS Code

1

Install LSP server

fern lsp install
2

Configure VS Code

fern lsp config --editor vscode
3

Install VS Code extension

Open VS Code and install the “Gleeb LSP for Fern UI” extension:
Ctrl+P → ext install fernkit.gleeb-lsp
4

Start LSP server

fern lsp start --background
The extension provides:
  • Autocomplete - Code completion for Fern APIs
  • Error checking - Real-time syntax and type errors
  • Go to definition - Jump to function/class definitions
  • Hover information - Documentation on hover
  • Code formatting - Automatic code formatting

Manual Configuration

If automatic configuration doesn’t work, add to VS Code settings.json:
{
  "gleeb.enable": true,
  "gleeb.serverPath": "~/.fern/gleeb/dist/server.js",
  "gleeb.trace.server": "verbose"
}

Server Modes

Stdio Mode (Default)

Server communicates over stdin/stdout:
fern lsp start --background
Used by most editors/IDEs.

TCP Mode

Server listens on a network port:
fern lsp start --port 9000 --background
Useful for:
  • Remote development
  • Debugging
  • Multiple client connections

Requirements

The LSP server requires:
  • Node.js (v14 or later)
  • npm (comes with Node.js)
  • Git (for installation)
Check with:
node --version
npm --version
git --version
Install Node.js from nodejs.org if needed.

Server Locations

~/.fern/gleeb/
directory
LSP server installation directory
~/.fern/gleeb/dist/server.js
file
Compiled LSP server executable
~/.fern/gleeb/server.pid
file
Process ID file (when running in background)
~/.local/bin/gleeb-lsp
file
Launcher script for manual server startup

Development Mode

When developing Fern itself:
# Use local Gleeb sources
cd /path/to/fern
fern lsp install  # Detects and uses local gleeb/ directory

# Changes to gleeb/ source
cd gleeb
npm run build

# Restart server to use new build
fern lsp restart

Troubleshooting

fern lsp install
# Error: Node.js not found
Solution: Install Node.js from nodejs.org:
# Ubuntu/Debian
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt-get install -y nodejs

# Fedora
sudo dnf install nodejs
Check the status:
fern lsp status
Try reinstalling:
fern lsp stop
rm -rf ~/.fern/gleeb
fern lsp install
fern lsp start --background
  1. Verify server is running:
    fern lsp status
    
  2. Check VS Code output panel:
    • View → Output
    • Select “Gleeb LSP” from dropdown
  3. Restart VS Code and the LSP server:
    fern lsp restart
    
fern lsp install
# Error: npm run build failed
Solution: Check npm dependencies:
cd ~/.fern/gleeb
rm -rf node_modules package-lock.json
npm install
npm run build

Features

The Gleeb LSP provides:

Code Completion

  • API method suggestions
  • Parameter hints
  • Import suggestions
  • Fern namespace completion

Diagnostics

  • Syntax errors
  • Type errors
  • Undefined reference warnings
  • Best practice suggestions

Code Navigation

  • Go to definition
  • Find references
  • Workspace symbol search
  • Document outline

Documentation

  • Hover documentation
  • Signature help
  • Parameter documentation
  • Example code snippets

Manual Server Control

The LSP can also be started manually:
# Using launcher script
~/.local/bin/gleeb-lsp

# Direct Node.js invocation
cd ~/.fern/gleeb
node dist/server.js --stdio

Logs

View server logs for debugging:
# Foreground mode logs to console
fern lsp start

# Background mode logs to file
tail -f ~/.fern/gleeb/server.log

Updating

To update to the latest version:
# Reinstall from GitHub
fern lsp stop
fern lsp install
fern lsp start --background

Build docs developers (and LLMs) love