Llomiriby hyprr

TypeScript SDK

Pelican.ts, the official TypeScript SDK for lomiri and Pelican.

Pelican.ts is the official TypeScript SDK for lomiri. It covers both public APIs, the client API and the application API, and works the same against Pelican, so one integration serves both panels.

npm install @pelican.ts/sdk

You'll need an API key: a client key from your account page for the client API, or an application key from Admin → API Keys for the application API.

What's inside

PackageWhat it is
@pelican.ts/sdkThe humane client: an object-oriented client where servers, files and backups are objects with methods.
@pelican.ts/sdk/apiThe API client: a thin, stateless wrapper with one method per endpoint and input validation.
@pelican.ts/sdk/typesTypes for every API response.
@pelican.ts/aiEvery client API method as AI SDK tools, for agents.

Humane client

Each method maps to one API endpoint, so each call makes one request, and objects update themselves after every call. It shines for file management: every file knows where it lives and what its parent folder is.

import { createPelicanClient } from "@pelican.ts/sdk"

const client = createPelicanClient("https://panel.example.com", "your-api-key")

// Back up the first server, then restore the backup a minute later.
const servers = await client.listServers()
const server = servers[0]

if (!server.isInstalling && !server.isSuspended) {
  const backup = await server.createBackup({
    name: "first backup",
    is_locked: false,
    ignored_files: ["/dynmap/*"],
  })

  setTimeout(() => backup.restore(), 60_000)
}

Any humane object can also be built from an API client and a raw API object:

import { ServerBackup } from "@pelican.ts/sdk"

const backup = new ServerBackup(serverClient, backupObject)

API client

A functional, stateless wrapper: you get plain data back, and nothing is cached for you.

import { PelicanAPIClient } from "@pelican.ts/sdk/api"

const client = new PelicanAPIClient("https://panel.example.com", "your-api-key")
// Also available from the humane client as createPelicanClient(...).$client

// Fetch a server's database, including its password, then rotate the password.
const servers = await client.listServers()
const serverId = servers[0].identifier // e.g. "babcaed0"

const [db] = await client.server(serverId).databases.list(["password"])
console.log(`Found ${db.name} on ${db.host.address}`)

await client.server(serverId).databases.rotatePassword(db.id)

Types

import type { ApplicationServer, ServerBackup } from "@pelican.ts/sdk/types"

AI tools

@pelican.ts/ai exposes every client API method as tools for the AI SDK, so an agent can manage servers for a user.

npm install @pelican.ts/ai @pelican.ts/sdk ai
import { PelicanAPIClient } from "@pelican.ts/sdk/api"
import { createPelicanClientTools, createPelicanServerTools } from "@pelican.ts/ai"
import { generateText, stepCountIs } from "ai"

const client = new PelicanAPIClient("https://panel.example.com", "your-client-api-key")

// Every client API tool. Server-scoped tools take the server in each call.
const tools = createPelicanClientTools(client, {
  exclude: ["pelican_client_server_settings_reinstall"],
})

// Or bind the tools to one server.
const serverTools = createPelicanServerTools(client, "abc12345")

await generateText({
  model: "anthropic/claude-sonnet-5.5",
  tools: { ...tools, ...serverTools },
  stopWhen: stepCountIs(10),
  prompt: "List my servers and show resource usage for the first one",
})

The tools cover account, API and SSH keys, server info, power, console commands, resources, files, databases, backups, schedules, allocations, subusers, startup, settings and activity. Live console streaming and the application API aren't included.

More in the Pelican.ts repository.

On this page