Skip to content

Commit 980d6f6

Browse files
committed
License and Readme! More doc polishing
1 parent 2871596 commit 980d6f6

10 files changed

Lines changed: 199 additions & 69 deletions

File tree

.github/workflows/release.yml

Lines changed: 63 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -2,72 +2,72 @@
22
name: Release
33

44
permissions:
5-
contents: write
6-
id-token: write
7-
attestations: write
5+
contents: write
6+
id-token: write
7+
attestations: write
88

99
on:
10-
release:
11-
types: [created]
10+
release:
11+
types: [created]
1212

1313
env:
14-
CARGO_TERM_COLOR: always
14+
CARGO_TERM_COLOR: always
1515

1616
jobs:
17-
upload-assets:
18-
strategy:
19-
matrix:
20-
include:
21-
- target: x86_64-unknown-linux-gnu
22-
os: ubuntu-latest
23-
- target: x86_64-apple-darwin
24-
os: macos-latest
25-
- target: x86_64-pc-windows-msvc
26-
os: windows-latest
27-
runs-on: ${{ matrix.os }}
28-
steps:
29-
- uses: actions/checkout@v4
30-
- name: Get Dependencies (Linux)
31-
shell: bash
32-
run: sudo apt-get update && sudo apt-get install -y libudev-dev
33-
if: startsWith(matrix.os, 'ubuntu')
34-
# Nevermind :(
35-
# After I got it working, I thought about it and realized that
36-
# any subsequent releases (i.e. -pre.1) would be annoying.
37-
# - name: Conditionally add -pre to built version number (Ubuntu)
38-
# if: endsWith(github.event.release.tag_name, '-pre') && startsWith(matrix.os, 'ubuntu')
39-
# run: sed -i -E 's/^(version = ")([^"]+)"/\1\2-pre"/' Cargo.toml
40-
# - name: Conditionally add -pre to built version number (MacOS)
41-
# if: endsWith(github.event.release.tag_name, '-pre') && startsWith(matrix.os, 'macos')
42-
# run: sed -i '' -E 's/^(version = ")([^"]+)"/\1\2-pre"/' Cargo.toml
43-
# - name: Conditionally add -pre to built version number (Windows)
44-
# if: endsWith(github.event.release.tag_name, '-pre') && startsWith(matrix.os, 'windows')
45-
# shell: pwsh
46-
# run: (Get-Content Cargo.toml) -replace '^(version = ")([^"]+)(")', '${1}${2}-pre${3}' | Set-Content Cargo.toml
47-
- name: Build and Publish yap-full
48-
uses: taiki-e/upload-rust-binary-action@v1
49-
with:
50-
bin: yap
51-
features: yap-full
52-
target: ${{ matrix.target }}
53-
# include: LICENSE,README.md
54-
tar: unix
55-
zip: windows
56-
archive: $bin-full-$tag-$target
57-
token: ${{ secrets.GITHUB_TOKEN }}
58-
checksum: sha512
59-
- name: Build and Publish yap-lite
60-
uses: taiki-e/upload-rust-binary-action@v1
61-
with:
62-
bin: yap
63-
features: yap-lite
64-
target: ${{ matrix.target }}
65-
# include: LICENSE,README.md
66-
tar: unix
67-
zip: windows
68-
archive: $bin-lite-$tag-$target
69-
token: ${{ secrets.GITHUB_TOKEN }}
70-
checksum: sha512
71-
# - uses: actions/attest-build-provenance@v1
72-
# with:
73-
# subject-path: "**/*.tar.gz,**/*.zip"
17+
upload-assets:
18+
strategy:
19+
matrix:
20+
include:
21+
- target: x86_64-unknown-linux-gnu
22+
os: ubuntu-latest
23+
- target: x86_64-apple-darwin
24+
os: macos-latest
25+
- target: x86_64-pc-windows-msvc
26+
os: windows-latest
27+
runs-on: ${{ matrix.os }}
28+
steps:
29+
- uses: actions/checkout@v4
30+
- name: Get Dependencies (Linux)
31+
shell: bash
32+
run: sudo apt-get update && sudo apt-get install -y libudev-dev
33+
if: startsWith(matrix.os, 'ubuntu')
34+
# Nevermind :(
35+
# After I got it working, I thought about it and realized that
36+
# any subsequent releases (i.e. -pre.1) would be annoying.
37+
# - name: Conditionally add -pre to built version number (Ubuntu)
38+
# if: endsWith(github.event.release.tag_name, '-pre') && startsWith(matrix.os, 'ubuntu')
39+
# run: sed -i -E 's/^(version = ")([^"]+)"/\1\2-pre"/' Cargo.toml
40+
# - name: Conditionally add -pre to built version number (MacOS)
41+
# if: endsWith(github.event.release.tag_name, '-pre') && startsWith(matrix.os, 'macos')
42+
# run: sed -i '' -E 's/^(version = ")([^"]+)"/\1\2-pre"/' Cargo.toml
43+
# - name: Conditionally add -pre to built version number (Windows)
44+
# if: endsWith(github.event.release.tag_name, '-pre') && startsWith(matrix.os, 'windows')
45+
# shell: pwsh
46+
# run: (Get-Content Cargo.toml) -replace '^(version = ")([^"]+)(")', '${1}${2}-pre${3}' | Set-Content Cargo.toml
47+
- name: Build and Publish yap-full
48+
uses: taiki-e/upload-rust-binary-action@v1
49+
with:
50+
bin: yap
51+
features: yap-full
52+
target: ${{ matrix.target }}
53+
include: LICENSE,README.md,example_configs
54+
tar: unix
55+
zip: windows
56+
archive: $bin-full-$tag-$target
57+
token: ${{ secrets.GITHUB_TOKEN }}
58+
checksum: sha512
59+
- name: Build and Publish yap-lite
60+
uses: taiki-e/upload-rust-binary-action@v1
61+
with:
62+
bin: yap
63+
features: yap-lite
64+
target: ${{ matrix.target }}
65+
include: LICENSE,README.md,example_configs
66+
tar: unix
67+
zip: windows
68+
archive: $bin-lite-$tag-$target
69+
token: ${{ secrets.GITHUB_TOKEN }}
70+
checksum: sha512
71+
# - uses: actions/attest-build-provenance@v1
72+
# with:
73+
# subject-path: "**/*.tar.gz,**/*.zip"

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 nullstalgia
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# yap - A friendly serial terminal.
2+
3+
[![Build](https://github.com/nullstalgia/yap/actions/workflows/build.yml/badge.svg)](https://github.com/nullstalgia/yap/actions/workflows/build.yml) [![Release](https://github.com/nullstalgia/yap/actions/workflows/release.yml/badge.svg)](https://github.com/nullstalgia/yap/actions/workflows/release.yml)
4+
5+
<img width="1080" height="607" alt="a split view of yap's port selection screen and port interaction screen" src="https://github.com/user-attachments/assets/fa42e8e8-5481-4600-8c6f-532a4a86d4d9" />
6+
7+
### Features
8+
9+
- User-friendly interface for interacting with Serial/COM ports.
10+
- Optional Pseudo-shell mode to allow preparing an input before sending, with history.
11+
- Intelligent auto-reconnect (checks for devices with matching characteristics, if port path changes unexpectedly).
12+
- Text can be colored by incoming ANSI commands, or by user-created color rules, supporting matching by either regex or string literals.
13+
- Connect to a device from the command line by supplying USB PID+VID
14+
- Log recieved port data to disk as UTF-8 processed text and/or raw bytes.
15+
- Macros with categories to organize commonly sent payloads.
16+
- Support for flashing connected ESP32 devices with .bin/.elf files!
17+
- Powered by [esp-rs/espflash](https://github.com/esp-rs/espflash)!
18+
- Support for decoding incoming bytes as [defmt](https://github.com/knurling-rs/defmt) frames.
19+
- Configurable keybinds, including for Macros and ESP32 flashing!
20+
- Keybinds can have several actions that run in order, so you can flash a device and send setup commands if it finishes successfully.
21+
- Hex view to see raw contents of incoming inputs.
22+
- Allow hiding specific devices from Port Selection screen.
23+
- Releases downloaded from GitHub can self-update!
24+
- Cross-Platform!
25+
26+
# Showcase
27+
28+
### Auto-Reconnection Example:
29+
https://github.com/user-attachments/assets/647d0172-3f79-4d47-974d-48f344adc645
30+
31+
### espflash Flashing Example:
32+
https://github.com/user-attachments/assets/d14e6aa2-51d1-489f-b8ba-ca88f74ad3d2

example_configs/Config.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
Most options are configurable in-app, but some settings reside solely in the `yap.toml`.
2+
3+
```toml
4+
[misc]
5+
log_level = "Trace" ## Max Tracing log level to print
6+
log_tcp_socket = "127.0.0.1:7331" ## Send Tracing log events as text over TCP to this socket
7+
8+
[espflash]
9+
skip_erase_confirm = false ## Skip needing to press Enter Twice when selecting Erase Flash.
10+
11+
[updates]
12+
allow_pre_releases = false ## Also checking for new pre-releases when checking for updates.
13+
14+
[ignored_devices]
15+
show_ttys_ports = false ## Unix only: Show the virtual console ports (/dev/ttyS*)
16+
usb = ["28DE:2102"] ## Ignore ports by USB VID:PID or VID:PID:Serial
17+
# Default set of ignored devices:
18+
# (You can manually remove them from the filter yourself,
19+
# but they will be placed back in if the field ever needs to be regenerated from defaults.)
20+
#
21+
# - Valve Index/Bigscreen Beyond's Bluetooth COM Port (Watchman)
22+
# VID: 28DE, PID: 2102
23+
name = [] ## Ignore ports by name/path
24+
```

example_configs/macros/example_macros.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# content = "ping 1.1.1.1" ## content to send
55
# line_ending = "\n\n\n" ## (optional) if not provided, uses the configured Macro line ending in Port Settings
66

7-
category = "Examples" ## name is optional, if missing, will use file name
7+
category = "Examples" ## category is optional, if missing, will use file name
88

99
[[macro]]
1010
name = "Backspace"

example_configs/macros/openshock.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name = "OpenShock" ## name is optional, if missing, will use file name
1+
category = "OpenShock" ## category is optional, if missing, will use file name
22

33
[[macro]]
44
name = "Version"
@@ -14,8 +14,8 @@ content = "sysinfo"
1414

1515
[[macro]]
1616
name = "Get Config (JSON)"
17-
content = "jsonconfig "
17+
content = "jsonconfig"
1818

1919
[[macro]]
2020
name = "Get Config (Raw)"
21-
content = "rawconfig "
21+
content = "rawconfig"

example_configs/macros/openshock_setup.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name = "OpenShock Setup" ## name is optional, if missing, will use file name
1+
category = "OpenShock Setup" ## category is optional, if missing, will use file name
22

33
[[macro]]
44
name = "Factory Reset"

example_configs/yap_colors.toml.blank

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,48 @@
2222

2323
# Supported colors can be seen here:
2424
# https://docs.rs/ratatui/latest/ratatui/style/enum.Color.html
25+
26+
## OpenShock Log Line Highlighting Examples
27+
28+
# Verbose
29+
# [[regex]]
30+
# rule = '^\[\s*\d+\]\[V\]\[[^\]:]+(?::\d+)?\]'
31+
# color = "magenta"
32+
# line = true
33+
34+
# Debug
35+
# [[regex]]
36+
# rule = '^\[\s*\d+\]\[D\]\[[^\]:]+(?::\d+)?\]'
37+
# color = "blue"
38+
# line = true
39+
40+
# Info
41+
# [[regex]]
42+
# rule = '^\[\s*\d+\]\[I\]\[[^\]:]+(?::\d+)?\]'
43+
# color = "green"
44+
# line = true
45+
46+
# Warning
47+
# [[regex]]
48+
# rule = '^\[\s*\d+\]\[W\]\[[^\]:]+(?::\d+)?\]'
49+
# color = "yellow"
50+
# line = true
51+
52+
# Error
53+
# [[regex]]
54+
# rule = '^\[\s*\d+\]\[E\]\[[^\]:]+(?::\d+)?\]'
55+
# color = "red"
56+
# line = true
57+
58+
## Misc Examples
59+
60+
# Censor scanned networks from OpenShock captive portal
61+
# [[regex]]
62+
# rule = '[Nn]etwork\s+(.+?)\s*\(([0-9A-Fa-f:]+)\)'
63+
# censor = true
64+
65+
# # \x1B[K
66+
# [[regex]]
67+
# rule = '(?-u)\x1b\x5b\x4b'
68+
# color = "red"
69+
# line = true

src/panic_handler.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use color_eyre::Result;
22
use ratatui::crossterm::event::DisableMouseCapture;
3+
use std::backtrace::Backtrace;
34

45
pub fn initialize_panic_handler() -> Result<()> {
56
let (panic_hook, eyre_hook) = color_eyre::config::HookBuilder::default()
@@ -16,6 +17,8 @@ pub fn initialize_panic_handler() -> Result<()> {
1617
_ = ratatui::crossterm::execute!(std::io::stdout(), DisableMouseCapture);
1718

1819
let msg = format!("{}", panic_hook.panic_report(panic_info));
20+
let backtrace = Backtrace::force_capture();
21+
let backtrace_str = format!("{backtrace}");
1922
#[cfg(not(debug_assertions))]
2023
{
2124
eprintln!("{msg}");
@@ -34,6 +37,10 @@ pub fn initialize_panic_handler() -> Result<()> {
3437
.expect("human-panic: printing error message to console failed");
3538
}
3639
tracing::log::error!("Error: {}", strip_ansi_escapes::strip_str(msg));
40+
tracing::log::error!(
41+
"Backtrace:\n{}",
42+
strip_ansi_escapes::strip_str(backtrace_str.as_str())
43+
);
3744

3845
#[cfg(debug_assertions)]
3946
{

src/settings/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ pub struct Logging {
296296
#[derivative(Default(value = "true"))]
297297
/// Log any disconnect and reconnect events in text outputs.
298298
pub log_connection_events: bool,
299+
// TODO maybe add option to strip ansi escapes for text output?
299300
}
300301

301302
#[serde_inline_default]
@@ -650,7 +651,7 @@ pub struct Ignored {
650651

651652
fn default_hidden_usb() -> Vec<DeserializedUsb> {
652653
vec![
653-
// Valve Index/Bigscreen Beyond's Bluetooth COM Port
654+
// Valve Index/Bigscreen Beyond's Bluetooth COM Port (Watchman)
654655
DeserializedUsb {
655656
vid: 0x28DE,
656657
pid: 0x2102,

0 commit comments

Comments
 (0)