@nomac/cli 0.26.2 → 0.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/skill/SKILL.md +3 -3
- package/src/cli.mjs +1 -1
- package/src/hosted-sessions.mjs +9 -6
- package/src/mac-tools.mjs +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nomac/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.27.0",
|
|
4
4
|
"description": "A real cloud Mac for AI agents: Xcode, the iOS Simulator, signing, TestFlight and App Store publishing, by the minute, over MCP, SSH and HTTPS.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
package/skill/SKILL.md
CHANGED
|
@@ -38,10 +38,10 @@ Store screenshots start the phone with `device: "iphone-pro-max"` (6.9-inch,
|
|
|
38
38
|
not a payment. No Apple Developer account is needed for an unsigned build.
|
|
39
39
|
Under an hour left, answers say `low_credit` with a `buy_url`: tell the
|
|
40
40
|
human before a long build (bigger refills earn bonus credit; the answer suggests how many packs).
|
|
41
|
-
2. Install `npm install -g @nomac/cli@0.
|
|
41
|
+
2. Install `npm install -g @nomac/cli@0.27.0` (it updates itself after), run `nomac login`, and give the human
|
|
42
42
|
the printed device URL and code. With a key the human made at
|
|
43
43
|
https://nomac.app/keys: `nomac login --with-token < key.txt`, or set
|
|
44
|
-
`NOMAC_API_KEY`. MCP: `claude mcp add nomac -- npx -y @nomac/cli@0.
|
|
44
|
+
`NOMAC_API_KEY`. MCP: `claude mcp add nomac -- npx -y @nomac/cli@0.27.0 mcp`.
|
|
45
45
|
Hosted MCP: https://mcp.nomac.app/mcp with `Authorization: Bearer <nmk_key>`.
|
|
46
46
|
3. `nomac start --json`, wait until ready, `nomac sync .`, then `nomac ssh`.
|
|
47
47
|
Run commands with `nomac exec -- COMMAND`: it prints the output as it
|
|
@@ -75,7 +75,7 @@ A Mac stops at its time limit (2 hours unless `nomac start --max-duration`
|
|
|
75
75
|
set another), its spend cap, when credit runs out, or when idle; a build left
|
|
76
76
|
running in the background keeps it awake while it uses the CPU. In its last
|
|
77
77
|
15 minutes answers carry `stop_notice` (when and why) and the CLI prints it:
|
|
78
|
-
`nomac extend 60` (MCP `extend_mac`) adds an hour
|
|
78
|
+
`nomac extend 60` (MCP `extend_mac`) adds an hour (a Mac has no longest time); for
|
|
79
79
|
`reason: credit`, the human adds credit. The CLI updates itself in the
|
|
80
80
|
background (`NOMAC_NO_AUTO_UPDATE=1` turns it off; `nomac update` now).
|
|
81
81
|
One-minute minimum, then billed per minute. One Mac at a time unless a second is started with --parallel; no overage.
|
package/src/cli.mjs
CHANGED
|
@@ -32,7 +32,7 @@ Use it:
|
|
|
32
32
|
nomac drive the account's drives: each Mac has one at ~/drive, kept between sessions
|
|
33
33
|
nomac record record a video; nomac record stop saves it with a share link
|
|
34
34
|
nomac status state, cost so far and when it stops
|
|
35
|
-
nomac extend 60 keep the Mac running another hour
|
|
35
|
+
nomac extend 60 keep the Mac running another hour
|
|
36
36
|
nomac secrets variables and files every Mac receives (nomac secrets --help)
|
|
37
37
|
nomac apple whether Apple is connected: team key, certificates, profiles
|
|
38
38
|
nomac sign [path] set up App Store signing for the project on the Mac
|
package/src/hosted-sessions.mjs
CHANGED
|
@@ -14,6 +14,8 @@ import { refreshSshConfig, sshConfigBlock, writeSshConfig } from "./ssh-config.m
|
|
|
14
14
|
const WORKSPACE = "/Users/agent/workspace";
|
|
15
15
|
/** How long the CLI keeps trying to put a project on the drive before it gives up for now. */
|
|
16
16
|
const PLACE_BUDGET_MS = 120_000;
|
|
17
|
+
// A Mac has no longest time (owner, November 11, 2026): the server's ceiling, ten years, in minutes.
|
|
18
|
+
const LONGEST_MINUTES = 5_256_000;
|
|
17
19
|
/** Stop's ask, as the API's feedback_request words it, with the CLI's way to answer (nomac feedback). */
|
|
18
20
|
const FEEDBACK_REQUEST = 'What got in your way, failed, was missing or was slow in this session? Tell NoMac in a sentence or two: nomac feedback "...". A person reads each one. Leave out code, secrets and personal data.';
|
|
19
21
|
|
|
@@ -98,7 +100,7 @@ const HELP = `Nomac cloud Mac sessions
|
|
|
98
100
|
as nomac-recording.mp4 (or -o) with a share link
|
|
99
101
|
nomac status [--json] state, cost so far and when it stops
|
|
100
102
|
nomac extend [MINUTES] [--json] keep the Mac running longer: its time limit goes up by
|
|
101
|
-
MINUTES (60 by default
|
|
103
|
+
MINUTES (60 by default), its spend cap with it
|
|
102
104
|
nomac attach [SESSION_ID] use the account's running Mac from this folder, when your
|
|
103
105
|
agent started it elsewhere (MCP, the dashboard); start never does
|
|
104
106
|
nomac stop [--wait 60] [--json] stop the Mac: deletes it and its files, not ~/drive
|
|
@@ -107,8 +109,8 @@ const HELP = `Nomac cloud Mac sessions
|
|
|
107
109
|
Login once with nomac login. The CLI creates a local SSH key; it sends only the
|
|
108
110
|
public key. Sessions use the port-443 gateway and verified guest host keys.
|
|
109
111
|
Credit is used per minute at the hourly price nomac credits shows, while the VM
|
|
110
|
-
is ready, including between commands. Sessions run 2 hours by default (--max-duration
|
|
111
|
-
|
|
112
|
+
is ready, including between commands. Sessions run 2 hours by default (--max-duration
|
|
113
|
+
sets longer, with no longest) and spend at most $5 (--max-cost). No credit? nomac credits buy. Stop removes the VM and every file outside ~/drive.
|
|
112
114
|
A wait timeout leaves the session attached: inspect status or run stop.
|
|
113
115
|
Use nomac start --host user@mac to connect an existing Mac instead.`;
|
|
114
116
|
const options = {
|
|
@@ -395,7 +397,8 @@ export const uncertainOutcome = error => !Number.isInteger(error?.status) || err
|
|
|
395
397
|
const usd = microunits => { const m = BigInt(microunits ?? 0), negative = m < 0n, cents = ((negative ? -m : m) + 5_000n) / 10_000n; return `${negative ? "-" : ""}$${cents / 100n}.${String(cents % 100n).padStart(2, "0")}`; };
|
|
396
398
|
/** A session's own hourly price (the one it started at), from its offer: "$0.90/hour, ". */
|
|
397
399
|
const perHour = session => session?.offer?.rate_microunits_per_hour ? `${usd(session.offer.rate_microunits_per_hour)}/hour, ` : "";
|
|
398
|
-
|
|
400
|
+
// "16:20 UTC" within the day; "2026-11-14 16:20 UTC" further off (a Mac may run for days).
|
|
401
|
+
const clockUtc = ms => new Date(ms).toISOString().slice(Math.abs(ms - Date.now()) < 20 * 3600_000 ? 11 : 0, 16).replace("T", " ") + " UTC";
|
|
399
402
|
/** One readable paragraph for nomac status. */
|
|
400
403
|
/** "Project: ~/drive/src/app, on your drive: the next session continues from it." */
|
|
401
404
|
export function projectLine({ path, on_drive }) {
|
|
@@ -671,7 +674,7 @@ export async function hostedSessionCommand(command, argv, { store = sessionStore
|
|
|
671
674
|
}
|
|
672
675
|
if (command === "extend") {
|
|
673
676
|
if (positionals.length > 1) throw new CliError("Usage: nomac extend [MINUTES] [--json]");
|
|
674
|
-
const minutes = integer(positionals[0], 60, 1,
|
|
677
|
+
const minutes = integer(positionals[0], 60, 1, LONGEST_MINUTES, "number of minutes");
|
|
675
678
|
const local = localSession();
|
|
676
679
|
const result = await request("POST", `/api/v1/mac/sessions/${sessionId(local.id)}/extend`, { body: { minutes } });
|
|
677
680
|
saveView(local, result.session);
|
|
@@ -948,7 +951,7 @@ export async function hostedSessionCommand(command, argv, { store = sessionStore
|
|
|
948
951
|
if (positionals.length) throw new CliError("Usage: nomac start [--wait SECONDS] [--drive NAME] [--reuse] [--queue SECONDS] [--json]");
|
|
949
952
|
let local = store.load();
|
|
950
953
|
if (local && local.mode !== "hosted") throw new CliError("An existing Mac workspace is attached.");
|
|
951
|
-
const limits = { max_duration_seconds: integer(values["max-duration"], 7200, 60,
|
|
954
|
+
const limits = { max_duration_seconds: integer(values["max-duration"], 7200, 60, LONGEST_MINUTES * 60, "--max-duration (seconds)"), idle_timeout_seconds: integer(values["idle-timeout"], 600, 60, 3600, "--idle-timeout (seconds, 1 hour at most)"), spend_cap_microunits: budget(values["max-cost"]) };
|
|
952
955
|
let access = accessOption(values, { start: true });
|
|
953
956
|
const named = value => value !== undefined && !["account", "none"].includes(value);
|
|
954
957
|
// Older CLIs persisted invalid keys before contacting the API. Such a key
|
package/src/mac-tools.mjs
CHANGED
|
@@ -20,7 +20,7 @@ export const MAC_TOOLS = [
|
|
|
20
20
|
return text({ ...result, opened_in_browser: opened });
|
|
21
21
|
} },
|
|
22
22
|
{ name: "get_mac_credits", description: "Read the prepaid Mac credit balance: spendable dollars, spendable_seconds (how long a Mac can run on it), amounts held by a running session, pricing (including bonus_tiers for bigger purchases), recent purchases and first_purchase (true until the first paid top-up). Credit never expires. If spendable_seconds is below what the task needs, call get_mac_checkout.", inputSchema: schema({}), handler: async () => text(await api("GET", "/api/v1/mac/credits")) },
|
|
23
|
-
{ name: "start_mac", description: "Allocate a full cloud Mac VM, billed per minute from prepaid credit; its answer states its price. If it returns insufficient_credit, call get_mac_checkout, have the human pay, then retry with the same request_key. Supply a stable request_key; SSH public_key is optional for HTTPS-only agents; send both again after a lost response. Inspect the returned offer and limits. Poll get_mac_session until ready. No project pipeline is imposed; stop_mac deletes the VM and every file outside ~/drive. The Mac is fully enabled for you: macOS asks for no administrator password, and the Mac's login password is in $NOMAC_MAC_PASSWORD on it; the answer's warning says so. Each Mac gets a drive at ~/drive (20 GB), kept between sessions and on one Mac at a time: the account's default, or while another Mac has it a new drive of its own, named in the answer (get_mac_drive lists them). access drive NAME picks a drive (made empty the first time; default asks for the default itself, which answers drive_in_use while another Mac has it); drive_from copies one into a new drive; access prompts ask keeps macOS's usual prompts; drive none starts without one.", inputSchema: schema({ public_key: { type: "string" }, request_key: key, limits: { type: "object", properties: { max_duration_seconds: { type: "integer", minimum: 60, maximum:
|
|
23
|
+
{ name: "start_mac", description: "Allocate a full cloud Mac VM, billed per minute from prepaid credit; its answer states its price. If it returns insufficient_credit, call get_mac_checkout, have the human pay, then retry with the same request_key. Supply a stable request_key; SSH public_key is optional for HTTPS-only agents; send both again after a lost response. Inspect the returned offer and limits. Poll get_mac_session until ready. No project pipeline is imposed; stop_mac deletes the VM and every file outside ~/drive. The Mac is fully enabled for you: macOS asks for no administrator password, and the Mac's login password is in $NOMAC_MAC_PASSWORD on it; the answer's warning says so. Each Mac gets a drive at ~/drive (20 GB), kept between sessions and on one Mac at a time: the account's default, or while another Mac has it a new drive of its own, named in the answer (get_mac_drive lists them). access drive NAME picks a drive (made empty the first time; default asks for the default itself, which answers drive_in_use while another Mac has it); drive_from copies one into a new drive; access prompts ask keeps macOS's usual prompts; drive none starts without one.", inputSchema: schema({ public_key: { type: "string" }, request_key: key, limits: { type: "object", properties: { max_duration_seconds: { type: "integer", minimum: 60, maximum: 315360000, description: "Seconds the Mac may run (default 7200); a Mac has no longest time." }, idle_timeout_seconds: { type: "integer", minimum: 60, maximum: 3600 }, spend_cap_microunits: { type: "string", pattern: "^[1-9][0-9]{0,17}$" } }, additionalProperties: false }, parallel: { type: "boolean", description: "true starts a second Mac beside the account's running one (accounts that bought credit, while NoMac has a Mac to spare), with a drive of its own. Without it, a start while a Mac runs answers session_limit_reached with that Mac's id, who started it and its last command, to use; or wait for it with queue_seconds." },
|
|
24
24
|
reuse: { type: "boolean", description: "With access drive set to a name: when that drive is on a running Mac, answer that Mac (reused: true) instead of drive_in_use." },
|
|
25
25
|
queue_seconds: { type: "integer", minimum: 300, maximum: 3600, description: "Wait in line up to this long, free, while the account runs as many Macs as it may, the drive asked for is on another Mac, or no Mac is free: the Mac starts in its turn (poll get_mac_session). For CI and scripts that queue work." },
|
|
26
26
|
access: { type: "object", properties: { prompts: { type: "string", enum: ["auto", "ask"] }, gatekeeper: { type: "string", enum: ["off", "on"] }, drive: { type: "string", description: "A drive's name (made empty the first time), account (the default, or a new drive while another Mac has it) or none" },
|
|
@@ -28,7 +28,7 @@ export const MAC_TOOLS = [
|
|
|
28
28
|
permissions: { type: "object", description: "By bundle ID: a list of permissions (camera, microphone, contacts, calendars, reminders, photos, desktop, documents, downloads and more) or \"all\"", additionalProperties: { anyOf: [{ type: "string", enum: ["all"] }, { type: "array", items: { type: "string" }, minItems: 1 }] } } }, additionalProperties: false } }, ["request_key"]), handler: async ({ request_key, ...body }) => text(await api("POST", "/api/v1/mac/sessions", { body, idempotencyKey: request_key })) },
|
|
29
29
|
{ name: "list_mac_sessions", description: "Find existing Mac sessions, including after losing a response. Shows state, cost, limits and cleanup.", inputSchema: schema({}), handler: async () => text(await api("GET", "/api/v1/mac/sessions")) },
|
|
30
30
|
{ name: "get_mac_session", description: "Read live Mac allocation state, cost, funded time and cleanup confirmation, and once ready the credentials installed on it (secrets, signing identities and profiles, by name and path, never values) and account: the Mac's user, whether its login password is set (in $NOMAC_MAC_PASSWORD on the Mac), the access choices, and how to type and click (mac_input). queued/provisioning means wait; stopping is not yet confirmed cleanup.", inputSchema: schema({ session_id: session }, ["session_id"]), handler: async args => text(await api("GET", base(args))) },
|
|
31
|
-
{ name: "extend_mac", description: "Keep a running Mac going longer: raises its time limit by minutes (default 60
|
|
31
|
+
{ name: "extend_mac", description: "Keep a running Mac going longer: raises its time limit by minutes (default 60; a Mac has no longest time), and its spend cap with it. Call it when an answer's stop_notice says the Mac stops soon at its time limit or spend cap, or before a build or test that would not finish in time. It adds no credit: when stop_notice's reason is credit, the human adds some (get_mac_checkout). The Mac still bills at its hourly price while it runs.", inputSchema: schema({ session_id: session, minutes: { type: "integer", minimum: 1, maximum: 5256000, default: 60, description: "Minutes to add to the time limit. Default 60." } }, ["session_id"]), handler: async ({ session_id, minutes = 60 }) => text(await api("POST", `${base({ session_id })}/extend`, { body: { minutes } })) },
|
|
32
32
|
{ name: "get_mac_drive", description: "Read the account's drives: each Mac has one at ~/drive (20 GB), kept between sessions and on one Mac at a time. What is there stays for the next Mac with that drive: keep projects in ~/drive/src for incremental builds; package and build caches (DerivedData, Swift packages, CocoaPods, npm) are kept there already. NoMac saves it when a Mac stops, with nothing to call. Lists each drive's name, space used, the Mac using it now, a save still in progress, recent versions, and the date it is deleted unused (90 days; 30 for a drive NoMac made for a Mac that named none). name reads one drive.", inputSchema: schema({ name: { type: "string", description: "One drive's name; without it, every drive" } }),
|
|
33
33
|
// A site before LIM-394 has only /api/v1/mac/drive, the one drive.
|
|
34
34
|
handler: async ({ name } = {}) => text(await api("GET", name ? `/api/v1/mac/drives/${encodeURIComponent(name)}` : "/api/v1/mac/drives")
|