@cmdop/node
Node.js SDK for CMDOP — terminal streaming, file operations, AI agents over gRPC.
Install
npm install @cmdop/node
Requires: Node.js >= 18.0.0
Quick Start
import { CMDOPClient } from '@cmdop/node';
const client = CMDOPClient.local();
const client = CMDOPClient.remote('cmdop_live_xxx');
await client.terminal.setMachine('my-server');
await client.terminal.sendInput('ls -la\n');
const { output } = await client.terminal.execute('echo hello');
console.log(output);
Services
client.terminal | Sessions, I/O, streaming, attach (SSH-like) |
client.files | Read, write, list, search, archive remote files |
client.agent | Run AI agents (one-shot, streaming, structured output) |
client.extract | Structured data extraction via LLM |
client.skills | List, show, run installed skills |
client.download | Download remote files or URLs to local disk |
Attach with Password
const attach = client.terminal.attach(sessionId, { password: 'secret' });
attach.on((event) => {
if (event.type === 'output') process.stdout.write(event.data);
});
await attach.connect();
Password can also be set via CMDOP_AGENT_PASSWORD env var.
SSH Connect
import { CMDOPClient, sshConnect } from '@cmdop/node';
const client = CMDOPClient.remote('cmdop_live_xxx');
await sshConnect({ client, hostname: 'my-server' });
Documentation
See docs/ for detailed guides:
- Terminal — sessions, I/O, streaming, attach, password auth
- Files — file operations
- Agent — AI agent execution
- Extract — structured data extraction
- Skills — skill management
- Download — file downloads
- Transport — local/remote transports, config, env vars
- Errors — error types and handling
Links
License
MIT