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 MachineInvite-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.
- Like every live object, it also has hydrate(), refresh() and raw.
| id | string | |
| name | string | |
| kind | MachineKind |
|
| size | MachineSizeName | null | Null on your own machine, which is the size its server is. |
| host | MachineHostName | null | The host it runs on, for its life; null on your own. |
| cpu | number | null | vCPUs (hardware threads). |
| memoryGb | number | null | |
| diskGb | number | null | Its disk. A larger size on Hetzner keeps the disk it had, so a move back down stays a resize. |
| os | string | null | The server's system, as it reports it ( |
| hostname | string | null | |
| lastSeenAt | Date | null | When it last answered NoClick: on your own machine |
| maxConversations | number | null | Your own machine: the most of its agents' conversations you let work at once (null: what the server takes). |
| conversationsAtOnce | number | null | How many of its agents' conversations work at once. |
| agentShare | number | null | Your own machine: the part of its CPUs and memory its agents use (0.75 by default); the rest stays yours. |
| agentShareFixed | boolean | null | True on a Mac once NoClick's VM is made: a VM keeps its size. |
| docker | boolean | Your own machine: whether its agents' containers run Docker (any |
| appTesting | AppTesting | Your own machine: whether its agents run apps and test databases ( |
| agentsEnabled | boolean | null | Whether agents run on machines on this API yet ( |
| region | RegionName | null | The region it runs in, fixed when it was created. |
| status | MachineStatus | |
| statusReason | string | null | Why it's stopped or failed, or why it restarted. |
| monthlyUsd | number | null | What it costs a month, in US dollars, running or stopped (0 for your own). |
| maxMonthlyUsd | number | null | The most you agreed it may cost a month. |
| network | boolean | string[] | null | What its own commands may reach: |
| volumes | Record<string, string> | The volumes it mounts: |
| agentCount | number | null | How many agents run on it. |
| workingCount | number | null | How many of its agents are working now, from its last check-in. |
| agentStates | MachineAgentState[] | Each agent on it, |
| spentUsdThisMonth | number | null | What it was charged this month (UTC) so far, in US dollars. |
| startedAt | Date | null | When it last booted, while it runs: its uptime. |
| pending | { size: MachineSizeName; move: boolean } | null | While |
| image | string | null | The NoClick-managed image it runs, with its harness versions. |
| restarts | number | null | How many times it restarted after failing, ever. |
| lastRestartAt | Date | null | |
| userId | string | null | |
| createdAt | Date | null | |
| files | MachineFiles | |
| health | MachineHealth | null | How hard it works, from its last check-in while it runs; null otherwise. |
| ports | MachinePort[] | The ports it serves. |
| pairing | MachinePairing | null | Your own machine until its server is set up; null after, and on a machine NoClick runs. |
| consoleUrl | string | null | This machine in the developer console (null off the hosted API). |
/** `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 });The client to send with; defaults to the module client built from NOCLICK_API_KEY.
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.
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.
One of Machine.sizes(); small by default.
"small")Where it runs (regions()), for good; omitted, your account's default region, else us-east.
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.
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).
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).
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.
A taken name returns the object already there, as it is: nothing about it changes.
undefined = the ambient user (asUser), null = the account itself.
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
The machine, provisioning until it's ready (running).
/** `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.
Omitted, it takes the server's hostname when its installer runs.
How many of its agents' conversations may work at once, at most what the server takes.
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.
Sent alone, true chooses appTesting: "by_itself" and false "never".
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.
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
undefined = the ambient user (asUser), null = the account itself.
The machine, provisioning until the server answers, then running
(offline while it's silent: its agents' turns fail then), with its
pairing.
/**
* 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.
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
True once agents run on machines here.
fromNamestatic
static fromName(
name: string,
options?: CallOptions & Partial<MachineCreateOptions> & {
createIfMissing?: boolean;
},
): MachineA 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.
One of Machine.sizes(); small by default.
Where it runs (regions()), for good; omitted, your account's default region, else us-east.
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.
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).
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).
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.
undefined = the ambient user (asUser), null = the account itself.
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
A machine that loads (or is started, or has your fields set) the first time it's used. Nothing is sent yet.
/** `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): MachineA lazy reference to a machine by id.
A machine that loads the first time you read a field. Nothing is sent yet.
/** `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.
The machine, loaded.
/** `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.
Return at most this many.
Which users the read covers (user_id query), instead of acting as one (user).
undefined = the ambient user (asUser), null = the account itself.
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
Every matching machine, newest first, fetched page by page.
/**
* 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.
The next_cursor of the page before; omit it for the first page.
Return at most this many.
Which users the read covers (user_id query), instead of acting as one (user).
undefined = the ambient user (asUser), null = the account itself.
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
A page whose data holds the machines and whose next_cursor is None on the last page.
/**
* 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.
Return at once with an Operation whose wait() resolves to the ExecResult.
Seconds before the command is stopped: 60 by default, at most 90, or 3600 with background.
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.
falseThe port's url.
closePort
closePort(port: number): Promise<void>Stop serving port; its URL stops answering.
agents
agents(): Promise<JsonObject[]>The agents that run on it, as their API rows (Agent.fromId(row.id) for the object).
Each Agent, loaded.
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.
This machine, updated.
/** `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.
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.
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.
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).
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.
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 MachineSizeInvite-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.
| name | MachineSizeName | What |
| cpu | number | vCPUs (hardware threads), as hosts sell them. |
| memoryGb | number | |
| diskGb | number | The machine's own disk on |
| monthlyUsd | number | Its price per month in US dollars on |
| workingConversations | number | About how many coding-agent conversations can work on it at the same moment. |
| available | boolean | Whether it can be bought now (only false with |
| region | RegionName | 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. |
| host | MachineHostName | null | The host a new one would go on there now; null while it can't be bought. |
| dominatedBy | MachineSizeName | null | A size that can be bought now with at least its vCPUs and memory for no more (only listed with |
| regions | MachineSizeRegion[] | Each region it can be bought in now, cheapest first: the host, disk and price there. |
| hosts | MachineHost[] | Each host that runs it, cheapest first: its regions, disk and price there. |
| raw | JsonObject | The response JSON exactly as the API sent it. |
/** `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 MachineSizeRegionInvite-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.
| region | RegionName | What |
| host | MachineHostName | The host a new one would go on there now: what |
| diskGb | number | Its disk on that host. |
| monthlyUsd | number | Its price per month in US dollars on that host: what |
| dominatedBy | MachineSizeName | 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 |
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 MachineHostInvite-only beta. A size on one host (MachineSize.hosts): where it runs, its disk there and its price there.
| host | MachineHostName | What |
| regions | RegionName[] | The regions it runs in on this host ( |
| diskGb | number | |
| monthlyUsd | number | Its price per month in US dollars on this host, whatever it runs and whether it's busy. |
/** 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 MachinePortInvite-only beta. A port a machine serves; a private one asks for an API key with the machines
scope, a public one answers anyone.
| port | number | |
| url | string | |
| public | boolean | |
| raw | JsonObject | The response JSON exactly as the API sent it. |
type JsonObject = { [key: string]: unknown };MachinePairinginvite-only beta
interface MachinePairingYour 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.
| code | string | null | |
| command | string | null | What to run on the server as root (a Linux server's, or a Linux distro's in WSL on Windows). |
| expiresAt | Date | null | When the code stops working (30 minutes after it was made); |
| installingOn | string | null | The server being set up with the code, once its installer started. |
| raw | JsonObject | The response JSON exactly as the API sent it. |
| refused | MachineRefusal | 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: |
type JsonObject = { [key: string]: unknown };MachineRefusalinvite-only beta
interface MachineRefusalA 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.
| system | string | null | |
| arch | string | null | |
| hostname | string | null | |
| message | string | What the server's terminal printed, whole. |
| nextStep | string | null | What to do, where NoClick knows it. |
| at | Date | null | |
| raw | JsonObject | The response JSON exactly as the API sent it. |
type JsonObject = { [key: string]: unknown };MachineFilesinvite-only beta
class MachineFilesInvite-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/).
read
read(path: string): Promise<Uint8Array>Read the file at path; a missing file raises noclick.NotFound.
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/), by name.
"/home/noclick"Each entry's path, type (file or directory), size and updated_at.
MachineFileEntryinvite-only beta
interface MachineFileEntryA file or folder on a machine's disk (machine.files.list).
| path | string | |
| type | "file" | "directory" |
|
| size | number | null | A file's bytes (null for a folder). |
| updatedAt | Date | null |
MachineHealthinvite-only beta
interface MachineHealthHow hard a running machine works, from its last check-in (machine.lastSeenAt).
| cpus | number | null | Its vCPUs (your own: the server's). |
| load1m | number | Its one-minute load average, and that as a part of its vCPUs kept busy (at most 100). |
| cpuPercent | number | null | |
| memoryUsedGb | number | Memory in use and in all (your own: the whole server's; its agents use |
| memoryTotalGb | number | |
| diskUsedGb | number | |
| diskTotalGb | number |
MachineShellinvite-only beta
interface MachineShellA 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.
| machineId | string | |
| url | string | |
| token | string | |
| tokenExpiresAt | Date | null | |
| idleLimitS | number |