detached c28bbce

feat(shell): add ble.sh (Bash Line Editor) installation on first boot

- Add blesh.sh script to install ble.sh from GitHub during first boot
- Clone with --recursive --depth 1 --shallow-submodules as per official docs
- Install to ~/.local/share/blesh using make install
- Auto-configure .bashrc to source ble.sh for interactive shells
- Update Go binary installer to download blesh.sh from GitHub
- Update shell-based installer download script
- Add blesh.sh execution to first-boot service workflow

ble.sh provides advanced command-line editing features including syntax
highlighting, command completion, and improved history search.
commit
c28bbced1a619bf6ba755cabcecca1a994f7a590
author
bnema · · 2025-10-28 21:48 UTC
parent
05295f2
signature
GPG Unverified2B82207D370127A0 The key is unknown
5 files · +67 -1
M install/helpers/download.sh +1 -1
@@ -62,7 +62,7 @@ download_archup_files() {
6262
6363 # Post-boot
6464 download_section "Downloading post-boot scripts..." "post-boot" \
65- all.sh snapper.sh ufw.sh ssh-keygen.sh archup-cli.sh archup-first-boot.service
65+ all.sh snapper.sh ufw.sh ssh-keygen.sh archup-cli.sh blesh.sh archup-first-boot.service
6666
6767 # Package lists
6868 curl -sL "$GITHUB_RAW/install/base.packages" -o "$ARCHUP_INSTALL/base.packages" 2>/dev/null
@@ -62,7 +62,7 @@ download_archup_files() {
62 62
63 # Post-boot63 # Post-boot
64 download_section "Downloading post-boot scripts..." "post-boot" \64 download_section "Downloading post-boot scripts..." "post-boot" \
65- all.sh snapper.sh ufw.sh ssh-keygen.sh archup-cli.sh archup-first-boot.service65+ all.sh snapper.sh ufw.sh ssh-keygen.sh archup-cli.sh blesh.sh archup-first-boot.service
66 66
67 # Package lists67 # Package lists
68 curl -sL "$GITHUB_RAW/install/base.packages" -o "$ARCHUP_INSTALL/base.packages" 2>/dev/null68 curl -sL "$GITHUB_RAW/install/base.packages" -o "$ARCHUP_INSTALL/base.packages" 2>/dev/null
M install/post-boot/all.sh +10 -0
@@ -52,6 +52,16 @@ if [ -f /usr/local/share/archup/post-boot/archup-cli.sh ]; then
5252 fi
5353 fi
5454
55+# Install ble.sh (Bash Line Editor)
56+if [ -f /usr/local/share/archup/post-boot/blesh.sh ]; then
57+ echo "Installing ble.sh (Bash Line Editor)..." | tee -a "$LOG_FILE"
58+ if bash /usr/local/share/archup/post-boot/blesh.sh >> "$LOG_FILE" 2>&1; then
59+ echo "✓ ble.sh installed successfully" | tee -a "$LOG_FILE"
60+ else
61+ echo "✗ ble.sh installation failed (non-critical)" | tee -a "$LOG_FILE"
62+ fi
63+fi
64+
5565 echo "=== First Boot Setup Complete ===" >> "$LOG_FILE"
5666
5767 # Disable this service after first run
@@ -52,6 +52,16 @@ if [ -f /usr/local/share/archup/post-boot/archup-cli.sh ]; then
52 fi52 fi
53 fi53 fi
54 54
55+# Install ble.sh (Bash Line Editor)
56+if [ -f /usr/local/share/archup/post-boot/blesh.sh ]; then
57+ echo "Installing ble.sh (Bash Line Editor)..." | tee -a "$LOG_FILE"
58+ if bash /usr/local/share/archup/post-boot/blesh.sh >> "$LOG_FILE" 2>&1; then
59+ echo "✓ ble.sh installed successfully" | tee -a "$LOG_FILE"
60+ else
61+ echo "✗ ble.sh installation failed (non-critical)" | tee -a "$LOG_FILE"
62+ fi
63+fi
64+
55 echo "=== First Boot Setup Complete ===" >> "$LOG_FILE"65 echo "=== First Boot Setup Complete ===" >> "$LOG_FILE"
56 66
57 # Disable this service after first run67 # Disable this service after first run
A install/post-boot/blesh.sh +53 -0
@@ -0,0 +1,53 @@
1+#!/bin/bash
2+# Install and configure ble.sh (Bash Line Editor)
3+# This provides advanced command-line editing features
4+
5+set -e
6+
7+# Get the username from the system
8+USERNAME=$(ls /home | head -1)
9+
10+if [[ -z "${USERNAME}" ]]; then
11+ echo "ERROR: Could not find user for ble.sh installation"
12+ exit 1
13+fi
14+
15+USER_HOME="/home/$USERNAME"
16+BLESH_INSTALL_DIR="$USER_HOME/.local"
17+
18+echo "Installing ble.sh for user: $USERNAME"
19+
20+# Clone ble.sh repository
21+echo "Cloning ble.sh repository..."
22+cd /tmp
23+if [ -d "ble.sh" ]; then
24+ rm -rf ble.sh
25+fi
26+
27+# Run as user to avoid permission issues
28+sudo -u "$USERNAME" bash << EOF
29+set -e
30+cd /tmp
31+git clone --recursive --depth 1 --shallow-submodules https://github.com/akinomyoga/ble.sh.git
32+
33+# Build and install ble.sh
34+echo "Building and installing ble.sh..."
35+make -C ble.sh install PREFIX="$BLESH_INSTALL_DIR"
36+
37+# Add ble.sh to .bashrc if not already present
38+if ! grep -q "blesh/ble.sh" "$USER_HOME/.bashrc"; then
39+ echo "" >> "$USER_HOME/.bashrc"
40+ echo "# ble.sh - Bash Line Editor" >> "$USER_HOME/.bashrc"
41+ echo "[[ \$- == *i* ]] && source -- ~/.local/share/blesh/ble.sh" >> "$USER_HOME/.bashrc"
42+ echo "ble.sh added to .bashrc"
43+else
44+ echo "ble.sh already configured in .bashrc"
45+fi
46+EOF
47+
48+# Cleanup
49+rm -rf /tmp/ble.sh
50+
51+echo "✓ ble.sh installed successfully"
52+echo " Location: $BLESH_INSTALL_DIR/share/blesh"
53+echo " Note: ble.sh will be active on next shell session"
@@ -0,0 +1,53 @@
1+#!/bin/bash
2+# Install and configure ble.sh (Bash Line Editor)
3+# This provides advanced command-line editing features
4+
5+set -e
6+
7+# Get the username from the system
8+USERNAME=$(ls /home | head -1)
9+
10+if [[ -z "${USERNAME}" ]]; then
11+ echo "ERROR: Could not find user for ble.sh installation"
12+ exit 1
13+fi
14+
15+USER_HOME="/home/$USERNAME"
16+BLESH_INSTALL_DIR="$USER_HOME/.local"
17+
18+echo "Installing ble.sh for user: $USERNAME"
19+
20+# Clone ble.sh repository
21+echo "Cloning ble.sh repository..."
22+cd /tmp
23+if [ -d "ble.sh" ]; then
24+ rm -rf ble.sh
25+fi
26+
27+# Run as user to avoid permission issues
28+sudo -u "$USERNAME" bash << EOF
29+set -e
30+cd /tmp
31+git clone --recursive --depth 1 --shallow-submodules https://github.com/akinomyoga/ble.sh.git
32+
33+# Build and install ble.sh
34+echo "Building and installing ble.sh..."
35+make -C ble.sh install PREFIX="$BLESH_INSTALL_DIR"
36+
37+# Add ble.sh to .bashrc if not already present
38+if ! grep -q "blesh/ble.sh" "$USER_HOME/.bashrc"; then
39+ echo "" >> "$USER_HOME/.bashrc"
40+ echo "# ble.sh - Bash Line Editor" >> "$USER_HOME/.bashrc"
41+ echo "[[ \$- == *i* ]] && source -- ~/.local/share/blesh/ble.sh" >> "$USER_HOME/.bashrc"
42+ echo "ble.sh added to .bashrc"
43+else
44+ echo "ble.sh already configured in .bashrc"
45+fi
46+EOF
47+
48+# Cleanup
49+rm -rf /tmp/ble.sh
50+
51+echo "✓ ble.sh installed successfully"
52+echo " Location: $BLESH_INSTALL_DIR/share/blesh"
53+echo " Note: ble.sh will be active on next shell session"
M install/post-install/post-boot-setup.sh +2 -0
@@ -15,6 +15,7 @@ cp "$ARCHUP_INSTALL/post-boot/snapper.sh" /mnt/usr/local/share/archup/post-boot/
1515 cp "$ARCHUP_INSTALL/post-boot/ufw.sh" /mnt/usr/local/share/archup/post-boot/
1616 cp "$ARCHUP_INSTALL/post-boot/ssh-keygen.sh" /mnt/usr/local/share/archup/post-boot/
1717 cp "$ARCHUP_INSTALL/post-boot/archup-cli.sh" /mnt/usr/local/share/archup/post-boot/
18+cp "$ARCHUP_INSTALL/post-boot/blesh.sh" /mnt/usr/local/share/archup/post-boot/
1819
1920 # Make all scripts executable
2021 chmod +x /mnt/usr/local/share/archup/post-boot/*.sh
@@ -30,5 +31,6 @@ echo "First-boot service will run on first reboot to:" >> "$ARCHUP_INSTALL_LOG_F
3031 echo " - Configure snapper snapshots" >> "$ARCHUP_INSTALL_LOG_FILE"
3132 echo " - Generate SSH keys" >> "$ARCHUP_INSTALL_LOG_FILE"
3233 echo " - Build and install archup-cli from GitHub" >> "$ARCHUP_INSTALL_LOG_FILE"
34+echo " - Install and configure ble.sh (Bash Line Editor)" >> "$ARCHUP_INSTALL_LOG_FILE"
3335
3436 gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] First-boot service configured"
@@ -15,6 +15,7 @@ cp "$ARCHUP_INSTALL/post-boot/snapper.sh" /mnt/usr/local/share/archup/post-boot/
15 cp "$ARCHUP_INSTALL/post-boot/ufw.sh" /mnt/usr/local/share/archup/post-boot/15 cp "$ARCHUP_INSTALL/post-boot/ufw.sh" /mnt/usr/local/share/archup/post-boot/
16 cp "$ARCHUP_INSTALL/post-boot/ssh-keygen.sh" /mnt/usr/local/share/archup/post-boot/16 cp "$ARCHUP_INSTALL/post-boot/ssh-keygen.sh" /mnt/usr/local/share/archup/post-boot/
17 cp "$ARCHUP_INSTALL/post-boot/archup-cli.sh" /mnt/usr/local/share/archup/post-boot/17 cp "$ARCHUP_INSTALL/post-boot/archup-cli.sh" /mnt/usr/local/share/archup/post-boot/
18+cp "$ARCHUP_INSTALL/post-boot/blesh.sh" /mnt/usr/local/share/archup/post-boot/
18 19
19 # Make all scripts executable20 # Make all scripts executable
20 chmod +x /mnt/usr/local/share/archup/post-boot/*.sh21 chmod +x /mnt/usr/local/share/archup/post-boot/*.sh
@@ -30,5 +31,6 @@ echo "First-boot service will run on first reboot to:" >> "$ARCHUP_INSTALL_LOG_F
30 echo " - Configure snapper snapshots" >> "$ARCHUP_INSTALL_LOG_FILE"31 echo " - Configure snapper snapshots" >> "$ARCHUP_INSTALL_LOG_FILE"
31 echo " - Generate SSH keys" >> "$ARCHUP_INSTALL_LOG_FILE"32 echo " - Generate SSH keys" >> "$ARCHUP_INSTALL_LOG_FILE"
32 echo " - Build and install archup-cli from GitHub" >> "$ARCHUP_INSTALL_LOG_FILE"33 echo " - Build and install archup-cli from GitHub" >> "$ARCHUP_INSTALL_LOG_FILE"
34+echo " - Install and configure ble.sh (Bash Line Editor)" >> "$ARCHUP_INSTALL_LOG_FILE"
33 35
34 gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] First-boot service configured"36 gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] First-boot service configured"
M internal/config/config.go +1 -0
@@ -193,6 +193,7 @@ var PostBootScripts = []string{
193193 "ufw.sh",
194194 "ssh-keygen.sh",
195195 "archup-cli.sh",
196+ "blesh.sh",
196197 }
197198
198199 // Post-boot service template URL path
@@ -193,6 +193,7 @@ var PostBootScripts = []string{
193 "ufw.sh",193 "ufw.sh",
194 "ssh-keygen.sh",194 "ssh-keygen.sh",
195 "archup-cli.sh",195 "archup-cli.sh",
196+ "blesh.sh",
196 }197 }
197 198
198 // Post-boot service template URL path199 // Post-boot service template URL path

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 0

    ↑↓ moveenter openesc close