The Interactive Shell

The Interactive Shell

The algo shell is a tabbed terminal interface that provides an interactive environment for running commands.

Starting the shell

algo         # Launch the shell
algo shell   # Explicit command

Tab management

Each command runs in its own tab, allowing concurrent execution and monitoring. Use keyboard shortcuts or mouse clicks to switch between tabs.

Command entry

Commands are entered without the algo prefix:

algo> run --strategy kbt --symbols @ES --output-mode summary
algo> strategies -l
algo> symbols -t future -c energy

Tab completion

The shell provides intelligent completion for:

  • Command names
  • Strategy names
  • Symbol names (including portfolio references)
  • Flag names

Press Tab to complete, or Tab twice to see all options.

History

  • Up/Down arrows: Navigate command history
  • Ctrl+R: Reverse search through history
  • history: Display full command history

Shell operators

The shell supports standard Unix-like operators:

OperatorDescriptionExample
``Pipe output
>Redirect to filesymbols -l > syms.txt
>>Append to filesymbols -l >> syms.txt
&&Chain on successrun ... && portfolio ...
``

Quoting and escaping

The shell supports quoting and backslash escaping to pass special characters (such as >, |, &) as literal values in flag arguments. This is important when using expressions in flags like --fitness-metric or --inputs.

Double quotes

Wrap a value in double quotes to prevent any shell operator interpretation inside the quoted string:

algo> seek --fitness-metric "if(npdd>1,sharpe*2,0)" --strategy kbt --symbols @ES
algo> run --filter "value > 100" --strategy kbt --symbols @ES

Inside double quotes, \" produces a literal double-quote and \\ produces a literal backslash. All other characters are passed through as-is.

Single quotes

Single quotes work like double quotes but treat everything literally — no escape sequences are recognised inside single quotes:

algo> seek --fitness-metric 'if(npdd>1,sharpe*2,0)' --strategy kbt --symbols @ES

Backslash escaping

Outside of quotes, prefix a special character with \ to treat it as a literal:

algo> seek --fitness-metric if(npdd\>1,sharpe*2,0) --strategy kbt --symbols @ES

Quoted values with spaces

Quoting also keeps values with spaces together as a single argument:

algo> cd "My Documents"
algo> run --strategy kbt --symbols @ES --flag="value with spaces"

Note: This quoting applies only inside the Algo shell. When passing arguments on the regular command line, your OS shell handles quoting before Algo sees the arguments.

Parallel execution

Run multiple commands simultaneously from the shell:

algo> parallel 4 run --strategy kbt --symbols @ES,@NQ,@GC,@CL

Job management

CommandDescription
jobsList running jobs
kill <id>Terminate a running job
batch <file>Run a config file (supports wildcards, e.g., batch configs/*.json)
clearClear the screen

Non-interactive mode

Pipe commands to run without the TUI:

echo "run --strategy kbt --symbols @ES" | algo
algo < commands.txt

System shell escape

Prefix commands with \ to execute them in the system shell:

algo> \ls -la
algo> \pwd