SessionCommand

September 16, 2026 ยท View on GitHub

This object represents a command run in a Vercel Sandbox session (v2 API).

Example Usage

import { SessionCommand } from "@vercel/sdk/models/sessioncommand.js";

let value: SessionCommand = {
  args: [
    "run",
    "build",
  ],
  cwd: "/vercel/sandbox",
  durationMs: 1234,
  exitCode: 0,
  id: "cmd_123a6c5209bc3778245d011443644c8d27dc2c50",
  name: "npm",
  sessionId: "sbx_123a6c5209bc3778245d011443644c8d27dc2c50",
  startedAt: 1673123456789,
};

Fields

FieldTypeRequiredDescriptionExample
argsstring[]:heavy_check_mark:The arguments of the command.[
"run",
"build"
]
cwdstring:heavy_check_mark:The current working directory of the command./vercel/sandbox
durationMsnumber:heavy_minus_sign:Duration of the command execution in milliseconds.1234
exitCodenumber:heavy_check_mark:If the command did finish, the exit code.0
idstring:heavy_check_mark:The ID of the command.cmd_123a6c5209bc3778245d011443644c8d27dc2c50
namestring:heavy_check_mark:The name of the command.npm
sessionIdstring:heavy_check_mark:The ID of the session associated with the command.sbx_123a6c5209bc3778245d011443644c8d27dc2c50
startedAtnumber:heavy_check_mark:When the command was started, in milliseconds since the epoch.1673123456789