What you can build.
Small programs on your own computers, a few lines each, on the TypeScript and Python SDKs.
Install a package first:npm install @cmdop/sdkpip install cmdopMore on the packages
Python
A morning check of every computer
Walk your computers, read each one's memory, disk and load, and print one report.
import cmdop with cmdop.connect() as c: # CMDOP_TOKEN, CMDOP_URL for row in c.machines(): if row["online"]: print(row["name"], c.machine(row["name"]).sys_info())Switch on: Read
No repository yet.
TypeScript
One command on every computer
Run the same command on all your computers and see each answer under its name.
import { connect } from "@cmdop/sdk"; const cmdop = connect(); for (const m of await cmdop.machines()) { const { stdout } = await cmdop.machine(m.name).run("uptime"); console.log(m.name, stdout); }Switch on: Run commands
No repository yet.
TypeScript
A build you follow from your code
Start a build on a computer, follow its output as it runs and act when it ends.
const run = cmdop.machine("build-box").stream("npm run build"); for await (const piece of run) process.stdout.write(piece.data); const { exit_code } = await run.result; if (exit_code !== 0) notify("build failed");Switch on: Run commands
No repository yet.
React
A board of your computers
A React page that lists your computers and which of them are online.
// app/machines/page.tsx, a server component: the token stays on the server export default async function Page() { const rows = await connect().machines(); return <ul>{rows.map((m) => <li key={m.name}>{m.name}: {m.online ? "online" : "offline"}</li>)}</ul>; }Uses what the token allows
No repository yet.
TypeScript
A picture of the screen, every hour
Take a screenshot of a computer on a schedule and keep the files, for a kiosk or a long job.
import { writeFile } from "node:fs/promises"; const shot = await cmdop.machine("studio-mac").screenshot(); await writeFile(`screen-${Date.now()}.png`, shot.image.bytes);Switch on: See the screen
No repository yet.
Python
A config file kept the same on two computers
Read a file on one computer and write it to another.
with cmdop.connect() as c: a, b = c.machine("studio-mac"), c.machine("build-box") text = a.fs_read(path="~/.config/app.toml")["data"] b.fs_write(path="~/.config/app.toml", data=text)Switch on: Write
No repository yet.
Python
The record as a file
Pull what agents and programs did on a computer since yesterday and save it for your own review.
import json, time with cmdop.connect() as c: since = int(time.time()) - 86400 out = c.machine("studio-mac").journal_search(since=since, limit=500) open("record.json", "w").write(json.dumps(out["events"]))Switch on: Read
No repository yet.
TypeScript
A chat command with an allow-list
A small bot that runs only the commands you list, on the computer you name, when someone asks.
const ALLOWED = { status: "git status --short", uptime: "uptime" } as const; export async function onMessage(word: string) { if (!(word in ALLOWED)) return "Not on the list."; const { stdout } = await cmdop.machine("build-box").run(ALLOWED[word as keyof typeof ALLOWED]); return stdout; }Switch on: Run commands
No repository yet.
Connect a computer first.
curl -fsSL https://install.cmdop.ai | shInstalls the cmdop program for your user, checked against the release's checksums. Windows is not out yet. How it installs
- Command linemacOS · Linux
- Windowscommand line
- Mac appmenu bar
- Phoneapp