Getting Started
SysopKit works with all Node-compatible runtimes. You’ll need Node.js 22+ or Bun (await using requires explicit resource management support), plus an OpenSSH client for remote hosts.
Installation
Section titled “Installation”npm install sysopkitpnpm add sysopkitbun add sysopkitQuick Start
Section titled “Quick Start”Create a file named setup.ts with the following content. It defines a two-host inventory and installs nginx on both machines:
import { apply, task } from 'sysopkit';import { resolveInventory } from 'sysopkit/inventory';import { main } from 'sysopkit/start';import { sudo } from 'sysopkit/middleware/sudo';import { createFile } from 'sysopkit/op/file';import { sh } from 'sysopkit/op/sh';
const INVENTORY = { groups: { web: { hosts: { 'web-1': { host: '192.168.1.10', user: 'sysop' }, 'web-2': { host: '192.168.1.11', user: 'sysop' }, }, }, },};
await main(async () => { await using hosts = resolveInventory(INVENTORY);
await apply('setup nginx', hosts.getByGroup('web'), async () => { await sudo(async () => { await task('install nginx', async () => { await sh('apt install -y nginx'); });
await createFile({ path: '/etc/nginx/sites-available/default', content: 'server { listen 80; }', mode: 0o644, });
await task('enable nginx', async () => { await sh('systemctl enable --now nginx'); }); }); });});Run the script with your preferred runtime:
node setup.tsbun setup.ts