Machine

Machines: an always-on computer for agents that should never sleep.

box = noclick.Machine.from_name("support-box", create_if_missing=True, size="medium", region="eu",
                                max_monthly_usd=120)
support = noclick.Agent.from_name("support", create_if_missing=True, instructions="...",
                                  harness="claude_code", model_connection="claude", machine=box)
print(box.exec("df -h /").stdout)

An agent on a machine runs its harness there instead of in a sandbox per conversation: nothing is reaped when it goes quiet, and there's no per-minute sandbox charge, only the machine's flat monthly price. Each conversation gets its own container on the machine, so threads never see each other's files. Model and tool calls go through NoClick's credential proxy with temporary keys: your real keys are never on the machine. NoClick manages its image and updates, restarts it if it fails (rebuilding it on a new host from its last backup if it must), and attached volumes outlive it.

A Linux server you run can be one too, free (Machine.add_own): run the command its pairing shows on the server as root, and your agents run there in containers:

home = noclick.Machine.add_own()
print(home.pairing.command)
# curl -fsSL https://api.noclick.com/machine-agent/v1/machine.sh | sudo sh -s -- --code nc_mach_...
class Machine

Invite-only beta.

An always-on computer of a fixed size in one region, billed a flat monthly price (a thirtieth of it a day while it exists, running or stopped). Agents created with machine run their harness on it, each conversation in a container of its own; exec, files and expose reach the machine itself.

Attributes
idstring
namestring
kindMachineKind

noclick: a machine NoClick runs; own: a server you added.

sizeMachineSizeName | null

Null on your own machine, which is the size its server is.

hostMachineHostName | null

The host it runs on, for its life; null on your own.

cpunumber | null

vCPUs (hardware threads).

memoryGbnumber | null
diskGbnumber | null

Its disk. A larger size on Hetzner keeps the disk it had, so a move back down stays a resize.

osstring | null

The server's system, as it reports it (Ubuntu 24.04.1 LTS).

hostnamestring | null
lastSeenAtDate | null

When it last answered NoClick: on your own machine offline, since when.

maxConversationsnumber | null

Your own machine: the most of its agents' conversations you let work at once (null: what the server takes).

conversationsAtOncenumber | null

How many of its agents' conversations work at once.

agentSharenumber | null

Your own machine: the part of its CPUs and memory its agents use (0.75 by default); the rest stays yours.

agentShareFixedboolean | null

True on a Mac once NoClick's VM is made: a VM keeps its size.

dockerboolean

Your own machine: whether its agents' containers run Docker (any appTesting but never).

appTestingAppTesting

Your own machine: whether its agents run apps and test databases (AppTesting); never on one NoClick runs.

agentsEnabledboolean | null

Whether agents run on machines on this API yet (Machine.agentsEnabledHere()).

regionRegionName | null

The region it runs in, fixed when it was created.

statusMachineStatus
statusReasonstring | null

Why it's stopped or failed, or why it restarted.

monthlyUsdnumber | null

What it costs a month, in US dollars, running or stopped (0 for your own).

maxMonthlyUsdnumber | null

The most you agreed it may cost a month.

networkboolean | string[] | null

What its own commands may reach: true (anywhere the machines usage policy allows) or the hosts.

volumesRecord<string, string>

The volumes it mounts: { path: volume id }.

agentCountnumber | null

How many agents run on it.

workingCountnumber | null

How many of its agents are working now, from its last check-in.

agentStatesMachineAgentState[]

Each agent on it, {agent_id, working}: working while one of its conversations there is.

spentUsdThisMonthnumber | null

What it was charged this month (UTC) so far, in US dollars.

startedAtDate | null

When it last booted, while it runs: its uptime.

pending{ size: MachineSizeName; move: boolean } | null

While updating: the size it becomes, and whether it moves to a new host for it.

imagestring | null

The NoClick-managed image it runs, with its harness versions.

restartsnumber | null

How many times it restarted after failing, ever.

lastRestartAtDate | null
userIdstring | null
createdAtDate | null
filesMachineFiles
healthMachineHealth | null

How hard it works, from its last check-in while it runs; null otherwise.

portsMachinePort[]

The ports it serves.

pairingMachinePairing | null

Your own machine until its server is set up; null after, and on a machine NoClick runs.

consoleUrlstring | null

This machine in the developer console (null off the hosted API).

Types
/** `noclick`: a machine NoClick runs, at a monthly price. `own`: a server you added, free. */
type MachineKind = "noclick" | "own";

/** `xlarge` is Hetzner's alone, so it runs only in `eu`. */
type MachineSizeName = "small" | "medium" | "large" | "xlarge";

/** The host a machine runs on, for its life. */
type MachineHostName = "hetzner" | "digitalocean";

/**
 * How a coding agent may turn app testing on (Docker in its sandbox, for a task that runs the app or its tests against
 * a real database): `by_itself` turns it on when a task needs it and off once it's done, saying each in its chat;
 * `ask_first` asks the account's owner in the chat each time; `never`.
 */
type AppTesting = "by_itself" | "ask_first" | "never";

type RegionName = "us-east" | "us-west" | "eu" | "ap" | "in";

/** `awaiting_approval`: rented while NoClick reviews the account's company; it starts once that's approved. */
type MachineStatus =
  | "awaiting_approval" | "provisioning" | "running" | "offline" | "restarting" | "updating" | "stopped" | "failed";

/** Each agent on a machine: working while one of its conversations there is. */
interface MachineAgentState {
  agentId: string;
  working: boolean;
}

sizesstatic

static sizes(
  options?: {
    region?: RegionName;
    includeDominated?: boolean;
    client?: NoClick;
  },
): Promise<MachineSize[]>

The sizes worth buying now, smallest first: size first, each at its cheapest anywhere (its region, host, diskGb and monthlyUsd), or as bought in region (regions()), with every region it can be bought in now, cheapest first (regions). A size that can't be bought now is left out, as is one where another that can be bought has at least its vCPUs and memory for no more (judged across every region, or in region; a larger disk alone doesn't count); includeDominated lists every size, each with available and dominatedBy.

const [size] = await Machine.sizes();
await Machine.create("support-box", { size: size.name, region: size.region!, host: size.host!, maxMonthlyUsd: size.monthlyUsd });
Parameters
options.regionRegionName
options.includeDominatedboolean
options.clientNoClick

The client to send with; defaults to the module client built from NOCLICK_API_KEY.

Returns

Each size's name (what size= takes), its processors and memory, about how many conversations can work on it at once, and its cheapest offer now: the region, the host it would go on and its disk_gb and monthly_usd there. regions lists every region it can be bought in now, cheapest first, and hosts each host that runs it here. Stock is read at most a minute before; create checks again.

Types
type RegionName = "us-east" | "us-west" | "eu" | "ap" | "in";

createstatic

static create(
  name: string,
  options: MachineCreateOptions & AllowExisting,
): Promise<Machine>

Start an always-on machine called name (unique to its user; a taken name throws Conflict with existingId, or with allowExisting: true returns the machine already there, as it is: nothing about it changes), refused with PriceExceeded if its size costs more than maxMonthlyUsd on the host it goes on: the cheapest host with stock for it in its region, or host when one is named. An account's first machine needs its company vetted by NoClick: its owner asks in the developer console (Resources, Machines), saying what its machines will run, and until NoClick approves it this throws ActionRequired, whose nextStep links that page.

Parameters
namestringrequired
options.sizeMachineSizeName

One of Machine.sizes(); small by default.

(default "small")
options.regionRegionName

Where it runs (regions()), for good; omitted, your account's default region, else us-east.

options.volumesRecord<string, VolumeRef>

Volumes it attaches, by absolute path: each conversation sees a volume as it was when its turn started and saves its writes when the turn ends.

options.networkboolean | string[]

What the machine's own commands may reach: true (anywhere the machines usage policy allows: no mail ports, mining pools or private addresses) or a list of hosts (HTTPS to them, "*.github.com" for subdomains, and name lookups).

options.maxMonthlyUsdnumberrequired

The most its size may cost a month on the host it goes on; above it nothing starts (PriceExceeded, naming the host and its price when only a dearer host has stock).

options.hostMachineHostName

The host to put it on, for its life. Omitted, the cheapest host that runs the size in the region and has stock (Hetzner in eu, DigitalOcean everywhere: Machine.sizes()), never one costing more than maxMonthlyUsd.

options.allowExistingboolean

A taken name returns the object already there, as it is: nothing about it changes.

options.userUserOption

undefined = the ambient user (asUser), null = the account itself.

(defaults to the current user)
options.clientNoClick

The client to send with; defaults to the module client built from NOCLICK_API_KEY.

Returns

The machine, provisioning until it's ready (running).

Types
/** `xlarge` is Hetzner's alone, so it runs only in `eu`. */
type MachineSizeName = "small" | "medium" | "large" | "xlarge";

type RegionName = "us-east" | "us-west" | "eu" | "ap" | "in";

/** A volume to mount: a `Volume`, its id, or its name (the user's own, else the account's). */
type VolumeRef = string | Volume;

/** The host a machine runs on, for its life. */
type MachineHostName = "hetzner" | "digitalocean";

/** `undefined` = the ambient user (from `asUser`), `null` = the account itself. */
type UserOption = UserRef | null | undefined;

/** A `User` or your own id for the user. */
type UserRef = string | UserLike;

/** Anything that can name a user lazily (a `User`). */
interface UserLike {
  _userId(): Promise<string>;
}

addOwnstatic

static addOwn(options?: MachineAddOwnOptions): Promise<Machine>

Add a Linux server you run (x86-64 or ARM64, with sudo) as a machine your account's agents run on, in containers: free, its agents' model calls at cost. Its containers can't reach its network, and on the server itself NoClick only opens the account owner's shell and files, as its noclick user. Run pairing.command on it as root within 30 minutes; it's provisioning until the server answers, then running, and offline while it's silent (its agents' turns fail then). Called again before a server pairs, it returns that same machine, with its code while the code is good and a new one once it expired: add one per server, after the last one paired. The account's only: not for asUser.

Parameters
options.namestring

Omitted, it takes the server's hostname when its installer runs.

options.maxConversationsnumber

How many of its agents' conversations may work at once, at most what the server takes.

options.agentSharenumber

The part of the server its agents use, 0.1 to 1: 0.75 by default, 1 for a server just for NoClick. On a Mac, NoClick's VM is made that size.

options.dockerboolean

Sent alone, true chooses appTesting: "by_itself" and false "never".

options.appTestingAppTesting

Whether its agents run apps and test databases (AppTesting): ask_first unless it says (each agent asks its owner in the chat first). Each conversation's container then runs its own Docker, inside the container's gVisor sandbox (no host socket, nothing privileged on the server); a container whose agent's network is limited runs without it. An agent on it gets the stricter of this and its own appTesting.

options.clientNoClick

The client to send with; defaults to the module client built from NOCLICK_API_KEY.

options.userUserOption

undefined = the ambient user (asUser), null = the account itself.

Returns

The machine, provisioning until the server answers, then running (offline while it's silent: its agents' turns fail then), with its pairing.

Types
/**
 * How a coding agent may turn app testing on (Docker in its sandbox, for a task that runs the app or its tests against
 * a real database): `by_itself` turns it on when a task needs it and off once it's done, saying each in its chat;
 * `ask_first` asks the account's owner in the chat each time; `never`.
 */
type AppTesting = "by_itself" | "ask_first" | "never";

/** `undefined` = the ambient user (from `asUser`), `null` = the account itself. */
type UserOption = UserRef | null | undefined;

/** A `User` or your own id for the user. */
type UserRef = string | UserLike;

/** Anything that can name a user lazily (a `User`). */
interface UserLike {
  _userId(): Promise<string>;
}

agentsEnabledHerestatic

static agentsEnabledHere(options?: { client?: NoClick }): Promise<boolean>

Whether agents run on machines on this API yet. Until they do, an agent isn't put on a machine and your own server isn't added (NotAvailable), and each machine reads agentsEnabled false.

Parameters
options.clientNoClick

The client to send with; defaults to the module client built from NOCLICK_API_KEY.

Returns

True once agents run on machines here.

fromNamestatic

static fromName(
  name: string,
  options?: CallOptions & Partial<MachineCreateOptions> & {
    createIfMissing?: boolean;
  },
): Machine

A lazy reference to the machine called name. Given fields, it gets the machine and sets the size, volumes, network and maxMonthlyUsd you pass, on every run (a new size restarts it, judged against the maxMonthlyUsd set with it). Fields left out are never changed. Its region and host are fixed: an existing machine in another throws Conflict naming it. createIfMissing (with maxMonthlyUsd) starts it when there's none; without it, a missing machine throws NotFound.

Parameters
namestringrequired
options.createIfMissingboolean
options.sizeMachineSizeName

One of Machine.sizes(); small by default.

options.regionRegionName

Where it runs (regions()), for good; omitted, your account's default region, else us-east.

options.volumesRecord<string, VolumeRef>

Volumes it attaches, by absolute path: each conversation sees a volume as it was when its turn started and saves its writes when the turn ends.

options.networkboolean | string[]

What the machine's own commands may reach: true (anywhere the machines usage policy allows: no mail ports, mining pools or private addresses) or a list of hosts (HTTPS to them, "*.github.com" for subdomains, and name lookups).

options.maxMonthlyUsdnumber

The most its size may cost a month on the host it goes on; above it nothing starts (PriceExceeded, naming the host and its price when only a dearer host has stock).

options.hostMachineHostName

The host to put it on, for its life. Omitted, the cheapest host that runs the size in the region and has stock (Hetzner in eu, DigitalOcean everywhere: Machine.sizes()), never one costing more than maxMonthlyUsd.

options.userUserOption

undefined = the ambient user (asUser), null = the account itself.

(defaults to the current user)
options.clientNoClick

The client to send with; defaults to the module client built from NOCLICK_API_KEY.

Returns

A machine that loads (or is started, or has your fields set) the first time it's used. Nothing is sent yet.

Types
/** `undefined` = the ambient user (from `asUser`), `null` = the account itself. */
type UserOption = UserRef | null | undefined;

/** A `User` or your own id for the user. */
type UserRef = string | UserLike;

/** Anything that can name a user lazily (a `User`). */
interface UserLike {
  _userId(): Promise<string>;
}

/** `xlarge` is Hetzner's alone, so it runs only in `eu`. */
type MachineSizeName = "small" | "medium" | "large" | "xlarge";

type RegionName = "us-east" | "us-west" | "eu" | "ap" | "in";

/** A volume to mount: a `Volume`, its id, or its name (the user's own, else the account's). */
type VolumeRef = string | Volume;

/** The host a machine runs on, for its life. */
type MachineHostName = "hetzner" | "digitalocean";

fromIdstatic

static fromId(machineId: string, options?: CallOptions): Machine

A lazy reference to a machine by id.

Parameters
machineIdstringrequired
options.clientNoClick

The client to send with; defaults to the module client built from NOCLICK_API_KEY.

options.userUserOption

undefined = the ambient user (asUser), null = the account itself.

(defaults to the current user)
Returns

A machine that loads the first time you read a field. Nothing is sent yet.

Types
/** `undefined` = the ambient user (from `asUser`), `null` = the account itself. */
type UserOption = UserRef | null | undefined;

/** A `User` or your own id for the user. */
type UserRef = string | UserLike;

/** Anything that can name a user lazily (a `User`). */
interface UserLike {
  _userId(): Promise<string>;
}

getstatic

static get(machineId: string, options?: CallOptions): Promise<Machine>

Load a machine by id now; an unknown id raises noclick.NotFound.

Parameters
machineIdstringrequired
options.userUserOption

undefined = the ambient user (asUser), null = the account itself.

(defaults to the current user)
options.clientNoClick

The client to send with; defaults to the module client built from NOCLICK_API_KEY.

Returns

The machine, loaded.

Types
/** `undefined` = the ambient user (from `asUser`), `null` = the account itself. */
type UserOption = UserRef | null | undefined;

/** A `User` or your own id for the user. */
type UserRef = string | UserLike;

/** Anything that can name a user lazily (a `User`). */
interface UserLike {
  _userId(): Promise<string>;
}

liststatic

static list(
  options?: ReadOptions & { limit?: number; kind?: MachineKind },
): Promise<Machine[]>

The current user's machines (the account's own outside asUser, or those userFilter covers); kind narrows them.

Parameters
options.kindMachineKind
options.limitnumber

Return at most this many.

options.userFilterUserFilter

Which users the read covers (user_id query), instead of acting as one (user).

options.userUserOption

undefined = the ambient user (asUser), null = the account itself.

(defaults to the current user)
options.clientNoClick

The client to send with; defaults to the module client built from NOCLICK_API_KEY.

Returns

Every matching machine, newest first, fetched page by page.

Types
/**
 * Which users a read covers: `ALL_USERS`, `NO_USER`, a `User` or your id for one. Sent as the
 * `user_id` query parameter, never as the `NoClick-User` header, so it filters without acting as the user.
 */
type UserFilter = typeof ALL_USERS | typeof NO_USER | UserRef;

/** A `User` or your own id for the user. */
type UserRef = string | UserLike;

/** Anything that can name a user lazily (a `User`). */
interface UserLike {
  _userId(): Promise<string>;
}

/** `undefined` = the ambient user (from `asUser`), `null` = the account itself. */
type UserOption = UserRef | null | undefined;

/** `noclick`: a machine NoClick runs, at a monthly price. `own`: a server you added, free. */
type MachineKind = "noclick" | "own";

listPagestatic

static listPage(
  options?: ReadOptions & PageOptions & { kind?: MachineKind },
): Promise<Page<Machine>>

One page of machines; pass nextCursor back as cursor.

Parameters
options.kindMachineKind
options.cursorstring | null

The next_cursor of the page before; omit it for the first page.

options.limitnumber

Return at most this many.

options.userFilterUserFilter

Which users the read covers (user_id query), instead of acting as one (user).

options.userUserOption

undefined = the ambient user (asUser), null = the account itself.

(defaults to the current user)
options.clientNoClick

The client to send with; defaults to the module client built from NOCLICK_API_KEY.

Returns

A page whose data holds the machines and whose next_cursor is None on the last page.

Types
/**
 * Which users a read covers: `ALL_USERS`, `NO_USER`, a `User` or your id for one. Sent as the
 * `user_id` query parameter, never as the `NoClick-User` header, so it filters without acting as the user.
 */
type UserFilter = typeof ALL_USERS | typeof NO_USER | UserRef;

/** A `User` or your own id for the user. */
type UserRef = string | UserLike;

/** Anything that can name a user lazily (a `User`). */
interface UserLike {
  _userId(): Promise<string>;
}

/** `undefined` = the ambient user (from `asUser`), `null` = the account itself. */
type UserOption = UserRef | null | undefined;

/** `noclick`: a machine NoClick runs, at a monthly price. `own`: a server you added, free. */
type MachineKind = "noclick" | "own";

exec

exec(
  command: string,
  options: ExecOptions & { background: true },
): Promise<Operation<ExecResult>>

Run a shell command on the machine itself (not in a conversation's container): timeoutS is 60 by default, at most 90; { background: true } returns an Operation, for up to an hour.

Parameters
commandstringrequired
options.backgroundbooleanrequired

Return at once with an Operation whose wait() resolves to the ExecResult.

options.timeoutSnumber

Seconds before the command is stopped: 60 by default, at most 90, or 3600 with background.

Returns

What the command printed and how it exited, or with background=True an Operation whose wait() gives that result.

expose

expose(port: number, options?: { public?: boolean }): Promise<MachinePort>

Serve port at an HTTPS URL on NoClick's domain: private (an API key with the machines scope, which the app never sees) unless public.

Parameters
portnumberrequired
options.publicbooleandefault false
Returns

The port's url.

closePort

closePort(port: number): Promise<void>

Stop serving port; its URL stops answering.

Parameters
portnumberrequired

agents

agents(): Promise<JsonObject[]>

The agents that run on it, as their API rows (Agent.fromId(row.id) for the object).

Returns

Each Agent, loaded.

Types
type JsonObject = { [key: string]: unknown };

update

update(
  changes: {
    name?: string;
    size?: MachineSizeName;
    volumes?: Record<string, VolumeRef>;
    network?: boolean | string[];
    maxMonthlyUsd?: number;
    maxConversations?: number | null;
    agentShare?: number | null;
    docker?: boolean;
    appTesting?: AppTesting;;
  },
): Promise<this>

Rename it, change its size, volumes, network or price ceiling. New volumes and network apply without a restart (each conversation's from its next turn). A larger size restarts it once running turns finish (updating); the new price, its host's, applies from the next day. A size stays on the machine's host. A smaller disk moves a running machine to a new host (a larger size on Hetzner keeps its disk, so moving back down stays a resize), since no host shrinks a disk in place: its user's home is copied over and each conversation loads its files from where they're saved, a longer restart (what's on its disk must fit the smaller one; a move that fails leaves it on its old host). Your own machine takes maxConversations, agentShare, appTesting and docker instead of a size or a price; its server takes them within seconds, each conversation's container at its next start.

Parameters
changes{ name?: string; size?: MachineSizeName; volumes?: Record<string, VolumeRef>; network?: boolean | string[]; maxMonthlyUsd?: number; maxConversations?: number | null; agentShare?: number | null; docker?: boolean; appTesting?: AppTesting; }required
Returns

This machine, updated.

Types
/** `xlarge` is Hetzner's alone, so it runs only in `eu`. */
type MachineSizeName = "small" | "medium" | "large" | "xlarge";

/** A volume to mount: a `Volume`, its id, or its name (the user's own, else the account's). */
type VolumeRef = string | Volume;

/**
 * How a coding agent may turn app testing on (Docker in its sandbox, for a task that runs the app or its tests against
 * a real database): `by_itself` turns it on when a task needs it and off once it's done, saying each in its chat;
 * `ask_first` asks the account's owner in the chat each time; `never`.
 */
type AppTesting = "by_itself" | "ask_first" | "never";

newPairingCode

newPairingCode(): Promise<this>

Your own machine, until its server is set up: a new code (and command) in place of the last one.

Returns

This machine, with the new pairing.

restart

restart(): Promise<Operation<Machine>>

Restart it now (running turns fail as interrupted); its disk and volumes are kept and a machine.restarted event follows. Resolves to the machine.

Returns

An Operation whose wait() gives the machine, running again.

stop

stop(): Promise<this>

Stop it: its agents take no turns until start(). It's still charged.

Returns

This machine, stopped.

start

start(): Promise<this>

Start a stopped machine. One stopped because the balance couldn't pay it is charged what it owes first (PaymentRequired while it can't).

Returns

This machine, provisioning until it's running.

shell

shell(): Promise<MachineShell>

Open a shell (bash -l) on this machine, as its user, in its home: for the account's owner, with its secret key or signed in, while it's running. Your own machine's too (on a Mac, in NoClick's VM there). Hand url and token to a browser terminal.

Returns

The websocket's url and its single-use token (good for two minutes): hand them to a browser terminal (xterm.js) from your server.

delete

delete(): Promise<void>

Delete it with its disk (attached volumes stay); the agents on it go back to their own cloud sandboxes first, each from its next turn. Your own machine is removed from NoClick, which uninstalls itself from the server when it next answers.

MachineSizeinvite-only beta

interface MachineSize

Invite-only beta. One of Machine.sizes(): its processors and memory, and how it's bought now. region, host, diskGb and monthlyUsd are its cheapest offer anywhere (or, asked about a region, there); regions lists every region it can be bought in now, cheapest first, and hosts each host that runs it. Stock is read at most a minute before; create checks again, so pass region, host and monthlyUsd (as maxMonthlyUsd) to buy exactly this.

Attributes
nameMachineSizeName

What size= takes: small, medium, large or xlarge (Hetzner's alone, so in eu only).

cpunumber

vCPUs (hardware threads), as hosts sell them.

memoryGbnumber
diskGbnumber

The machine's own disk on host (while it isn't available, on the first host that sells it).

monthlyUsdnumber

Its price per month in US dollars on host in region (while it isn't available, the price it has once the first host that sells it has one again).

workingConversationsnumber

About how many coding-agent conversations can work on it at the same moment.

availableboolean

Whether it can be bought now (only false with includeDominated).

regionRegionName | null

Where it's cheapest now (your account's default region first at one price), or the region asked about; null when it can't be bought anywhere.

hostMachineHostName | null

The host a new one would go on there now; null while it can't be bought.

dominatedByMachineSizeName | null

A size that can be bought now with at least its vCPUs and memory for no more (only listed with includeDominated).

regionsMachineSizeRegion[]

Each region it can be bought in now, cheapest first: the host, disk and price there.

hostsMachineHost[]

Each host that runs it, cheapest first: its regions, disk and price there.

rawJsonObject

The response JSON exactly as the API sent it.

Types
/** `xlarge` is Hetzner's alone, so it runs only in `eu`. */
type MachineSizeName = "small" | "medium" | "large" | "xlarge";

type RegionName = "us-east" | "us-west" | "eu" | "ap" | "in";

/** The host a machine runs on, for its life. */
type MachineHostName = "hetzner" | "digitalocean";

type JsonObject = { [key: string]: unknown };

MachineSizeRegioninvite-only beta

interface MachineSizeRegion

Invite-only beta. A region a size can be bought in now (MachineSize.regions, cheapest first): the host a new one would go on there, and its disk and flat monthly price there.

Attributes
regionRegionName

What create takes as region.

hostMachineHostName

The host a new one would go on there now: what create takes as host.

diskGbnumber

Its disk on that host.

monthlyUsdnumber

Its price per month in US dollars on that host: what create takes as maxMonthlyUsd.

dominatedByMachineSizeName | null

A size that can be bought there now with at least its vCPUs and memory for no more, which makes this one no buy there (only listed with includeDominated).

Types
type RegionName = "us-east" | "us-west" | "eu" | "ap" | "in";

/** The host a machine runs on, for its life. */
type MachineHostName = "hetzner" | "digitalocean";

/** `xlarge` is Hetzner's alone, so it runs only in `eu`. */
type MachineSizeName = "small" | "medium" | "large" | "xlarge";

MachineHostinvite-only beta

interface MachineHost

Invite-only beta. A size on one host (MachineSize.hosts): where it runs, its disk there and its price there.

Attributes
hostMachineHostName

What host= takes: hetzner or digitalocean.

regionsRegionName[]

The regions it runs in on this host (regions()).

diskGbnumber
monthlyUsdnumber

Its price per month in US dollars on this host, whatever it runs and whether it's busy.

Types
/** The host a machine runs on, for its life. */
type MachineHostName = "hetzner" | "digitalocean";

type RegionName = "us-east" | "us-west" | "eu" | "ap" | "in";

MachinePortinvite-only beta

interface MachinePort

Invite-only beta. A port a machine serves; a private one asks for an API key with the machines scope, a public one answers anyone.

Attributes
portnumber
urlstring
publicboolean
rawJsonObject

The response JSON exactly as the API sent it.

Types
type JsonObject = { [key: string]: unknown };

MachinePairinginvite-only beta

interface MachinePairing

Your own machine until its server is set up: the one-time code (and the command carrying it), which NoClick only shows as it makes it, so a machine read again has code and command null.

Attributes
codestring | null
commandstring | null

What to run on the server as root (a Linux server's, or a Linux distro's in WSL on Windows).

expiresAtDate | null

When the code stops working (30 minutes after it was made); newPairingCode() makes another.

installingOnstring | null

The server being set up with the code, once its installer started.

rawJsonObject

The response JSON exactly as the API sent it.

refusedMachineRefusal | null

The last server turned away with the code, and why (null since the code was made, or once one pairs).

commands{ linux: string; mac: string; linuxUnattended: string; macUnattended: string } | null

The command for each system: linux (command) and mac, run in Terminal as you, never root; and each with --yes to install unattended (SSH, cloud-init, a script): linuxUnattended, macUnattended.

Types
type JsonObject = { [key: string]: unknown };

MachineRefusalinvite-only beta

interface MachineRefusal

A server turned away with your own machine's code: by NoClick (its system, or the code expired) or by the installer itself. Cleared by a new code or a server that pairs.

Attributes
systemstring | null
archstring | null
hostnamestring | null
messagestring

What the server's terminal printed, whole.

nextStepstring | null

What to do, where NoClick knows it.

atDate | null
rawJsonObject

The response JSON exactly as the API sent it.

Types
type JsonObject = { [key: string]: unknown };

MachineFilesinvite-only beta

class MachineFiles

Invite-only beta. machine.files: read and write files on the machine's own disk.

write

write(
  path: string,
  data: string | Uint8Array | ArrayBuffer | Blob,
): Promise<void>

Write data (bytes, or text as UTF-8) to path (relative paths are under /home/noclick).

Parameters
pathstringrequired
datastring | Uint8Array | ArrayBuffer | Blobrequired

read

read(path: string): Promise<Uint8Array>

Read the file at path; a missing file raises noclick.NotFound.

Parameters
pathstringrequired
Returns

The file's bytes, exactly as stored.

list

list(path?): Promise<MachineFileEntry[]>

The files and folders in the folder at path (relative paths are under /home/noclick), by name.

Parameters
pathstringdefault "/home/noclick"
Returns

Each entry's path, type (file or directory), size and updated_at.

MachineFileEntryinvite-only beta

interface MachineFileEntry

A file or folder on a machine's disk (machine.files.list).

Attributes
pathstring
type"file" | "directory"

file or directory.

sizenumber | null

A file's bytes (null for a folder).

updatedAtDate | null

MachineHealthinvite-only beta

interface MachineHealth

How hard a running machine works, from its last check-in (machine.lastSeenAt).

Attributes
cpusnumber | null

Its vCPUs (your own: the server's).

load1mnumber

Its one-minute load average, and that as a part of its vCPUs kept busy (at most 100).

cpuPercentnumber | null
memoryUsedGbnumber

Memory in use and in all (your own: the whole server's; its agents use agentShare of it).

memoryTotalGbnumber
diskUsedGbnumber
diskTotalGbnumber

MachineShellinvite-only beta

interface MachineShell

A shell on a machine NoClick runs (machine.shell()): url is a websocket, opened once with token within two minutes, whose first message is {"type": "auth", token, cols, rows}; then binary messages carry what you type and what it prints, a text {"type": "resize", cols, rows} sizes it, and it closes (code 4410) once bash exits, after idleLimitS with nothing typed, or when the socket closes.

Attributes
machineIdstring
urlstring
tokenstring
tokenExpiresAtDate | null
idleLimitSnumber