https://github.com/pybash1/board-cli
CLI for the Board clipboard sync app.
https://github.com/pybash1/board-cli
Last synced: about 1 month ago
JSON representation
CLI for the Board clipboard sync app.
- Host: GitHub
- URL: https://github.com/pybash1/board-cli
- Owner: pybash1
- Created: 2026-03-25T17:20:23.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2026-03-26T09:34:12.000Z (about 2 months ago)
- Last Synced: 2026-03-27T03:34:01.971Z (about 2 months ago)
- Language: Rust
- Size: 32.2 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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:
```bash
board register
# or
board device new
```
Manage device codes:
```bash
# 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`:
```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:
```bash
# 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
```bash
# 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`:
```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
```bash
cargo build --release
```
## Development
```bash
# 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
```