Execute command (synchronous)
client.computers.exec.sync(stringid, ExecSyncParams { command, cwd, env, timeout_seconds } body, RequestOptionsoptions?): ExecSyncResponse { exit_code, stderr, stdout }
POST/computers/{id}/exec/sync
Execute a shell command and wait for completion, returning buffered stdout/stderr.
Parameters
id: string
Returns
Execute command (synchronous)
import Lightcone from '@tzafon/lightcone';
const client = new Lightcone({
apiKey: process.env['TZAFON_API_KEY'], // This is the default and can be omitted
});
const response = await client.computers.exec.sync('id');
console.log(response.exit_code);{
"exit_code": 0,
"stderr": "stderr",
"stdout": "stdout"
}Returns Examples
{
"exit_code": 0,
"stderr": "stderr",
"stdout": "stdout"
}