Loading the documentation…

Command environment and containment

While DataMind Oda works on a task, it runs commands on your computer, and every other program it starts uses the same machinery: the language servers it starts for code navigation, the shells kept alive between commands, and the helper programs behind delegated work. This page covers the shell Oda uses, the limits every command runs under, what those programs see of your settings, how a command is started and held together, and what happens to it and its output when the work ends. Commands you type in your own terminal are not these commands; that shell is yours.

What Oda runs, and under what limits

The shell that runs your commands

Oda uses the shell that fits your computer:

ComputerShell
WindowsPowerShell
macOS and Linuxbash

On Windows, Oda looks for PowerShell and uses the first candidate it can run:

  1. A path configured for Oda, when one is set.
  2. The standard PowerShell 7 install folder.
  3. The folders on your PATH.
  4. Windows PowerShell 5.1, as a last resort.

When the configured path changes, Oda looks again for later commands; no restart is needed.

Limits every command runs under

Oda applies the same limits to each command, whichever shell runs it:

LimitDefaultWhat it covers
Time per commandtwo minutesA single command may be given more time, up to ten minutes.
Output kept in the reply64,000 bytesA command that produces more has its full text saved to a file on your computer, up to 64 MiB, and Oda can read the text from there.
Grace when stoppingthree secondsA stopped command gets this long to end before it is ended by force.

The time limit and the output cap can be changed from the Plugins page; see Shell settings. Changes apply to later commands without restarting Oda. A value Oda cannot use is caught when the next command runs, not when it is saved.

What a command sees of your environment

What every command receives

VariableWhat it holds
DATAMIND_HOMEThe folder Oda keeps its own data in. See Oda's home folder and settings files.
DATAMIND_SHELLSet to 1; marks a command that runs inside Oda's shell.
DATAMIND_SESSION_IDThe id of the chat the command belongs to; left out for commands not run for a chat.
DATAMIND_PROFILEThe name of the Oda profile in use, when one is set.
DATAMIND_PROFILE_DIRThe folder of that profile.

How a command starts

How a command is held and stopped

What is kept of a command's output

When Oda stops or closes

Questions, answered

Which shell does Oda run commands in?

PowerShell on Windows; bash on macOS and Linux. Oda loads exactly one shell engine, so commands never run through a mix of shells. On Windows it uses, in order, a configured path, the standard PowerShell 7 install folder, your PATH, then Windows PowerShell 5.1 as a last resort.

Can I change the time limit or the output cap?

Yes. Open the Plugins page and change them there; the changes apply to later commands without a restart. A value Oda cannot use is accepted when saved, and the next command fails instead of running, with a message about the value. See Shell settings.

Does a command see my passwords and keys?

No. Variables whose names contain KEY, PASSWORD, SECRET or TOKEN, in any casing, are left out, as are Oda's own working values. The cleaning reads names and not values, so a secret kept under an unrelated name is not covered; when a step deliberately hands a value over, it still arrives.

What variables does every command receive?

DATAMIND_HOME (Oda's data folder), 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. Colour and paging are also turned off, so results are plain text.

Why was my command refused before it started?

The start request was incomplete or the program could not be resolved: a missing program name, a relative path, a name not found on PATH, or a file that cannot be run. Oda reports which one, and nothing runs.

How is a command different from a terminal session?

A command runs once: it starts, does its work, returns its output and ends. A terminal session is an interactive shell that stays open while Oda types into it and reads what comes back; Terminal sessions covers those.

Why did a program fail to start on Windows?

A program that cannot start reports spawn <program> <code>, with a short code such as ENOENT. A failure with no known short code reports spawn <program> UNKNOWN (Windows error <number>); the number and any text after it carry the system's own reason, for example a security policy that blocks the program. Nothing ran.

When a command is stopped, does everything it started stop too?

Yes. A command and everything it starts are held as one managed range. Stopping the work asks the whole range to stop, gives it three seconds by default, and then forces anything still running.

Can I still read a command's full output after it ends?

Yes. When the complete output is written to a file while the command runs, the file stays after the command ends, so Oda can read it back or search inside it when you ask. It sits in a folder only your user account can open; Result limits and spill files covers where such files live and when they are cleared up.

Why did part of an earlier output come back incomplete?

The run keeps a window of the most recent output. Once older output slides out of that window, a read that starts from before it cannot return the missing part, so Oda returns what is still held and says the read is lossy. Treat the result as partial.

What happens to running commands when Oda closes or crashes?

When you quit Oda, or when it exits through an error it can catch, it stops the commands it manages before leaving. A forced kill, an out-of-memory stop, or a crash below the app cannot be caught from inside Oda, so those cases are left to the operating system, or an outside supervisor, to clean up.

Could my command be started a second time when containment falls back?

No. Oda never starts a command a second time through the weaker fallback: once the stronger path may have started it, it is not replayed. A command that ran under the fallback ran that way from the start.