Getting Started
SysopKit works with all Node-compatible runtimes.
Installation
Section titled “Installation”npm install sysopkitpnpm install sysopkitbun install sysopkitQuick Start
Section titled “Quick Start”Create a file setup.ts:
import { apply, task } from 'sysopkit';import { resolveInventory } from 'sysopkit/inventory';import { start } 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 start(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 it:
node setup.tsbun setup.ts