This is a Terminal User Interface (TUI) application built with Go and the Charm Bracelet and Bubbletea ecosystem
- Splash Screen: Displays an initial welcome message.
- Dynamic Post Fetching: Retrieves a list of MDX files from the
SpaceCoastDevs/space-coast.devGitHub repository (src/content/postdirectory). - Frontmatter Parsing: Parses YAML frontmatter from each MDX file to extract metadata (title, excerpt, date, category, tags).
- Scrollable & Filterable List: Uses
bubbles/listto display posts. Users can scroll through posts and filter them by typing. - Markdown Detail View:
- When a post is selected, its full MDX content is fetched.
- Content is rendered to the terminal using
glamour, providing basic Markdown styling. - The rendered content is displayed in a scrollable view using
bubbles/viewport.
- Footnote Link Conversion: Inline Markdown links (
[text](url)) are automatically converted to footnote style (text [1]) with a corresponding list of URLs at the bottom of the post. This improves readability and usability of links in the terminal. - Adaptive Styling: Uses
lipglossfor styling, with adaptive colors for light and dark terminal themes.
This project uses Go modules. Key dependencies include:
- github.com/charmbracelet/bubbletea: The Go framework for building TUI applications.
- github.com/charmbracelet/lipgloss: For terminal styling.
- github.com/charmbracelet/bubbles/list: For the scrollable/filterable list component.
- github.com/charmbracelet/bubbles/viewport: For the scrollable content view.
- github.com/charmbracelet/glamour: For rendering Markdown in the terminal.
- gopkg.in/yaml.v3: For parsing YAML frontmatter.
- Go (version 1.18 or later recommended).
- A terminal that supports ANSI escape codes (most modern terminals do).
-
Clone the repository (if applicable) or ensure you have the source code. If this project were in a git repository, you would clone it:
# git clone <repository-url> # cd <repository-directory>
For the current setup, ensure you are in the project directory (
/home/gilcreque/projects/ssh-space-coast.dev). -
Fetch dependencies: Go modules should handle this automatically when building. If you need to explicitly fetch them:
go mod tidy
-
Generate SSH Key You need to manually generate a key for the SSH server:
ssh-keygen -l -f ssh_host_ed25519
-
Build the application:
go build -o bbs main.go
This will create an executable named
bbs(or you can choose another name). If you rungo build, the executable will be named after the project directory (e.g.,ssh-space-coast.dev).
Execute the compiled binary:
./bbs(Replace bbs with the actual name of your executable if you chose a different one).
Execute the compiled binary in SSH mode:
./bbs ssh(Replace bbs with the actual name of your executable if you chose a different one).
- Splash Screen:
Enter: Continue to the post list.q,esc,ctrl+c: Quit the application.
- Post List Screen:
↑/k,↓/j: Scroll through posts./: Enter filter mode. Type to filter,Enterto confirm,Escto clear.Enter: View details of the selected post.b,backspace: Go back to the splash screen.q,esc: Quit the application.
- Post Detail Screen:
↑/k,↓/j,pgup,pgdn,home,end: Scroll through the post content.- Mouse wheel can also be used for scrolling.
b,backspace,q,esc: Go back to the post list.
The application logs debug information to debug.log in the same directory where it's run. This can be helpful for troubleshooting.