Interactive mode and console
Enter commands line by line and complete commands, options and node paths with Tab, in the terminal with loot -i and in the workbench console.
Interactive mode in the terminal#
In interactive mode loot stays open and takes commands line by line. You do not have to type loot every time, and the Tab key completes commands, options and the paths of your nodes. This is the quickest way to get to know and explore LooT. Single calls and scripts keep running without -i.
loot -i
loot --interactiveYou must be signed in first (Sign-in). Then the prompt loot> appears:
LooT interaktiv: 'help' zeigt die Befehle, 'exit' beendet, Tab vervollständigt Befehle und Node-Pfade.
loot> node list Brewery
Id Name Werttyp Einheit Richtung
--- ----- ------- ------- --------
101 Plant - - -
loot> node show Brewery/Plant.Line1.Temperature
Pfad: Brewery/Plant.Line1.Temperature
Id: 103
Name: Temperature
Beschreibung: -
Werttyp: Double
Einheit: °C
Richtung: InOut
Duplikate: LastServe
Letzter Wert: 18.9
loot> exitThe rules at a glance:
- One command per line, just like on the command line. A leading
lootis ignored, so you can paste commands from this manual unchanged. helpshows the commands (likeloot --help). Ask a command for details with--help, for examplenode create --help.exitorquitend the session, as does Ctrl+D (Windows: Ctrl+Z) on an empty line.- Every line is evaluated on its own. An error in one command does not end the session.
- Global options apply only to the line they are on:
query ... --utc. To run the whole session in UTC, start withloot -i --utc. -icannot be combined with a command, and inside the session it is unnecessary.- Signing in and out (
login,logout) also work inside the session and take effect immediately. - Commands that run forever, such as
live, end with Ctrl+C. The session stays open.
Keys#
| Key | Effect |
|---|---|
| Tab | Completes the word at the cursor (see below) |
| ↑ / ↓ | Scrolls through earlier inputs. The history lives only in the memory of this session. |
| ← / →, Home, End | Moves the cursor within the line |
| Delete, Backspace | Deletes characters |
| Esc, Ctrl+C | Clears the line (does not end the session) |
| Ctrl+D | Ends the session when the line is empty |
Tab completion#
The Tab key completes the word before the cursor:
- Commands and subcommands:
nobecomesnode,node crbecomesnode create. - Options: After a hyphen,
lootsuggests the options of the command, for example--unitor--recursive. - Paths: For commands that expect a path,
lootsuggests tenants, root nodes and children, taken live from your installation.Brewery/PlbecomesBrewery/Plant, and after a dot the children follow. You must be signed in for this, and only nodes you are allowed to see are offered.
With exactly one match, Tab inserts it. With several, Tab adds the common beginning; if nothing more can be added, Tab lists the possibilities. Case does not matter. Paths with spaces or umlauts are put in quotation marks automatically, and for long paths such as "Hallifax/Werk Süd.Lager.Tür offen" you only type the beginning.
The workbench console#
The workbench contains a console that runs the same commands as loot, without installing anything. Open and close it with Ctrl+J or with the Console switch in the rail. The cross in the console hides it. The interface is described in the workbench manual.
The console works with the account you are signed in with in the workbench; you do not need loot login. Otherwise it behaves like interactive mode:
- The prompt is
loot>; a leadinglootis allowed but unnecessary. - Tab completes commands, options and node paths. Several matches appear as a hint below the line.
- ↑ and ↓ scroll through your inputs.
- For an exit code other than 0,
Exitcode 1(or 2) appears below the output. - Esc or Ctrl+C cancel a running command, for example
live. On a non-empty line, Ctrl+C discards the input. clearor Ctrl+L clear the console.-iis unnecessary in the console: it is interactive itself.
Blocked commands#
The console runs inside the web server's process. Files that a command would read or write would therefore live on the web server, not on your computer. The console refuses such commands before running them, with a message (… ist in der Konsole der Oberfläche gesperrt, that is: blocked in the console of the interface) and exit code 2:
loot upload,loot download,loot importloot stream downloadloot values exportloot exchange export,loot exchange verify,loot exchange store downloadloot stack pull- every command where you name a file, for example
--file,--output,--map,--client-secret-fileor an archive file, as well asloot spectrum -o
For these tasks use the loot program on your own computer.