@author-today-tools/tui
v0.1.3
Published
Terminal User Interface for Author.Today platform
Maintainers
Readme
@author-today-tools/tui
Terminal User Interface for the Author.Today publishing platform. An interactive, React-based terminal application built with Ink.
Overview
The TUI provides a rich, interactive terminal interface for browsing and managing content on Author.Today:
- Dashboard - Overview of library, notifications, and reading progress
- Library Browser - Navigate your saved works with filtering and sorting
- Works Manager - View work details, chapters, and statistics
- Keyboard Shortcuts - Efficient navigation with customizable keybindings
- Multi-window Support - Task-based window management
Installation
# From npm (when published)
npm install -g @author-today-tools/tui
# Or with pnpm
pnpm add -g @author-today-tools/tuiUsage
Basic Commands
# Launch TUI (default: dashboard view)
at-tui
# Launch with specific view
at-tui --mode=library
at-tui --mode=works
at-tui --mode=dashboard
# Use specific profile
at-tui --profile=workFrom Workspace
# Launch TUI from monorepo root
pnpm tui
# With options
pnpm tui -- --mode=libraryAuthentication
Before using the TUI, authenticate using the CLI:
# Browser-based authentication (recommended)
at-cli auth login-browser
# Or email/password
at-cli auth login [email protected]The TUI uses the same authentication as the CLI (shared via @author-today-tools/cli-core).
Features
Dashboard View
- Library Overview - Total works and recent additions
- Notifications - Unread notification count
- Reading Progress - Continue reading from where you left off
- Quick Actions - Navigate to library, works, or settings
Library Browser
- Work Cards - Cover images, titles, authors, and metadata
- Filtering - By genre, status, and tags
- Sorting - By title, author, date added, or last read
- Search - Quick search across your library
- Details View - Expand work for full description and chapters
Works Manager
- Work Details - Title, author, description, tags, and statistics
- Chapter List - Browse and navigate chapters
- Actions - Like, bookmark, download
- Statistics - Views, likes, comments
Keyboard Shortcuts
Default keybindings (customizable):
q- Quit applicationTab- Switch views?- Show shortcuts help↑/↓- Navigate listsEnter- Select/activateEsc- Go back/cancel/- Search/filter
Development
# Install dependencies
pnpm install
# Build
pnpm --filter @author-today-tools/tui build
# Development mode (watch)
pnpm --filter @author-today-tools/tui dev
# Run tests
pnpm --filter @author-today-tools/tui test
# Type check
pnpm --filter @author-today-tools/tui type-checkArchitecture
Component Structure
src/
├── ui/ # React components
│ ├── App.tsx # Main app component
│ ├── Dashboard.tsx # Dashboard view
│ ├── Library.tsx # Library browser
│ ├── Works.tsx # Works manager
│ ├── components/ # Reusable UI components
│ │ ├── Button.tsx
│ │ ├── Card.tsx
│ │ ├── Menu.tsx
│ │ ├── Table.tsx
│ │ ├── chrome/ # Window chrome (MenuBar, StatusBar, etc.)
│ │ ├── forms/ # Form components
│ │ ├── feedback/ # Alerts, modals, toasts
│ │ └── layout/ # Layout components
│ └── contexts/ # React contexts
│ ├── KeyboardShortcutsContext.tsx
│ └── WindowContext.tsx
├── tasks/ # Task service for background operations
│ ├── TaskService.ts
│ └── types.ts
└── cli.ts # Entry point (Commander.js)Technology Stack
- UI Framework: Ink 5.2.0 - React for terminal
- State Management: MobX 6.15.0 - Reactive state management
- Keyboard Handling: ya-signals 1.0.1 - Signal-based keyboard shortcuts
- CLI Parser: Commander.js 12.1.0 - Command-line argument parsing
- Shared Core: @author-today-tools/cli-core - Config, credentials, API client
- API Client: @author-today-tools/api - Author.Today API wrapper
Component Library
The TUI includes a comprehensive component library built on Ink:
Basic Components:
- Button, Card, Input, Menu, Modal, Spinner, Table, Tabs
Advanced Components:
- DataGrid, EnhancedMenu, EnhancedTable, VirtualList, ContextMenu
Forms:
- Checkbox, Form, Radio, Select, TextArea with validation
Feedback:
- Alert, Badge, Modal, ProgressBar, Toast
Chrome:
- MenuBar, StatusBar, TaskBar, TitleBar
Layout:
- Layout, Panel, Splitter for complex layouts
All components are exported and can be used to build custom TUI applications.
Programmatic Usage
import { render } from 'ink';
import React from 'react';
import { App } from '@author-today-tools/tui';
import { createApiClient } from '@author-today-tools/cli-core';
// Create authenticated API client
const client = await createApiClient();
// Render TUI
const { waitUntilExit } = render(
React.createElement(App, {
client,
initialView: 'dashboard',
}),
);
// Wait for user to exit
await waitUntilExit();Testing
# Run all tests
pnpm test
# Watch mode
pnpm test:watch
# Coverage
pnpm test -- --coverageTests use ink-testing-library for component testing.
License
MIT © Artyom Zakharov
Links
- CLI Package - Command-line interface
- CLI Core Package - Shared utilities
- API Package - API client
- Ink Documentation
- Author.Today
