When Oda runs a command on your computer, it does so in a shell it controls: a shell chosen for your computer, a set of limits on time and output, and a small set of variables every command receives. This page describes that environment. How the commands themselves appear in the chat, with their cards and result markers, is on Shell commands.
Oda uses the shell that fits your computer:
| Computer | Shell |
|---|---|
| Windows | PowerShell |
| macOS and Linux | bash |
On Windows, Oda looks for PowerShell and uses the first candidate it can run:
PATH.When the configured path changes, Oda looks again for later commands; no restart is needed.
Oda applies the same limits to each command, whichever shell runs it:
| Limit | Default | What it covers |
|---|---|---|
| Time per command | two minutes | A single command may be given more time, up to ten minutes. |
| Output kept in the reply | 64,000 bytes | A 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 stopping | three seconds | A 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.
Every command runs with a plain, predictable setup:
NO_COLOR=1, PAGER=cat and GIT_PAGER=cat are set. bash commands also get TERM=dumb. PowerShell commands have their output pinned to UTF-8, and no terminal setting is applied.Every command also receives these managed variables, so your own scripts can find the same facts Oda works with:
| Variable | What it holds |
|---|---|
DATAMIND_HOME | The folder Oda keeps its own data in. It resolves from an environment value when one is set; otherwise it defaults to a folder inside your user folder. See Oda's home folder and settings files. |
DATAMIND_SHELL | Set to 1; marks a command that runs inside Oda's shell. |
DATAMIND_SESSION_ID | The id of the chat the command belongs to; it is left out for commands that are not run for a chat. |
DATAMIND_PROFILE | The name of the Oda profile in use, when one is set. |
DATAMIND_PROFILE_DIR | The folder of that profile. |
PowerShell on Windows; bash on macOS and Linux. Oda loads exactly one shell engine, so commands never run through a mix of shells.
Two minutes by default. Oda may give a single command more time, up to ten minutes. What happens when a command reaches its limit is on Shell commands.
Yes. Open the Plugins page and change them there; the changes apply to later commands without a restart. See Live plugin settings for how settings changes reach a running Oda.
The save is accepted; the next command fails instead of running, with a message about the value. Open the Plugins page and set a usable value.
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. Use them in your own scripts to find the same facts Oda works with.
Oda turns colour and paging off so results are readable text: NO_COLOR=1, PAGER=cat and GIT_PAGER=cat are set, bash also sets TERM=dumb, and PowerShell commands have their output pinned to UTF-8.
In order: a configured path, the standard PowerShell 7 install folder, your PATH, then Windows PowerShell 5.1 as a last resort. Change the configured path and Oda looks again for later commands.
No. It gets three seconds to end by itself; a command that has not ended after that is stopped by force.