Every command and its options. The bateri command says how they fit together: ids, where a command acts, the keyboard rule and the exit codes.
Open
Each prints the pane it opens, such as p9. After -- comes the program to run in it, started directly and not by your shell; without a program the pane runs bateri's shell. A program that is not there opens no pane, and the command exits 1.
bateri split [PANE | --tab TAB] [--left | --right | --above | --below] [--ratio PERCENT] [OPTIONS] [-- PROGRAM]
A pane beside the one the command runs in, or beside PANE, or in the tab TAB. --ratio is the share of that pane's room the new one takes, in percent.
A shell named alone (-- zsh, also fish and bash 4.4+) is a shell: its dock, and bateri in it. Anything else, like -- make or -- sh, is a program: no dock, and the pane goes with it.
bateri split --below --ratio 30 -- npm run dev# prints p9bateri split --tab t3 --label server -- make up# in the tab t3bateri split -- zsh# a shell, with its dock
bateri tab [--group GROUP | --window WINDOW | --new-group NAME] [OPTIONS] [-- PROGRAM]
A tab of its own, next to this one. --group and --window put it in a group or a window you name, --new-group in a group made for it.
bateri tab -- make watchbateri tab --new-group api --label web# in a group made for it
bateri window [OPTIONS] [-- PROGRAM]
A window of its own. The keyboard stays where it was.
bateri window -- make watch
| Option | What it does |
|---|---|
--label TEXT | A label for the pane. A label is information, not a name: no command takes one in place of an id. |
--cwd DIR | The folder the program starts in. |
--keep-open | The pane stays when the program ends. On this Mac your login shell is left in it. |
--wait | The command waits for the program and exits with its status. Needs a program. |
--focus | The pane takes the keyboard. By default the keyboard stays where it was. |
--json | Prints the pane with the tab, group and window it stands in. |
-S SERVER | Starts the terminal on a server, by the name you give ssh, and prints p9@prod. Level full only; see On a server. |
Fields that contradict each other, such as split p9 --tab t3 or tab --group g1 --window w1, are refused.
Talk to a pane
These reach a pane on another machine the same way: bateri send p9@prod 'q'.
bateri send [PANE] TEXT
Types the text into the pane.
bateri send p9 'q'
bateri send-key [PANE] KEY…
Presses keys in the pane.
bateri send-key p9 enter
bateri capture [PANE]
Prints what is on the pane's screen.
bateri capture p9
bateri wait PANE [--for TIME]
Waits until the pane's program ends and exits with its status. --for waits at most that long.
bateri wait p9
See what is open
bateri ls [--json]
Lists every window, group and tab, the splits in them and the server's panes, by their ids.
A floating pane is marked (floating), and (minimized) in a capsule. In --json a pane's object carries floating and minimized.
bateri ls --json
Arrange
The kind is always written: close tab t3, never close t3. With no id a command acts on the one it runs in. focus, move, zoom, swap and resize follow the keyboard rule.
bateri focus pane|tab|group|window [ID]
Takes the keyboard there. A pane in a capsule opens.
bateri focus pane p9
bateri close pane|tab|group|window [ID]
Closes it without a question. The programs in it end.
bateri close tab # the tab it runs in
bateri rename pane|tab|group ID LABEL
Gives it a label. An empty label takes it away.
bateri rename tab t3 api
bateri move pane [PANE] --beside PANE --left|--right|--above|--below
Puts the pane beside another. --tab TAB puts it in another tab, beside its focused pane.
--new-tab [NAME] gives it a tab of its own, its name optional, and prints the tab; --group, --new-group or --window say where.
bateri move pane p9 --beside p3 --rightbateri move pane p9 --tab t3bateri move pane p9 --new-tab web
bateri move tab [TAB] --group GROUP | --window WINDOW | --new-group NAME
Moves a tab into a group or a window. --window also takes it out of its group.
bateri move tab t3 --group g1
bateri zoom [PANE]
The pane fills its tab, and again gives the room back.
bateri zoom p9
bateri swap PANE PANE
Two panes trade places.
bateri swap p9 p3
bateri resize [PANE] --left|--right|--above|--below [--by N]
Resizes the pane that way, as ⌃⌘ + arrow does; --by says how many steps.
bateri resize p9 --left --by 3
Floating panes
A floating pane is a card over the tab's other panes, with its own place and size. Places and sizes are percents of the tab, from 0 to 100.
bateri split [PANE | --tab TAB] --float [--at X,Y] [--size W,H] [--minimized] [OPTIONS] [-- PROGRAM]
A floating pane over this tab; a pane or --tab says whose. --float goes with no side, --ratio, --new-tab, --group or --window.
--minimized opens it as a capsule from the start: the card is never seen, and the pane stays open when its program ends. It does not go with --focus.
bateri split --float --at 60,10 --size 35,40 -- htopbateri split --float --minimized --label 'dev server' -- npm run dev# a capsule
bateri move pane [PANE] --float | --dock | --at X,Y | --size W,H
--float lifts a flat pane out of its place, --dock puts a floating one back among the flat panes, and --at or --size alone move or resize it.
--beside, --tab and --new-tab take a floating pane too and put it flat where they say.
bateri move pane p9 --floatbateri move pane p9 --at 50,50bateri move pane p9 --dock
bateri minimize [PANE]
A floating pane shrinks to a capsule, or opens again where the card was. The programs in it keep running. On a flat pane it is a mistake (64).
bateri minimize p9
Tell you
bateri notify TEXT
A notification, when bateri is behind or has no tab of it. It is how a program asks you to look.
bateri notify "tests failed"
Programs
Programs bateri keeps up to date, such as the pens, on the machine the command runs on: this Mac, or a server with kablo.
bateri package install SOURCE
Installs a program: by its name, by user/repo of a GitHub project, or by the address of its app.json.
bateri package install bateri/textpen
bateri package list
What this machine has.
bateri package update [NAME]
Looks for newer releases now. A program whose release came signed with another key stays stopped until you decide here: the command shows both keys and asks.
bateri package update textpen
bateri package remove NAME
Takes a program off this machine.
bateri package auto [on|off]
Turns this machine's updates on or off.
bateri package auto off
bateri package not-here [NAME] …
Tells bateri these programs are not wanted on this machine; it does not offer them again.