buninu 0.3.1 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +92 -0
- package/README.md +313 -37
- package/apps/cmdlist +6 -1
- package/apps/jsgotty/gotty.js +65 -76
- package/apps/jsgotty/package.json +6 -1
- package/apps/jsgotty/single-exe/README.md +358 -54
- package/apps/jsgotty/single-exe/assetsHelper.js +293 -12
- package/apps/jsgotty/single-exe/assetsLoader.mjs +1 -1
- package/apps/jsgotty/single-exe/assetsPacker.js +218 -0
- package/apps/jsgotty/single-exe/compiled.js +379 -19
- package/apps/jsgotty/single-exe/entry.mjs +16 -2
- package/apps/jsgotty/zmodem-node.js +14 -12
- package/apps/jsmdcui/CHANGELOG.md +56 -0
- package/apps/jsmdcui/package.json +12 -2
- package/apps/jsmdcui/single-exe/README.md +298 -375
- package/apps/jsmdcui/single-exe/assetsHelper.js +198 -18
- package/apps/jsmdcui/single-exe/assetsLoader.mjs +1 -1
- package/apps/jsmdcui/single-exe/assetsPacker.js +218 -0
- package/apps/jsmdcui/single-exe/compiled.js +291 -5
- package/apps/jsmdcui/single-exe/entry.mjs +7 -0
- package/apps/jsmdcui/src/index.js +11 -8
- package/apps/jsmdcui/tests/jmigt.js +16 -0
- package/bin/bunmsh.bat +3 -0
- package/bin/bunmsh.sh +5 -0
- package/bin/init.js +37 -2
- package/bin/install.js +570 -0
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,97 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.4.1 - 2026-08-30
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- A freshly installed tree no longer reports files as locally changed when
|
|
8
|
+
only their file mode differs. Publishing normalises modes, so a file can come
|
|
9
|
+
back from the registry with a different executable bit and byte-identical
|
|
10
|
+
contents, which `bun pm diff` counts as a modification; an update was
|
|
11
|
+
listing those and asking about files nobody had touched. They are now
|
|
12
|
+
recognised by the mode having changed while the contents did not, and left
|
|
13
|
+
out of the list, with a line saying how many were ignored so the count still
|
|
14
|
+
adds up against the command below.
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
|
|
18
|
+
- An update prints the `bun pm diff` command it is about to run, on a line of
|
|
19
|
+
its own before the result. Run it by hand without `--json` to read the list
|
|
20
|
+
directly, or without `--name-only` to see the changes themselves rather than
|
|
21
|
+
which files hold them. It goes to stdout rather than stderr with the rest of
|
|
22
|
+
the output, so `2>/dev/null` leaves just the command.
|
|
23
|
+
|
|
24
|
+
## 0.4.0 - 2026-08-30
|
|
25
|
+
|
|
26
|
+
### Added
|
|
27
|
+
|
|
28
|
+
- `--install [dir]` (`-i`) and `--strip-install [dir]` (`-si`) copy the running
|
|
29
|
+
installation into a directory that outlives the `npx` cache. `--install`
|
|
30
|
+
creates `<dir>/buninu` as the new `BUNINU_HOME`, `--strip-install` makes
|
|
31
|
+
`<dir>` itself that root, and both default to the current directory. The
|
|
32
|
+
implementation is `bin/install.js`, which runs on its own as well as being
|
|
33
|
+
imported by `bin/init.js`; run directly with no arguments it installs.
|
|
34
|
+
Relative symbolic links are recreated exactly as stored rather than followed,
|
|
35
|
+
so `bin/androidNativeLibs -> ../..` stays a link instead of dragging the
|
|
36
|
+
parent tree into the copy. `cp -a` is used when `cp` is on `PATH`, and an
|
|
37
|
+
equivalent `node:fs` walk otherwise; the two were verified to agree on
|
|
38
|
+
content, link targets, permissions and whole-second timestamps across every
|
|
39
|
+
entry of the tree.
|
|
40
|
+
- Installing over an existing Buninu updates it in place. The copy only ever
|
|
41
|
+
adds and overwrites, so `apps/<name>/` commands, `bin/*.sh` overrides and the
|
|
42
|
+
Bun binaries `bin/bun.sh` extracted are left alone, and the three files that
|
|
43
|
+
belong to the package and to the user at once are merged: the local `buninu`
|
|
44
|
+
section of `package.json` is kept, command names added to `apps/cmdlist` are
|
|
45
|
+
kept, and `.bashrc` is kept whenever it only adds lines to the shipped one,
|
|
46
|
+
including lines inserted in the middle. A `.bashrc` that cannot be merged
|
|
47
|
+
that way is left exactly as it is, with the shipped version written beside it
|
|
48
|
+
as `.bashrc.dist`.
|
|
49
|
+
- Before replacing the package's own files, an update runs `bun pm diff`
|
|
50
|
+
against the version the installation reports and lists the files that no
|
|
51
|
+
longer match it, then asks before continuing. Nothing is recorded inside the
|
|
52
|
+
installation to make this work — the published package is the reference — so
|
|
53
|
+
the check needs the network, and when it cannot run, or does not finish
|
|
54
|
+
within 60 seconds, it asks rather than assuming there was nothing to lose.
|
|
55
|
+
`--yes` answers ahead of time, which a run without a terminal needs;
|
|
56
|
+
`--force` replaces everything without merging or checking. An existing
|
|
57
|
+
installation is always named by absolute path before anything is written.
|
|
58
|
+
|
|
59
|
+
- `buninu.xdgDataHome` points `XDG_DATA_HOME` at a directory of your choosing:
|
|
60
|
+
`true` puts it inside the installation at `$BUNINU_HOME/.local/share`, and a
|
|
61
|
+
string names one outright, resolved from the `package.json` directory when it
|
|
62
|
+
is relative. The directory is created at startup. What this moves in practice
|
|
63
|
+
is bunmsh's command history, which lives at `$XDG_DATA_HOME/bunmsh/history`,
|
|
64
|
+
so `true` is what makes a shell's history travel with a copied installation
|
|
65
|
+
instead of staying on the machine it was typed on. `HOME` is deliberately not
|
|
66
|
+
touched by it, so SSH keys and Git configuration in the user's own home keep
|
|
67
|
+
working and bunmsh can still import an existing `~/.bash_history`.
|
|
68
|
+
|
|
69
|
+
- Refusing to install into an occupied directory now says which check the
|
|
70
|
+
directory failed — no readable `package.json`, or one naming a different
|
|
71
|
+
package — instead of reporting every case as "is not a buninu installation".
|
|
72
|
+
Whether a directory is an installation to update is decided by that name
|
|
73
|
+
alone: a Buninu missing `bin/init.js` is a damaged installation rather than
|
|
74
|
+
somebody else's directory, so an update repairs it, merging the local
|
|
75
|
+
configuration back in, where before `--force` was the only way through and
|
|
76
|
+
took that configuration with it. Every refusal names the directory by
|
|
77
|
+
absolute path.
|
|
78
|
+
|
|
79
|
+
### Fixed
|
|
80
|
+
|
|
81
|
+
- `HOME` no longer falls back to the package directory when the environment
|
|
82
|
+
does not set it. Windows does not set `HOME`, so a Windows session had its
|
|
83
|
+
home pointed at the disposable `npx` cache, taking anything written there —
|
|
84
|
+
bunmsh's command history included — with it when the cache was cleared. It
|
|
85
|
+
now falls back to the operating system's own home directory for the user.
|
|
86
|
+
|
|
87
|
+
## 0.3.2 - 2026-08-29
|
|
88
|
+
|
|
89
|
+
- Added bunmsh to bin and cmdlist
|
|
90
|
+
|
|
91
|
+
## 0.3.1 - 2026-08-29
|
|
92
|
+
|
|
93
|
+
- Added bunmsh to buninu
|
|
94
|
+
|
|
3
95
|
## 0.3.0 - 2026-08-21
|
|
4
96
|
|
|
5
97
|
### Added
|
package/README.md
CHANGED
|
@@ -25,20 +25,6 @@
|
|
|
25
25
|
See [ARCHITECTURE.md](ARCHITECTURE.md) for the complete architecture, portability model,
|
|
26
26
|
and self-bootstrapping design.
|
|
27
27
|
|
|
28
|
-
## Differences from upstream
|
|
29
|
-
|
|
30
|
-
### The bundled jsmdcui
|
|
31
|
-
|
|
32
|
-
* Is configured editor-first by MDCUI_DEFAULT_EDIT
|
|
33
|
-
* The command `jmi` with a Markdown file opens the normal terminal editor.(js micro editor)
|
|
34
|
-
* The command `jsmdcui` preserves its original behavior: `apps/jsmdcui/jsmdcui.sh`, which starts its `tui` entry point with `--mdcui` when running markdown Apps, and forwards all command-line arguments.
|
|
35
|
-
* Adds the Buninu-only `# syntax: markdown` marker for Markdown highlighting in extensionless files; upstreaming may be considered later.
|
|
36
|
-
|
|
37
|
-
### The bundled jsgotty
|
|
38
|
-
|
|
39
|
-
* No longer depends on or ships `node-pty`.
|
|
40
|
-
* Its PTY is provided by Bun's terminal API.
|
|
41
|
-
|
|
42
28
|
## Install Bun
|
|
43
29
|
|
|
44
30
|
Buninu requires [Bun](https://bun.com). On Android, install Bun in Termux:
|
|
@@ -54,12 +40,26 @@ On Linux and Windows, follow the
|
|
|
54
40
|
|
|
55
41
|
### Start a remote shell in a Browser
|
|
56
42
|
|
|
57
|
-
|
|
43
|
+
To try it, run the npm package. This runs Buninu from the `npx` cache, which
|
|
44
|
+
is a fine place to look around in and a bad place to keep anything:
|
|
58
45
|
|
|
59
46
|
```sh
|
|
60
47
|
npx buninu
|
|
61
48
|
```
|
|
62
49
|
|
|
50
|
+
To keep it, install it somewhere of your own first, and start it from there
|
|
51
|
+
from then on. That directory becomes `BUNINU_HOME`: the installation's own
|
|
52
|
+
root, yours to edit and to carry to another machine. See
|
|
53
|
+
[Install and update](#install-and-update):
|
|
54
|
+
|
|
55
|
+
```sh
|
|
56
|
+
# Creates ~/somewhere/buninu, which is now BUNINU_HOME
|
|
57
|
+
npx buninu --install ~/somewhere
|
|
58
|
+
|
|
59
|
+
# Start it from there from now on
|
|
60
|
+
bun ~/somewhere/buninu/bin/init.js
|
|
61
|
+
```
|
|
62
|
+
|
|
63
63
|
Or run it from a source checkout:
|
|
64
64
|
|
|
65
65
|
```sh
|
|
@@ -70,19 +70,23 @@ The launcher automatically chooses a free TCP port and detects an available
|
|
|
70
70
|
shell for the current platform. Other arguments are forwarded to jsgotty:
|
|
71
71
|
|
|
72
72
|
```sh
|
|
73
|
-
|
|
73
|
+
# Serve on port 9000 instead of picking a free one
|
|
74
74
|
npx buninu --port 9000
|
|
75
|
-
npx buninu --jsgotty --help
|
|
76
75
|
|
|
77
|
-
#
|
|
78
|
-
npx buninu
|
|
76
|
+
# Ask for a username and password before handing over the terminal
|
|
77
|
+
npx buninu --credential user:pass
|
|
78
|
+
|
|
79
|
+
# Accept connections from other machines, not just this one. By default the
|
|
80
|
+
# terminal is reachable only from the computer it runs on; this opens it to
|
|
81
|
+
# anything that can reach this machine over the network, and the terminal is
|
|
82
|
+
# a working shell, so give it a password at the same time.
|
|
83
|
+
npx buninu -a 0.0.0.0 --credential user:pass
|
|
79
84
|
```
|
|
80
85
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
to see jsgotty's actual flag reference instead of Buninu's.
|
|
86
|
+
Read [Security](#security) before using that last one.
|
|
87
|
+
|
|
88
|
+
Buninu's own options are listed under
|
|
89
|
+
[Command-line usage](#command-line-usage).
|
|
86
90
|
|
|
87
91
|
### Start a local shell in a Terminal (experimental)
|
|
88
92
|
|
|
@@ -90,10 +94,29 @@ Drops you straight into [bunmsh](apps/bunmsh/README.md) (Bun Modern Shell), a
|
|
|
90
94
|
dependency-free, mksh-inspired command shell that runs on Bun, without going
|
|
91
95
|
through the browser/jsgotty flow.
|
|
92
96
|
|
|
97
|
+
To try it:
|
|
98
|
+
|
|
93
99
|
```sh
|
|
94
100
|
npx buninu --local
|
|
95
101
|
```
|
|
96
102
|
|
|
103
|
+
To keep it, install it the same way as above and pass `--local` to the
|
|
104
|
+
installed copy from then on. See [Install and update](#install-and-update):
|
|
105
|
+
|
|
106
|
+
```sh
|
|
107
|
+
# Creates ~/somewhere/buninu, which is now BUNINU_HOME
|
|
108
|
+
npx buninu --install ~/somewhere
|
|
109
|
+
|
|
110
|
+
# Start bunmsh from there from now on
|
|
111
|
+
bun ~/somewhere/buninu/bin/init.js --local
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Command history is kept in your own home directory either way, so it survives
|
|
115
|
+
`npx`. What does not is anything you add to the installation itself — aliases
|
|
116
|
+
in its `.bashrc`, commands of your own under `apps/` — since that lives in the
|
|
117
|
+
package, and under `npx` the package is a cache directory.
|
|
118
|
+
See [Data & Persistence](#data--persistence).
|
|
119
|
+
|
|
97
120
|
Or run it from a source checkout:
|
|
98
121
|
|
|
99
122
|
```sh
|
|
@@ -103,6 +126,139 @@ bun ./bin/init.js --local
|
|
|
103
126
|
Buninu's own tools (`rz`, `sz`, `showimg`, `tts`, `xdg-open`, `native-bridge`,
|
|
104
127
|
etc.) stay available inside this shell too, same as in the browser session.
|
|
105
128
|
|
|
129
|
+
## Data & Persistence
|
|
130
|
+
|
|
131
|
+
Running Buninu via `npx` works like a container: `npx` fetches the package into
|
|
132
|
+
a cache directory and runs it from there, which is fine as a temporary working
|
|
133
|
+
directory but isn't guaranteed to survive between runs — version bumps,
|
|
134
|
+
`npx clear-npx-cache`, or normal cache eviction can all wipe it. That directory
|
|
135
|
+
is where the shell starts, so nothing left sitting in it is safe.
|
|
136
|
+
|
|
137
|
+
The answer is to stop running it from there: [install it](#install-and-update)
|
|
138
|
+
into a directory of your own, and `BUNINU_HOME` becomes somewhere you can keep
|
|
139
|
+
things, edit files in, and carry to another machine.
|
|
140
|
+
|
|
141
|
+
Once it is installed, files you leave in `BUNINU_HOME` are safe, updates
|
|
142
|
+
included — an update only adds and overwrites the package's own files and
|
|
143
|
+
never deletes anything else. Your own home directory is untouched and still
|
|
144
|
+
reachable as `~`, so work you would rather keep separate from Buninu, or that
|
|
145
|
+
is too large to carry around with it, can just as well live there.
|
|
146
|
+
|
|
147
|
+
Two things live outside `BUNINU_HOME` either way, because they belong to the
|
|
148
|
+
machine rather than to Buninu:
|
|
149
|
+
|
|
150
|
+
- `HOME` stays your own home directory. Buninu never replaces it, so a shell
|
|
151
|
+
started here still finds your SSH keys, your Git configuration, and anything
|
|
152
|
+
else you keep there.
|
|
153
|
+
- bunmsh writes its command history to `$XDG_DATA_HOME/bunmsh/history`, or
|
|
154
|
+
`$HOME/.local/share/bunmsh/history` when that is unset. It persists between
|
|
155
|
+
sessions, and by default it stays on the machine it was typed on rather than
|
|
156
|
+
travelling with an installation.
|
|
157
|
+
|
|
158
|
+
Set [`buninu.xdgDataHome`](#data-directory-optional) to move that history, and
|
|
159
|
+
anything else written to the XDG data directory, into the installation so it
|
|
160
|
+
travels with it. Keep in mind that a history file records the commands it was
|
|
161
|
+
given, so one carried on removable media carries whatever was typed into it.
|
|
162
|
+
|
|
163
|
+
## Install and update
|
|
164
|
+
|
|
165
|
+
Copy this installation into a directory that is yours to keep, and run it
|
|
166
|
+
from there instead of from the `npx` cache:
|
|
167
|
+
|
|
168
|
+
```sh
|
|
169
|
+
# Creates ~/somewhere/buninu as BUNINU_HOME
|
|
170
|
+
npx buninu --install ~/somewhere
|
|
171
|
+
|
|
172
|
+
# Makes ~/buninu itself BUNINU_HOME, with no directory of its own
|
|
173
|
+
npx buninu --strip-install ~/buninu
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
Both default to the current directory. The two differ only in where
|
|
177
|
+
`BUNINU_HOME` — the installation's own root, see
|
|
178
|
+
[Environment](#environment) — ends up: below the directory you named, or at
|
|
179
|
+
it. `npx buninu --install --help` lists every install option in full.
|
|
180
|
+
|
|
181
|
+
An installation is started the same two ways `npx buninu` is, by running its
|
|
182
|
+
own `bin/init.js` instead of the package name:
|
|
183
|
+
|
|
184
|
+
```sh
|
|
185
|
+
# Terminal in a browser, as usual
|
|
186
|
+
bun $BUNINU_HOME/bin/init.js
|
|
187
|
+
|
|
188
|
+
# bunmsh in this terminal (experimental)
|
|
189
|
+
bun $BUNINU_HOME/bin/init.js --local
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
Every option described under [Start](#start) works the same way here, `--local`
|
|
193
|
+
included; nothing about an installed copy behaves differently from the one
|
|
194
|
+
`npx` runs.
|
|
195
|
+
|
|
196
|
+
Installing over an existing Buninu updates it in place. Files are only added
|
|
197
|
+
and overwritten, never deleted, so anything you added of your own is left
|
|
198
|
+
alone: your `apps/<name>/` commands, your `bin/*.sh` overrides, the Bun
|
|
199
|
+
binaries `bin/bun.sh` extracted, and any working file you left in the tree.
|
|
200
|
+
|
|
201
|
+
Three files belong to you and to the package at the same time, and are merged
|
|
202
|
+
rather than replaced:
|
|
203
|
+
|
|
204
|
+
| File | What is kept |
|
|
205
|
+
|---|---|
|
|
206
|
+
| `package.json` | Your `buninu` section. Every other field, `version` included, comes from the new package. |
|
|
207
|
+
| `apps/cmdlist` | Command names you added. They are appended below the shipped list. |
|
|
208
|
+
| `.bashrc` | Your version, whenever it only adds lines to the shipped one — including lines inserted in the middle. |
|
|
209
|
+
|
|
210
|
+
When `.bashrc` cannot be merged that way, because a line the package ships was
|
|
211
|
+
changed or removed rather than added to, your file is left exactly as it is
|
|
212
|
+
and the package's version is written beside it as `.bashrc.dist` for you to
|
|
213
|
+
reconcile by hand. Nothing is overwritten silently.
|
|
214
|
+
|
|
215
|
+
Every other file belongs to the package and is replaced. Before doing that, an
|
|
216
|
+
update asks the registry what the installation originally shipped with and
|
|
217
|
+
lists the files that no longer match, so editing one of the package's own files
|
|
218
|
+
is not quietly undone:
|
|
219
|
+
|
|
220
|
+
```
|
|
221
|
+
buninu: found buninu@0.3.1 at /home/you/buninu
|
|
222
|
+
buninu: comparing it against the published 0.3.1 for local changes...
|
|
223
|
+
buninu: 1 file(s) differ from buninu@0.3.1 and will be replaced:
|
|
224
|
+
apps/xclip/xclip.js
|
|
225
|
+
Update anyway? (y/N)
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
An existing installation is always named, by absolute path, before anything is
|
|
229
|
+
written to it — `--force` included, since that one replaces it without asking.
|
|
230
|
+
|
|
231
|
+
Only `y` continues; anything else cancels and leaves the installation
|
|
232
|
+
untouched. The three merged files above are left out of that list, since they
|
|
233
|
+
are already kept. `--yes` answers for you, which is also what a script or any
|
|
234
|
+
other run without a terminal needs. Nothing about this is recorded inside the
|
|
235
|
+
installation: the published package is the reference, so the check needs the
|
|
236
|
+
network, and when it cannot run the update says so and goes ahead.
|
|
237
|
+
|
|
238
|
+
Three more things are worth knowing about:
|
|
239
|
+
|
|
240
|
+
- Installing from a checkout that already carries changes made since its
|
|
241
|
+
version was published — that is, while working on Buninu itself — compares
|
|
242
|
+
the installation against a reference its own files no longer match, so the
|
|
243
|
+
list names those unreleased changes rather than anything you did. Cloning it
|
|
244
|
+
and adding your own files on top does not.
|
|
245
|
+
- A file the package **stopped** shipping is not removed from an existing
|
|
246
|
+
installation, because an update never deletes. Stale files accumulate
|
|
247
|
+
across updates.
|
|
248
|
+
- `--force` skips both the merge and the check, and installs the shipped
|
|
249
|
+
versions over yours. It is also what installs into a non-empty directory that
|
|
250
|
+
is not a Buninu installation, which is otherwise refused — by absolute path,
|
|
251
|
+
saying which check the directory failed.
|
|
252
|
+
|
|
253
|
+
Whether a directory counts as an installation to update is decided by the name
|
|
254
|
+
in its `package.json`. An installation that has lost files, `bin/init.js`
|
|
255
|
+
included, is a damaged one rather than somebody else's directory, so installing
|
|
256
|
+
over it repairs it and still merges your configuration back in.
|
|
257
|
+
|
|
258
|
+
A source checkout's own `.git` is never copied into an installation, so
|
|
259
|
+
installing into a directory that is itself a repository leaves that repository
|
|
260
|
+
alone.
|
|
261
|
+
|
|
106
262
|
## Security
|
|
107
263
|
|
|
108
264
|
`scripts.start` binds jsgotty to `127.0.0.1` by default, so the terminal
|
|
@@ -118,19 +274,48 @@ arguments override the flags baked into `scripts.start`. Also pass
|
|
|
118
274
|
are not a substitute for authentication once the server is reachable from
|
|
119
275
|
outside the machine.
|
|
120
276
|
|
|
121
|
-
## Command-line
|
|
277
|
+
## Command-line usage
|
|
278
|
+
|
|
279
|
+
These are flags to `bin/init.js` itself, resolved before Buninu starts.
|
|
280
|
+
Everything else on the command line is forwarded to jsgotty.
|
|
122
281
|
|
|
123
282
|
```text
|
|
124
283
|
-h, --help Show command-line help
|
|
125
284
|
-V, --version Show the Buninu, Bun, platform, and architecture versions
|
|
126
|
-
--readme
|
|
127
|
-
--changelog
|
|
285
|
+
--readme Render README.md in the terminal
|
|
286
|
+
--changelog Render CHANGELOG.md in the terminal
|
|
287
|
+
--local Start bunmsh in this terminal instead of a browser terminal
|
|
288
|
+
|
|
289
|
+
-i, --install [dir] Install into <dir>/buninu (default: .)
|
|
290
|
+
-si, --strip-install [dir] Install into <dir> itself
|
|
291
|
+
--export [output.tgz] Export this installation as a tarball
|
|
292
|
+
--export-config [out.json] Export this package.json
|
|
293
|
+
|
|
294
|
+
--shell <path|name> Override buninu.shell for this run
|
|
295
|
+
--command <command> Override buninu.command for this run
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
`--install --help` lists the install options in full, including `--force` and
|
|
299
|
+
`--yes`; see [Install and update](#install-and-update) for what an update does
|
|
300
|
+
with files you changed. The other groups are covered by
|
|
301
|
+
[Start](#start), [Export](#export), [Shell selection](#shell-selection-optional)
|
|
302
|
+
and [Startup command](#startup-command-optional).
|
|
303
|
+
|
|
304
|
+
### Launching a bundled app directly
|
|
305
|
+
|
|
306
|
+
As the **first** argument, `--jsgotty`, `--jsmdcui`, or `--musl-la` bypasses the
|
|
307
|
+
shell and startup-command flow entirely: it spawns that app with every
|
|
308
|
+
remaining argument forwarded to it, and exits with its exit code.
|
|
309
|
+
|
|
310
|
+
```text
|
|
128
311
|
--jsgotty [args...] Spawn jsgotty directly and exit with its exit code
|
|
129
312
|
--jsmdcui [args...] Spawn jsmdcui directly and exit with its exit code
|
|
130
313
|
--musl-la [args...] Spawn musl-la directly and exit with its exit code
|
|
131
314
|
```
|
|
132
315
|
|
|
133
|
-
|
|
316
|
+
Use it to reach an app's own options, which Buninu would otherwise interpret
|
|
317
|
+
as its own — `npx buninu --jsgotty --help` shows jsgotty's flag reference
|
|
318
|
+
rather than this one.
|
|
134
319
|
|
|
135
320
|
## Commands inside the shell
|
|
136
321
|
|
|
@@ -204,8 +389,12 @@ host accepts either and lists both in its `_discover` response, so either name
|
|
|
204
389
|
works from the CLI, from `rpcraw`, and as an `import`.
|
|
205
390
|
|
|
206
391
|
```sh
|
|
207
|
-
|
|
208
|
-
native-bridge
|
|
392
|
+
# Load it, screen unchanged
|
|
393
|
+
native-bridge openwv 1 https://example.com
|
|
394
|
+
|
|
395
|
+
# Now bring it to the front
|
|
396
|
+
native-bridge showwv 1
|
|
397
|
+
|
|
209
398
|
native-bridge evalwv 1 document.title
|
|
210
399
|
native-bridge currwv
|
|
211
400
|
```
|
|
@@ -239,8 +428,11 @@ and a URL is loaded into that WebView and brought to the front (`openWebView`
|
|
|
239
428
|
then `showWebView`) instead of being handed to the system's default handler.
|
|
240
429
|
|
|
241
430
|
```sh
|
|
242
|
-
|
|
243
|
-
|
|
431
|
+
# In the app WebView, on screen
|
|
432
|
+
MINAPK_WEBVIEW=1 xdg-open https://example.com
|
|
433
|
+
|
|
434
|
+
# ...or for the whole session
|
|
435
|
+
export MINAPK_WEBVIEW=1
|
|
244
436
|
```
|
|
245
437
|
|
|
246
438
|
`0` is the console, so it navigates the terminal page away -- the back key
|
|
@@ -253,13 +445,43 @@ is not a plain integer is reported on stderr and ignored rather than guessed
|
|
|
253
445
|
at, an unset or empty value keeps the default behavior, and a WebView the host
|
|
254
446
|
does not have falls back to the default handler after saying so.
|
|
255
447
|
|
|
448
|
+
## Differences from upstream
|
|
449
|
+
|
|
450
|
+
The versions of jsmdcui and jsgotty bundled here differ from the ones their
|
|
451
|
+
own projects ship.
|
|
452
|
+
|
|
453
|
+
### The bundled jsmdcui
|
|
454
|
+
|
|
455
|
+
* Is configured editor-first by MDCUI_DEFAULT_EDIT
|
|
456
|
+
* The command `jmi` with a Markdown file opens the normal terminal editor.(js micro editor)
|
|
457
|
+
* The command `jsmdcui` preserves its original behavior: `apps/jsmdcui/jsmdcui.sh`, which starts its `tui` entry point with `--mdcui` when running markdown Apps, and forwards all command-line arguments.
|
|
458
|
+
* Adds the Buninu-only `# syntax: markdown` marker for Markdown highlighting in extensionless files; upstreaming may be considered later.
|
|
459
|
+
|
|
460
|
+
### The bundled jsgotty
|
|
461
|
+
|
|
462
|
+
* No longer depends on or ships `node-pty`.
|
|
463
|
+
* Its PTY is provided by Bun's terminal API.
|
|
464
|
+
|
|
256
465
|
## Export
|
|
257
466
|
|
|
258
|
-
Export
|
|
467
|
+
Export a Buninu installation as a gzip-compressed tar archive. What gets
|
|
468
|
+
exported is the installation the command runs from, so run it from your own
|
|
469
|
+
installation to capture your configuration, added commands and edited
|
|
470
|
+
`.bashrc` along with it:
|
|
471
|
+
|
|
472
|
+
```sh
|
|
473
|
+
# Everything in this installation, as ./buninu.tgz
|
|
474
|
+
bun $BUNINU_HOME/bin/init.js --export
|
|
475
|
+
|
|
476
|
+
# ...to a path of your choosing
|
|
477
|
+
bun $BUNINU_HOME/bin/init.js --export /path/to/buninu.tgz
|
|
478
|
+
```
|
|
479
|
+
|
|
480
|
+
Run it through `npx` instead and you get an archive of the freshly downloaded
|
|
481
|
+
package, with none of that — useful for a clean copy, not for a backup:
|
|
259
482
|
|
|
260
483
|
```sh
|
|
261
484
|
npx buninu@latest --export
|
|
262
|
-
npx buninu@latest --export /path/to/buninu.tgz
|
|
263
485
|
```
|
|
264
486
|
|
|
265
487
|
The default output is `./buninu.tgz`. The archive contains exactly one
|
|
@@ -267,17 +489,29 @@ top-level directory so consumers can remove one component while extracting.
|
|
|
267
489
|
Export requires `tar` in `PATH`; when replacing an existing output,
|
|
268
490
|
Buninu restores the previous file if archive creation or replacement fails.
|
|
269
491
|
|
|
270
|
-
Export this `package.json` on its own, instead of the whole installation
|
|
492
|
+
Export this `package.json` on its own, instead of the whole installation. The
|
|
493
|
+
same distinction applies — run it from your installation to get your settings,
|
|
494
|
+
through `npx` to get the defaults:
|
|
271
495
|
|
|
272
496
|
```sh
|
|
497
|
+
# The buninu section as you have configured it, as ./buninu.json
|
|
498
|
+
bun $BUNINU_HOME/bin/init.js --export-config
|
|
499
|
+
|
|
500
|
+
# ...to a path of your choosing
|
|
501
|
+
bun $BUNINU_HOME/bin/init.js --export-config /path/to/buninu.json
|
|
502
|
+
|
|
503
|
+
# The package's own defaults instead
|
|
273
504
|
npx buninu@latest --export-config
|
|
274
|
-
npx buninu@latest --export-config /path/to/buninu.json
|
|
275
505
|
```
|
|
276
506
|
|
|
277
507
|
The default output is `./buninu.json`. This is the full `package.json` (not
|
|
278
508
|
just the `buninu` section), so the output is ready to use as-is anywhere a
|
|
279
509
|
complete replacement `package.json` is expected.
|
|
280
510
|
|
|
511
|
+
A tarball made this way is also the simplest backup to take before an update
|
|
512
|
+
that is going to replace files you edited; see
|
|
513
|
+
[Install and update](#install-and-update).
|
|
514
|
+
|
|
281
515
|
## Environment
|
|
282
516
|
|
|
283
517
|
`BUNINU_HOME` is the absolute path to the installed Buninu package root.
|
|
@@ -287,11 +521,15 @@ directory as their working directory. Buninu also appends
|
|
|
287
521
|
|
|
288
522
|
Buninu preserves inherited environment variables and supplies these fallbacks:
|
|
289
523
|
|
|
290
|
-
- `HOME`: inherited value,
|
|
524
|
+
- `HOME`: inherited value; when unset, the operating system's own home
|
|
525
|
+
directory for the current user (`USERPROFILE` on Windows), falling back to
|
|
526
|
+
`BUNINU_HOME` only if that is unavailable too.
|
|
291
527
|
- `TMPDIR`: inherited value; on Android, use the app cache directory when it
|
|
292
528
|
exists or `$BUNINU_HOME/tmp` otherwise; on other platforms, use the system
|
|
293
529
|
temporary directory.
|
|
294
530
|
- `SHELL`: inherited value, or a detected platform-appropriate shell.
|
|
531
|
+
- `XDG_DATA_HOME`: inherited value, unless `buninu.xdgDataHome` names one; see
|
|
532
|
+
[Data directory](#data-directory-optional).
|
|
295
533
|
- `TERM`: `xterm-256color` when unset.
|
|
296
534
|
- `COLORTERM`: `truecolor` when unset.
|
|
297
535
|
|
|
@@ -424,6 +662,44 @@ from the directory containing `package.json`.
|
|
|
424
662
|
|
|
425
663
|
Use `--shell <path-or-name>` for a one-time override.
|
|
426
664
|
|
|
665
|
+
## Data directory (optional)
|
|
666
|
+
|
|
667
|
+
Set `buninu.xdgDataHome` in `package.json` to point `XDG_DATA_HOME` somewhere
|
|
668
|
+
of your choosing. `true` puts it inside the installation, at
|
|
669
|
+
`$BUNINU_HOME/.local/share`:
|
|
670
|
+
|
|
671
|
+
```json
|
|
672
|
+
{
|
|
673
|
+
"buninu": {
|
|
674
|
+
"xdgDataHome": true
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
```
|
|
678
|
+
|
|
679
|
+
A string names a directory instead, resolved from the directory containing
|
|
680
|
+
`package.json` when it is relative:
|
|
681
|
+
|
|
682
|
+
```json
|
|
683
|
+
{
|
|
684
|
+
"buninu": {
|
|
685
|
+
"xdgDataHome": "/mnt/usb/shared-data"
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
```
|
|
689
|
+
|
|
690
|
+
The directory is created at startup if it does not exist. Leave the setting
|
|
691
|
+
`null` and `XDG_DATA_HOME` is passed through from the environment untouched.
|
|
692
|
+
|
|
693
|
+
What this actually moves is where XDG-aware programs keep their data, and
|
|
694
|
+
**bunmsh's command history is the one that matters here**: it lives at
|
|
695
|
+
`$XDG_DATA_HOME/bunmsh/history`, so `true` is what makes a shell's history
|
|
696
|
+
travel with a copied installation instead of staying on the machine.
|
|
697
|
+
|
|
698
|
+
`HOME` is deliberately left alone by this setting. A shell started under
|
|
699
|
+
Buninu keeps pointing at your own home directory, so SSH keys, Git
|
|
700
|
+
configuration and anything else kept there still work, and bunmsh can still
|
|
701
|
+
import the `~/.bash_history` or fish history you already had.
|
|
702
|
+
|
|
427
703
|
## Back key (Android, optional)
|
|
428
704
|
|
|
429
705
|
Set `buninu.backToConsole` in `package.json` to decide what the Android host
|
package/apps/cmdlist
CHANGED
|
@@ -39,5 +39,10 @@ rz
|
|
|
39
39
|
### sz — Download a file over ZMODEM (bun apps/jsgotty/sz.js)
|
|
40
40
|
sz
|
|
41
41
|
|
|
42
|
-
### xdg-open — Open a file or URL with the platform's default handler (native bridge on Android, open/start/xdg-open elsewhere)
|
|
42
|
+
### xdg-open — Open a file or URL with the platform's default handler (native bridge on Android, open/start/xdg-open elsewhere) '
|
|
43
43
|
xdg-open
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
### bunmsh – Bun Modern Shell
|
|
47
|
+
|
|
48
|
+
bunmsh
|