Skip to content

Latest commit

Β 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Hulunote TUI

A terminal-based user interface client for Hulunote, an outliner note-taking application. Built with Rust using the Ratatui framework.

Features

  • Full Hulunote Integration: Login, manage databases, notes, and outline navigation
  • Vim-style Navigation: Use j/k for movement, gg/G for jumping, h/l for expand/collapse
  • Outline Editing: Create, edit, delete, and reorganize outline nodes
  • Command Palette: Quick access to all actions via Ctrl+P
  • Search: Find notes across all databases with Ctrl+S or /
  • Persistent Login: Automatically saves your session token
  • Monokai Pro Theme: Beautiful dark theme optimized for black terminal backgrounds

Theme

Hulunote TUI uses the Monokai Pro color scheme, featuring:

Color Hex Usage
🟑 Yellow #ffd866 Active/selected items, highlights
πŸ”΅ Cyan #78dce8 Borders, info, keyboard shortcuts
🟒 Green #a9dc76 Success, create actions
πŸ”΄ Red #ff6188 Errors, delete actions
🟠 Orange #fc9867 Loading states, warnings
🟣 Purple #ab9df2 Tree markers, special elements

Background: #2d2a2e (dark gray)

Installation

Prerequisites

  • Rust toolchain (1.70+)
  • A running Hulunote server
  • Terminal with Nerd Font support (for icons)

Build from Source

git clone https://github.com/your-repo/hulunote-tui.git
cd hulunote-tui
cargo build --release
  • or cargo run
cargo run -- --server https://www.hulunote.top/

The binary will be located at target/release/hulunote-tui.

Install with Cargo

cargo install --path .

Usage

Basic Usage

# Connect to default server (localhost:6689)
hulunote-tui

# Connect to a specific server
hulunote-tui --server http://your-server:6689
# or
hulunote-tui -s http://your-server:6689

Command Line Options

Option Description Default
-s, --server <URL> Hulunote server URL http://localhost:6689
-h, --help Show help information -
-V, --version Show version -

Keyboard Shortcuts

Global Shortcuts

Key Action
Ctrl+C / Ctrl+Q Quit application
Ctrl+P Open command palette
Ctrl+D Go to databases
Ctrl+S Open search
Ctrl+H Toggle help
Ctrl+L Logout
Ctrl+R Refresh current view
Ctrl+N Create new item

Navigation (List Views)

Key Action
j / ↓ Move down
k / ↑ Move up
gg Go to first item
G Go to last item
Enter Select / Open
q / Esc Go back
? Toggle help
/ Open search

Database List

Key Action
n Create new database
d Delete selected database
r Refresh list

Note List

Key Action
n Create new note
d Delete selected note
s Toggle shortcut
r Refresh list

Outline View

Key Action
h / ← Collapse node
l / β†’ Expand node
Space Toggle expand/collapse
Enter / e Edit current node
a Add child node
o Add sibling node
d Delete current node
J Move node down
K Move node up
Tab Indent (make child of previous sibling)
Shift+Tab Outdent (make sibling of parent)
r Refresh outline

Command Palette

The command palette (Ctrl+P) supports the following commands:

Command Aliases Description
login signin Go to login screen
logout signout, exit Logout and return to login
databases db, dbs Go to databases list
notes n Go to notes list
search s, find Open search
help ?, h Show help
quit q, close Quit application
refresh r, reload Refresh current view
new create, add Create new item
delete del, rm, remove Delete selected item

Configuration

Configuration files are stored in ~/.hulunote/:

File Description
config.json Application configuration (server URL, etc.)
token Saved authentication token for persistent login

Example config.json

{
  "server_url": "http://localhost:6689"
}

Screens

Login Screen

Enter your Hulunote email and password to authenticate. Use Tab to switch between email and password fields.

Database List

View and manage your Hulunote databases. Select a database to view its notes.

Note List

Browse notes within the selected database. Notes marked as shortcuts are highlighted with a star icon.

Outline View

The main editing interface. View and edit the hierarchical outline structure of your notes with full tree navigation and manipulation.

Search

Search across all notes in all databases. Results show matching note titles.

Architecture

src/
β”œβ”€β”€ main.rs          # Application entry point and event loop
β”œβ”€β”€ app.rs           # Application state and business logic
β”œβ”€β”€ config.rs        # Configuration management
β”œβ”€β”€ event.rs         # Keyboard event handling and text input
β”œβ”€β”€ api/             # API client modules
β”‚   β”œβ”€β”€ client.rs    # HTTP client wrapper
β”‚   β”œβ”€β”€ auth.rs      # Authentication endpoints
β”‚   β”œβ”€β”€ database.rs  # Database management endpoints
β”‚   β”œβ”€β”€ note.rs      # Note management endpoints
β”‚   └── nav.rs       # Outline navigation endpoints
β”œβ”€β”€ models/          # Data structures
└── ui/              # UI rendering modules
    β”œβ”€β”€ mod.rs       # Main UI renderer
    β”œβ”€β”€ theme.rs     # Monokai Pro color theme
    β”œβ”€β”€ login.rs     # Login screen
    β”œβ”€β”€ database_list.rs  # Database list screen
    β”œβ”€β”€ note_list.rs      # Note list screen
    β”œβ”€β”€ outline.rs   # Outline editor screen
    β”œβ”€β”€ search.rs    # Search screen
    β”œβ”€β”€ help.rs      # Help overlay
    └── command.rs   # Command palette

Dependencies

  • ratatui: Terminal UI framework
  • crossterm: Cross-platform terminal manipulation
  • tokio: Async runtime
  • reqwest: HTTP client
  • serde/serde_json: JSON serialization
  • clap: Command line argument parsing
  • anyhow: Error handling

Troubleshooting

Connection Issues

If you see connection errors:

  1. Verify the Hulunote server is running
  2. Check the server URL is correct (avoid using 0.0.0.0 as client address)
  3. Ensure no proxy software (like ClashX) is intercepting local connections

Authentication Errors

If login fails or you get "Authentication failed":

  1. Clear the saved token: rm ~/.hulunote/token
  2. Try logging in again with correct credentials

Display Issues

If the UI doesn't render correctly:

  1. Ensure your terminal supports 256 colors or True Color (24-bit)
  2. Use a terminal with Nerd Font installed for proper icon display
  3. Try resizing your terminal window
  4. Recommended terminals: iTerm2, Alacritty, Kitty, WezTerm

Icons Not Displaying

This app uses Nerd Font icons. If you see boxes or question marks:

  1. Install a Nerd Font
  2. Set your terminal to use the Nerd Font
  3. Popular choices: JetBrainsMono Nerd Font, FiraCode Nerd Font, Hack Nerd Font

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

About

Hulunote TUI

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages