Nodevisor Docs

Introduction

TypeScript-first infrastructure automation. No YAML. No config files. Just code.

Nodevisor

Automate any server with TypeScript. No YAML, no config files — just code.

npm install nodevisor
import $ from 'nodevisor';

const $server = $.connect({ host: '10.0.0.10', username: 'root' });
await $server`apt-get update`.quiet();

Why Nodevisor?

  • TypeScript Native — Full IDE support, autocomplete, and type safety. Use real code — loops, async/await, npm packages — not YAML.
  • Deploy to Your Servers — Define your production stack in TypeScript. Deploy Docker clusters with Traefik, Postgres, and your app to any server.
  • Agentless — Connects over SSH with nothing to install on remote servers. No daemons, no agents — just a standard SSH server.
  • Cross-Platform — One API for Linux, macOS, and Windows. Modules auto-detect OS differences — apt, yum, brew, or winget.
  • Safe by Default — Template literal variables are automatically escaped, preventing shell injection.

How It Works

The $ function is a shell proxy. Use template literals to run commands:

import $ from 'nodevisor';

// Local
const hostname = await $`hostname`.text();

// Remote — same API, just add a connection
const $remote = $.connect({ host: '10.0.0.10', username: 'root' });
const remoteHostname = await $remote`hostname`.text();

Modules give you typed APIs for system management:

import $, { Packages, Users, UFW, Docker, endpoints } from 'nodevisor';

const $server = $.connect({ host: '10.0.0.10', username: 'root' });

await $server(Packages).install(['curl', 'git']);
await $server(Users).add('runner');
await $server(UFW).allow([endpoints.ssh, endpoints.web]);
await $server(Docker).install();

// Switch user context without a new connection
const $runner = $server.as('runner');
await $runner`whoami`.text(); // "runner"

Quick Reference

// Shell commands
await $`ls -la`.text();
await $`cat config.json`.json();
await $`grep error /var/log/syslog`.lines();
await $`test -f /tmp/file`.noThrow().boolean();

// System management
await $(Packages).install('curl');
await $(Users).add('runner');
await $(FS).writeFile('/tmp/config', data);
await $(OS).hostname();

// Security
await $(UFW).allow(endpoints.ssh);
await $(SSH).disablePasswordAuthentication();
await $(AuthorizedKeys).write(publicKey);

// Docker & deployment
await $(Docker).install();
await $(DockerSwarm).start();
await cluster.deploy();

Nodevisor is in active development. APIs may change between minor versions until 1.0.

On this page