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 commandTab 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 energyTab 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:
| Operator | Description | Example |
|---|---|---|
| ` | ` | Pipe output |
> | Redirect to file | symbols -l > syms.txt |
>> | Append to file | symbols -l >> syms.txt |
&& | Chain on success | run ... && 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 @ESInside 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 @ESBackslash 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 @ESQuoted 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,@CLJob management
| Command | Description |
|---|---|
jobs | List running jobs |
kill <id> | Terminate a running job |
batch <file> | Run a config file (supports wildcards, e.g., batch configs/*.json) |
clear | Clear the screen |
Non-interactive mode
Pipe commands to run without the TUI:
echo "run --strategy kbt --symbols @ES" | algo
algo < commands.txtSystem shell escape
Prefix commands with \ to execute them in the system shell:
algo> \ls -la
algo> \pwd