Skip to content

pybash1/board-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Board CLI

A Rust-based command line interface with TUI capabilities for managing Board API pastes.

Features

  • Interactive TUI interface
  • Configurable settings with TOML configuration
  • Multiple authentication methods (App Password and Device Code)
  • Create, read, and list pastes
  • Error handling
  • Configuration management

Authentication

Board CLI uses two authentication headers for API requests:

  1. Device Code (Required): Every API request requires a device code
  2. App Password (Optional): Additional authentication when needed

Device Code Authentication

Device codes are always required. Register a new device:

board register
# or
board device new

Manage device codes:

# Show current device code
board device show

# Set device code manually
board device set your_device_code_here

# Clear device code
board device clear

App Password Authentication

Set an app password in your configuration file at ~/.config/board/config.toml:

app_password = "your_app_password_here"

Special Behavior for Default API: When using the default API URL (https://board-api.pybash.xyz), the app password must be embedded from the BOARD_APP_PASSWORD environment variable at build time. This means the password value is compiled into the binary and used regardless of runtime environment variables:

# Set environment variable BEFORE building (REQUIRED for default API)
export BOARD_APP_PASSWORD="your_secure_password"
cargo build --release

The built binary will use the embedded password value on any machine, even if BOARD_APP_PASSWORD is not set in the runtime environment.

Important:

  • BOARD_APP_PASSWORD must be set at build time when using the default API URL
  • If BOARD_APP_PASSWORD is missing, empty, or contains only whitespace, the build will panic at runtime to prevent accidental deployment with invalid credentials

For other API URLs, the app password from the config file is used as normal.

If no app password is configured (either in config or environment), an empty value will be sent.

API Headers

All API requests include both headers:

  • Device-Code: your_device_code
  • App-Password: your_app_password_or_empty

Usage

# Show help
board --help

# Launch TUI
board tui

# Create a paste from stdin
echo "Hello, World!" | board create

# Get paste content by ID
board get paste_id

# List all paste IDs
board list

# Show all pastes with content
board show

# Manage device code
board device new
board device show
board device set device_code
board device clear

Configuration

Configuration is stored in ~/.config/board/config.toml:

data_dir = "~/.board-cli"
theme = "default"
auto_save = true

# Device code (required) - set automatically via CLI commands
device_code = "your_device_code_here"

# App password (optional) - set manually in config
# For the default API URL (https://board-api.pybash.xyz),
# this is ignored and BOARD_APP_PASSWORD is embedded at build time instead
app_password = "your_app_password_here"

TUI Controls

  • q or Esc: Quit

Installation

cargo build --release

Development

# Show help (default when no command given)
cargo run

# Launch TUI
cargo run -- tui

# Run tests
cargo test

Project Structure

src/
├── main.rs          # Entry point
├── cli/             # CLI argument parsing
├── tui/             # TUI interface
├── config/          # Configuration management
└── error/           # Error types

About

CLI for the Board clipboard sync app.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages