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

An always-on computer of a fixed size in one region, billed a flat monthly price. 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. status is provisioning, running, restarting, updating, stopped or failed (status_reason says why), or awaiting_approval: rented while NoClick reviews your company, nothing made or charged yet, it starts once that's approved.

kind own is a server you added (Machine.add_own): free, the size the server is, its shell and files as any machine's, its agents in containers only (no exec, ports, restart, stop or start), and offline while it's silent.

Attributes
idstr
namestr
kindstr | None

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

sizestr | None

small, medium, large or xlarge (Machine.sizes()); None on your own, which is the size its server is.

hoststr | None

The host it runs on, hetzner or digitalocean, for its life (None on your own).

cpuint | None

vCPUs (hardware threads).

memory_gbint | None
disk_gbint | None

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

osstr | None

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

hostnamestr | None
last_seen_atAny

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

max_conversationsint | None

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

conversations_at_onceint | None

How many of its agents' conversations work at once.

agent_sharefloat | None

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

agent_share_fixedbool | None

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

dockerbool

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

app_testingstr | None

Your own machine: whether its agents run apps and test databases: by_itself, ask_first (the default: each agent asks its owner first) or never; an agent on it gets the stricter of this and its own app_testing. never on a machine NoClick runs.

agents_enabledbool | None

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

regionstr | None

The region it runs in (noclick.regions()), fixed when it was created.

statusstr | None
status_reasonstr | None

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

monthly_usdfloat | None

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

max_monthly_usdfloat | None

The most you agreed it may cost a month.

networkAny

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

volumesdict[str, str] | None

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

agent_countint | None

How many agents run on it.

working_countint | None

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

agent_stateslist[dict[str, Any]]

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

spent_usd_this_monthfloat | None

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

started_atAny

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

pendingdict[str, Any] | None

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

imagestr | None

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

restartsint | None

How many times it restarted after failing, ever.

last_restart_atAny
user_idstr | None
created_atAny
filesMachineFiles
healthMachineHealth | None

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

portslist[MachinePort]

The ports it serves.

pairingMachinePairing | None

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

console_urlstr | None

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

sizesclassmethodasync

noclick.Machine.sizes(
    *, region=None, include_dominated=False, client=None
) -> list[MachineSize]

The sizes worth buying now, smallest first: size first, each at its cheapest anywhere, or as bought in region (noclick.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). include_dominated=True lists every size, each with available and dominated_by.

Parameters
regionstr | Nonedefault None
include_dominatedbooldefault False
clientClient | None

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

(default None)
Returns
list[MachineSize]

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.

Usage
size = noclick.Machine.sizes()[0]
print(size.name, size.region, size.host, size.monthly_usd)   # small eu hetzner 8.39
box = noclick.Machine.create("support-box", size=size.name, region=size.region, host=size.host,
                             max_monthly_usd=size.monthly_usd)

createclassmethodasync

noclick.Machine.create(
    name, *, size='small', region=None, volumes=None, network=None, max_monthly_usd,
    host=None, allow_existing=False, user=..., client=None
) -> Machine

Start an always-on machine called name (unique to its user; a taken name raises noclick.Conflict with existing_id, or with allow_existing=True returns the machine already there, as it is: nothing about it changes). size is one of Machine.sizes(); region (noclick.regions()) is where it runs, for good, else your account's default region, else us-east. volumes attaches Volumes (or their ids or names) at absolute paths: each conversation sees a volume as it was when its turn started and saves its writes when the turn ends. network is what the machine's own commands may reach: True (the default: anywhere the machines usage policy allows, so no mail ports, mining pools or private addresses) or a list of hosts (HTTPS to them, "*.github.com" for subdomains, and name lookups). It's charged to your account from the day it first runs, a thirtieth of its monthly price a day while it exists, running or stopped, and refused (noclick.PriceExceeded, nothing started) if its size costs more than max_monthly_usd on the host it goes on. It goes on the cheapest host that runs the size in the region and has stock for it (Hetzner in eu, DigitalOcean everywhere; Machine.sizes() lists each host's price and disk), never one costing more than max_monthly_usd: when only a dearer host has stock, that raises noclick.PriceExceeded naming the host and its price. host names one instead (only it is tried). A machine stays on its host for its life. 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 raises noclick.ActionRequired, whose next_step links that page.

Parameters
namestrrequired
sizestrdefault 'small'
regionstr | Nonedefault None
volumesMapping[str, Any] | Nonedefault None
networkbool | list[str] | Nonedefault None
max_monthly_usdfloatrequired
hostLiteral['hetzner', 'digitalocean'] | Nonedefault None
allow_existingbooldefault False
userAny

Who the call acts for. Defaults to the user set by noclick.as_user (none: the account itself).

(defaults to the current user)
clientClient | None

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

(default None)
Returns
Machine

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

Usage

A machine in Europe for a team of agents, with their shared files:

box = noclick.Machine.create(
    "support-box", size="medium", region="eu", max_monthly_usd=120,
    volumes={"/shared": noclick.Volume.from_name("support-kb", create_if_missing=True)},
)
print(box.status, box.monthly_usd)

add_ownclassmethodasync

noclick.Machine.add_own(
    *, name=None, max_conversations=None, agent_share=None, docker=None,
    app_testing=None, client=None
) -> 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. Without name it takes the server's hostname; max_conversations caps how many of its agents' conversations work at once; agent_share is the part of the server they 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); app_testing is whether its agents run apps and test databases ("ask_first" unless it says: each agent asks its owner in the chat first; "by_itself"; "never"), each conversation's container then running its own Docker inside its gVisor sandbox (no host socket, nothing privileged on the server; a container whose agent's network is limited runs without it); docker alone chooses "by_itself" (true) or "never" (false). 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 own, never a user's (as_user doesn't apply).

Parameters
namestr | Nonedefault None
max_conversationsint | Nonedefault None
agent_sharefloat | Nonedefault None
dockerbool | Nonedefault None
app_testingstr | Nonedefault None
clientClient | None

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

(default None)
Returns
Machine

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

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

agents_enabled_hereclassmethodasync

noclick.Machine.agents_enabled_here(*, client=None) -> bool

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 (noclick.NotAvailable), and each machine reads agents_enabled False.

Parameters
clientClient | None

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

(default None)
Returns
bool

True once agents run on machines here.

Usage
if noclick.Machine.agents_enabled_here():
    home = noclick.Machine.add_own()

from_nameclassmethod

noclick.Machine.from_name(
    name, *, create_if_missing=False, size=None, region=None, volumes=None,
    network=None, max_monthly_usd=None, host=None, user=..., client=None
) -> Machine

A lazy reference to the machine called name in the current (or given) user. Given fields, it gets the machine and sets the size, volumes, network and max_monthly_usd you pass, on every run (a new size restarts it, judged against the max_monthly_usd set with it). Fields you leave out are never changed. Its region and host are fixed: an existing machine in another raises noclick.Conflict naming it. create_if_missing=True starts it with the fields create takes when there's none (max_monthly_usd is required then); without it, a missing machine raises noclick.NotFound.

Parameters
namestrrequired
create_if_missingbooldefault False
sizestr | Nonedefault None
regionstr | Nonedefault None
volumesMapping[str, Any] | Nonedefault None
networkbool | list[str] | Nonedefault None
max_monthly_usdfloat | Nonedefault None
hostLiteral['hetzner', 'digitalocean'] | Nonedefault None
userAny

Who the call acts for. Defaults to the user set by noclick.as_user (none: the account itself).

(defaults to the current user)
clientClient | None

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

(default None)
Returns
Machine

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

Usage
box = noclick.Machine.from_name("support-box", create_if_missing=True, size="medium", max_monthly_usd=120)
print(box.status)

from_idclassmethod

noclick.Machine.from_id(machine_id, *, client=None, user=...) -> Machine

A lazy reference to a machine by id.

Parameters
machine_idstrrequired
clientClient | None

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

(default None)
userAny

Who the call acts for. Defaults to the user set by noclick.as_user (none: the account itself).

(defaults to the current user)
Returns
Machine

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

Usage
box = noclick.Machine.from_id("3b9e2c71-4f0d-4a68-9c15-7e2a8d1f6b40")
print(box.exec("uptime").stdout)

getclassmethodasync

noclick.Machine.get(machine_id, *, user=..., client=None) -> Machine

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

Parameters
machine_idstrrequired
userAny

Who the call acts for. Defaults to the user set by noclick.as_user (none: the account itself).

(defaults to the current user)
clientClient | None

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

(default None)
Returns
Machine

The machine, loaded.

Usage
box = noclick.Machine.get("3b9e2c71-4f0d-4a68-9c15-7e2a8d1f6b40")
print(box.name, box.status, box.agent_count)

listclassmethodasync

noclick.Machine.list(
    *, kind=None, limit=None, user_filter=None, user=..., client=None
) -> list[Machine]

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

Parameters
kindstr | Nonedefault None
limitint | None

Return at most this many.

(default None)
user_filterAny

Which users a read covers: noclick.ALL_USERS, noclick.NO_USER, a User, or your id for one. It filters without acting as that user.

(default None)
userAny

Who the call acts for. Defaults to the user set by noclick.as_user (none: the account itself).

(defaults to the current user)
clientClient | None

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

(default None)
Returns
list[Machine]

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

Usage
for box in noclick.Machine.list(user_filter=noclick.ALL_USERS):
    print(box.name, box.region, box.status, box.monthly_usd)
print([box.name for box in noclick.Machine.list(kind="own") if box.status == "offline"])

list_pageclassmethodasync

noclick.Machine.list_page(
    *, kind=None, cursor=None, limit=None, user_filter=None, user=..., client=None
) -> Page

One page of machines; pass next_cursor back as cursor.

Parameters
kindstr | Nonedefault None
cursorstr | None

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

(default None)
limitint | None

Return at most this many.

(default None)
user_filterAny

Which users a read covers: noclick.ALL_USERS, noclick.NO_USER, a User, or your id for one. It filters without acting as that user.

(default None)
userAny

Who the call acts for. Defaults to the user set by noclick.as_user (none: the account itself).

(defaults to the current user)
clientClient | None

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

(default None)
Returns
Page

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

Usage
page = noclick.Machine.list_page(limit=50)
print([box.name for box in page.data], page.next_cursor)

execasync

machine.exec(command, *, background=False, timeout_s=None) -> ExecResult | Operation

Run a shell command on the machine itself (not in a conversation's container) and wait for it: timeout_s is 60 by default, at most 90. background=True runs it as an operation, up to an hour.

Parameters
commandstrrequired
backgroundbooldefault False
timeout_sint | Nonedefault None
Returns
ExecResult | Operation

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

Usage
box = noclick.Machine.from_name("support-box")
print(box.exec("df -h /").stdout)
backup = box.exec("tar czf /shared/backup.tgz /home/noclick", background=True, timeout_s=1800)
print(backup.wait().exit_code)

exposeasync

machine.expose(port, *, public=False) -> MachinePort

Serve port at an HTTPS URL on NoClick's domain: a dashboard or a webhook receiver your agents run. A private port asks for an API key with the machines scope, which the app never sees; public=True answers anyone.

Parameters
portintrequired
publicbooldefault False
Returns
MachinePort

The port's url.

Usage
box = noclick.Machine.from_name("support-box")
dashboard = box.expose(8080)
print(dashboard.url)

close_portasync

machine.close_port(port) -> None

Stop serving port; its URL stops answering.

Parameters
portintrequired
Usage
noclick.Machine.from_name("support-box").close_port(8080)

agentsasync

machine.agents() -> list[Any]

The agents that run on it.

Returns
list[Any]

Each Agent, loaded.

Usage
box = noclick.Machine.from_name("support-box")
print([agent.name for agent in box.agents()])

updateasync

machine.update(
    *, name=..., size=..., volumes=..., network=..., max_monthly_usd=...,
    max_conversations=..., agent_share=..., docker=..., app_testing=...
) -> Machine

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 applies from the next day. A smaller size moves a running machine to a new host, 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 max_conversations (None: what its server takes) agent_share (None: 0.75), app_testing and docker (as in add_own) instead of a size or a price; its server takes them within seconds, each conversation's container at its next start.

Parameters
nameAnyomit to leave it unchanged
sizeAnyomit to leave it unchanged
volumesAnyomit to leave it unchanged
networkAnyomit to leave it unchanged
max_monthly_usdAnyomit to leave it unchanged
max_conversationsAnyomit to leave it unchanged
agent_shareAnyomit to leave it unchanged
dockerAnyomit to leave it unchanged
app_testingAnyomit to leave it unchanged
Returns
Machine

This machine, updated.

Usage
box = noclick.Machine.from_name("support-box")
box.update(size="large", max_monthly_usd=240)

new_pairing_codeasync

machine.new_pairing_code() -> Machine

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

Returns
Machine

This machine, with the new pairing.

Usage
home = noclick.Machine.get("7c1d9a20-2b6f-4e0a-9d51-3f8e6a4b2c10")
print(home.new_pairing_code().pairing.command)

restartasync

machine.restart() -> Operation

Restart it now, without waiting for running turns (they fail as interrupted). Its disk and volumes are kept; a machine.restarted event follows.

Returns
Operation

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

Usage
box = noclick.Machine.from_name("support-box")
print(box.restart().wait().status)   # running

stopasync

machine.stop() -> Machine

Stop it: its agents take no turns (a message raises noclick.NotAvailable) until start(). It's still charged, since it stays yours.

Returns
Machine

This machine, stopped.

Usage
noclick.Machine.from_name("support-box").stop()

startasync

machine.start() -> Machine

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

Returns
Machine

This machine, provisioning until it's running.

Usage
noclick.Machine.from_name("support-box").start()

shellasync

machine.shell() -> 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). noclick machines ssh <name> opens one in your own terminal.

Returns
MachineShell

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

Usage
box = noclick.Machine.from_name("support-box")
opened = box.shell()
send_to_browser(opened.url, opened.token)

deleteasync

machine.delete() -> None

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. The charge stops that day. Your own machine is removed from NoClick, which uninstalls itself from the server when it next answers.

Usage
box = noclick.Machine.from_name("support-box")
moving = box.agents()   # what goes back to sandboxes
box.delete()

MachineSizeinvite-only beta

class MachineSize

One of Machine.sizes(): its processors and memory, and how it's bought now. region, host, disk_gb and monthly_usd 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 monthly_usd (as max_monthly_usd) to buy exactly this.

Attributes
namestr

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

cpuint

vCPUs (hardware threads), as hosts sell them.

memory_gbint
disk_gbint

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

monthly_usdfloat

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).

working_conversationsint

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

availablebool

Whether it can be bought now (only False with include_dominated=True).

regionstr | None

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

hoststr | None

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

dominated_bystr | None

A size that can be bought now with at least its vCPUs and memory for no more (only listed with include_dominated=True); None when there's none.

regionslist[MachineSizeRegion]

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

hostslist[MachineHost]

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

rawdict[str, Any]

The response JSON exactly as the API sent it.

MachineSizeRegioninvite-only beta

class MachineSizeRegion

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
regionstr

The region (noclick.regions()): what create takes as region=.

hoststr

The host a new one would go on there now, hetzner or digitalocean: what create takes as host=.

disk_gbint

Its disk on that host.

monthly_usdfloat

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

dominated_bystr | None

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 include_dominated=True); None when there's none.

MachineHostinvite-only beta

class MachineHost

A size on one host (MachineSize.hosts): where it runs, its disk there and its flat monthly price there.

Attributes
hoststr

What host= takes: hetzner or digitalocean.

regionslist[str]

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

disk_gbint
monthly_usdfloat

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

MachinePortinvite-only beta

class MachinePort

A port a machine serves. url reaches it over HTTPS; a private port asks for an API key with the machines scope (Authorization: Bearer), a public one answers anyone.

Attributes
portint
urlstr
publicbool
rawdict[str, Any]

The response JSON exactly as the API sent it.

MachinePairinginvite-only beta

class MachinePairing

Your own machine until its server is set up: the one-time code and the command that carries it, which NoClick only shows as it makes them (a machine read again has both None), when the code stops working, and the server being set up with it once its installer started.

Attributes
codestr | None
commandstr | None

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

expires_atAny

30 minutes after the code was made; new_pairing_code() makes another.

installing_onstr | None
rawdict[str, Any]

The response JSON exactly as the API sent it.

refusedMachineRefusal | None

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

commandsdict[str, str] | None

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): "linux_unattended", "mac_unattended".

MachineRefusalinvite-only beta

class MachineRefusal

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

Attributes
systemstr | None
archstr | None
hostnamestr | None
messagestr

What the server's terminal printed, whole.

next_stepstr | None

What to do, where NoClick knows it.

atAny
rawdict[str, Any]

The response JSON exactly as the API sent it.

MachineFilesinvite-only beta

class MachineFiles

machine.files: read and write files on the machine's own disk.

writeasync

machine.files.write(path, data) -> None

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

Parameters
pathstrrequired
databytes | strrequired
Usage
box = noclick.Machine.from_name("support-box")
box.files.write("/etc/noclick/notes.md", "Restart the worker after deploys.")

readasync

machine.files.read(path) -> bytes

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

Parameters
pathstrrequired
Returns
bytes

The file's bytes, exactly as stored.

Usage
box = noclick.Machine.from_name("support-box")
print(box.files.read("/var/log/worker.log").decode()[-2000:])

listasync

machine.files.list(path='/home/noclick') -> list[MachineFileEntry]

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

Parameters
pathstrdefault '/home/noclick'
Returns
list[MachineFileEntry]

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

Usage
box = noclick.Machine.from_name("support-box")
for entry in box.files.list("logs"):
    print(entry.type, entry.path, entry.size)

MachineFileEntryinvite-only beta

class MachineFileEntry

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

Attributes
pathstr
typestr

file or directory.

sizeint | None

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

updated_atAny

MachineHealthinvite-only beta

class MachineHealth

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

Attributes
cpusint | None

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

load_1mfloat

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

cpu_percentint | None
memory_used_gbfloat

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

memory_total_gbfloat
disk_used_gbfloat
disk_total_gbfloat

MachineShellinvite-only beta

class MachineShell

A shell on a machine NoClick runs (machine.shell()): url is a websocket, opened once with token within two minutes. Its 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 sends {"type": "ready"} once and {"type": "state", "state": "exited", "reason"} as it closes (code 4410): bash exited, idle_limit_s passed with nothing typed, or the socket closed.

Attributes
machine_idstr
urlstr
tokenstr
token_expires_atAny
idle_limit_sint