Public Access
The Shell shows the replies to its own commands and nothing else. The console knows who each line is printed for (Console::As, Console::origin): a command run from the Shell prints as the Shell's, and what answers it later from another task carries that along (ls, tasks, du, cp, update check, sd list, screenshot, gemini get). Ctrl+b shows everything instead. This replaces the ten-second window, which was a guess. An App's name with a capital opens it (Notes, Irc, Wifi, Gnss, Gemini, Lora, Storage, Shell, System, Settings), from the Shell and from the consoles. rm needs -r for a folder, here and over the consoles. In the Shell a file, or a folder with something in it, is asked about unless -f; an empty folder with -r goes without a word. The Shell now hands its line to the main loop to run: run from inside the key handler, rm on a folder overflowed the loop's stack and crashed the device. `info` says which App is in front. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EhqxQ49eCju4CzKYNjZzwT
77 lines
3.8 KiB
Markdown
77 lines
3.8 KiB
Markdown
+++
|
|
title = "Shell"
|
|
description = "The firmware's own commands, typed on the device: look at its state, the SD card, the radio and the network with no PC and no cable."
|
|
weight = 9
|
|
[extra]
|
|
tag = "Shell"
|
|
+++
|
|
|
|
The firmware has a set of **commands**, made for working on it from a PC. The Shell runs them **on the device itself**: no computer, no cable, no Wi-Fi. It is the tool for the day something is wrong and you are nowhere near a desk.
|
|
|
|
It can do real damage: `rm` deletes, `reboot` restarts, `debug on` opens the device to the network. It is the same trust as holding the device, and nothing more.
|
|
|
|
## Using it
|
|
|
|
Type a command and press <kbd>Enter</kbd>. `help` lists them all; the [command reference](/dev/debug/commands/) says what each does. A few to start with:
|
|
|
|
| Command | Shows |
|
|
|---|---|
|
|
| `info` | The firmware's version, uptime, memory, Wi-Fi, the SD card and both firmware slots |
|
|
| `wifi status` | The network, the address, and where the DNS and time servers came from |
|
|
| `ls /notes` | A folder of the SD card, with sizes and dates |
|
|
| `crash` | The last crash, if there was one |
|
|
| `update check` | Whether a newer release exists |
|
|
| `lora status` | What the radio is set to and what it has heard |
|
|
|
|
- <kbd>Tab</kbd> **completes** the command's name. If several fit, it lists them.
|
|
- <kbd>Fn</kbd> with up and down brings back **lines you typed before**.
|
|
- <kbd>Alt</kbd> with up and down **scrolls back** through what was printed.
|
|
- `clear` empties the screen, and `quit` (or Back) leaves.
|
|
|
|
## What you see
|
|
|
|
**The replies to your own commands, and nothing else.** The firmware prints a lot besides: IRC connecting, a packet received, whatever a PC on the USB port or the Debug Console is asking for. None of that reaches the Shell. The firmware knows who each line is printed for, so an answer that comes a moment later from another part of it (a folder listing, `tasks`) is still yours.
|
|
|
|
<kbd>Ctrl</kbd> + <kbd>b</kbd> shows **everything** the firmware prints instead, and `all` shows in the corner. Press it again to go back.
|
|
|
|
## Opening an App
|
|
|
|
Type an App's name **with a capital letter** to open it, without going back to the Launcher:
|
|
|
|
`Irc` `Wifi` `Gnss` `Gemini` `Lora` `Storage` `Notes` `System` `Settings`
|
|
|
|
The capital is the difference: every command is in small letters, every App starts with a capital. <kbd>Tab</kbd> completes them too.
|
|
|
|
## Deleting
|
|
|
|
`rm` works as it does on Unix, with one addition: it asks.
|
|
|
|
| You type | What happens |
|
|
|---|---|
|
|
| `rm /notes/a.txt` | Asks, then deletes the file |
|
|
| `rm -f /notes/a.txt` | Deletes it without asking |
|
|
| `rm /captures/old` | Refused: it is a folder, and a folder needs `-r` |
|
|
| `rm -r /captures/old` | Removed at once if it is empty. If not, asks first |
|
|
| `rm -rf /captures/old` | Removed with everything in it, without asking |
|
|
|
|
The folders the firmware keeps its own files in can't be removed, as in the [Storage App](/guide/storage/).
|
|
|
|
## Screenshots
|
|
|
|
```
|
|
screenshot the screen, now
|
|
screenshot 5 the screen in 5 seconds: time to go to another App
|
|
```
|
|
|
|
The picture is saved as a PNG in `/screenshots` on the SD card, named by date and time, and a Toast says so once it is written (so the Toast is never in the picture). From the Shell, "now" is always a picture of the Shell: use the pause to get to the screen you want. The [Storage App](/guide/storage/) shows the files; to look at them, take the card to a computer.
|
|
|
|
## What it costs
|
|
|
|
Nothing while it is closed. Open, about 7 KB of memory, given back when you leave: with IRC connected and a Gemini page open, that can be the difference (see [the memory limit](/howto/not-enough-memory/)).
|
|
|
|
## The keys, as the device lists them
|
|
|
|
What <kbd>Fn</kbd> + <kbd>h</kbd> shows on this screen. This table is generated from the firmware's own lists, so it is always the current one.
|
|
|
|
{{ keys(scopes=["shell"]) }}
|