Bash and PowerShell command tools

While DataMind Oda works on a task, it runs commands on your computer, in bash or PowerShell. Each command is a single run that starts, does its work, returns its output and ends; this page describes how those runs behave and how to read what comes back.

A command from start to finish

How to read a result

The result carries the command's output: the ordinary output first, then a [stderr] section with the error output when the command has any. A short note at the end says how the command ended:

NoteWhat it means
[exit code: N]The command finished and reported this code. Zero means it succeeded; any other number means it reported a failure.
[killed by signal: X]A signal ended the command instead of a normal exit.
[timed out after <n>ms]The command reached its time limit and was stopped.
[stopped: <reason>]The command was stopped from outside, and the reason says why. Oda reads this as a stop, not as a failure of the command.
(no output)The command produced no output at all.

When the result is cut short

Commands that keep running

When a command cannot run

On Windows

What every command runs with

Questions, answered

What does [exit code: N] mean on a result?

It is the code the command itself reported when it finished. Zero means it succeeded; any other number means the command reported a failure. Oda reads the note on every result and looks into a failure before moving on.

Why did a command end with [killed by signal: X]?

A signal ended the command before it could exit on its own. Signals are reported on macOS and Linux; on Windows, an interrupted command reports [exit code: 1] instead. If the command's work still matters, ask Oda to run it again.

What does [stopped: <reason>] mean?

The command was stopped from outside its own run, for example when you stop the step or its job, and the reason says why. Oda reads it as a stop, not as a failure of the command, and does not retry the command on its own.

What does a result of (no output) mean?

The command finished without producing any output. If you expected output, ask Oda to check what the command did, or to run it another way.

Where can I find the full output when a result is cut short?

The full text is saved to the file the note names; ask Oda to open that file or to search inside it. This holds for both a cut result and a background read that dropped part of the output.

What happens when a command runs longer than its time limit?

It is not killed. It moves to a background job and keeps running, and the step reports the hand-over; Oda is told when the job finishes. The default limit is two minutes, and Oda can give a single command up to ten minutes.

How do I get the output of a command that moved to the background?

Ask Oda for it. Oda reads newer output with job_output and can stop the job with job_kill; each read returns only what has arrived since the last one, and Oda is told when the job finishes.

What does tool call aborted mean?

The step was stopped before it could finish, so it has no result and the command does not continue. If the step was stopped before the command was sent, the report reads tool call aborted before dispatch instead. Ask Oda to run the command again if you still need it.

Why does a force-stopped command on Windows report [exit code: 1]?

On Windows an interrupted command has no signal to report, so it reads as exit code 1. Treat it as an interruption, not as a failure the command reported, and ask Oda to run it again if the work still matters.

Why can't a PowerShell script start with param(...)?

Before a command runs, Oda sets up its text handling, and that setup comes before the command itself. A first statement that must come first, such as param(...), #requires or using, cannot run that way; wrap the script in a block, or keep it in a file and run it from there.

What variables can commands receive from Oda?

DATAMIND_HOME (the folder Oda keeps its data in), DATAMIND_SHELL (set to 1), DATAMIND_SESSION_ID (the chat the command belongs to), and DATAMIND_PROFILE and DATAMIND_PROFILE_DIR when a profile is set. Use them in your own scripts; The command environment lists them all.