@author-today-tools/cli
v0.1.3
Published
Command-line interface for Author.Today platform
Maintainers
Readme
@author-today-tools/cli
Command-line interface for the Author.Today publishing platform. Provides CLI commands for authors and readers to interact with the platform via terminal.
Status
🚧 Phase 2 (Core Commands) In Progress
Foundation complete with configuration management, secure credential storage, and API client integration. Authentication commands are now available with browser-based login support.
Installation
# From npm (when published)
npm install -g @author-today-tools/cli
# Or with pnpm
pnpm add -g @author-today-tools/cliQuick Start
Authentication
Before using the CLI, you need to authenticate with your Author.Today account.
Browser-Based Login (Recommended)
The easiest way to authenticate is using your browser:
at-cli auth login-browserHow it works:
- A browser window opens to the Author.Today login page
- Log in using your preferred method (email/password, VK, Google, or Yandex)
- Confirm completion in the CLI
- The bearer token page opens automatically
- Copy the token and paste it into the CLI
Benefits:
- Works with social login (VK, Google, Yandex)
- Use password managers and autofill
- No password exposure in terminal
- Simple copy-paste workflow
Email/Password Login
Alternatively, authenticate directly in the terminal:
at-cli auth login [email]
# Or with password (not recommended)
at-cli auth login [email protected] --password yourpasswordNote: Interactive password prompt is more secure than passing password as an argument.
Other Auth Commands
# Check authentication status
at-cli auth whoami
# View token information
at-cli auth token
# Logout
at-cli auth logoutTroubleshooting
Browser doesn't open automatically
If the browser doesn't open, you can manually visit the URLs:
Token validation fails
- Ensure you copied the entire token value
- Check that you're logged in to Author.Today
- Try refreshing the token page and copying again
- Make sure there's no extra whitespace
"Not authenticated" errors
Run at-cli auth whoami to check authentication status. If not authenticated, run at-cli auth login-browser again.
Development
# Install dependencies
pnpm install
# Build
pnpm --filter @author-today-tools/cli build
# Run tests
pnpm --filter @author-today-tools/cli test
# Type check
pnpm --filter @author-today-tools/cli type-check
# Development mode
pnpm --filter @author-today-tools/cli devArchitecture
Foundation ✅
- Package Structure: TypeScript monorepo package with dual ESM/CJS output
- Shared Core: Uses @author-today-tools/cli-core for config, credentials, and API client
- CLI Framework: Commander.js for command routing
- Output Utilities: Formatted output with chalk, cli-table3, and ora
Implemented Features
- Phase 1: Configuration and credential management ✅
- Phase 2: Authentication commands (browser-based and email/password) ✅
Coming Soon
- Phase 2: Complete works and library commands
- Phase 3: Reading progress and notification commands
- Phase 4: Advanced search and filtering
- Phase 5: Caching system and performance optimizations
For an interactive terminal interface, see @author-today-tools/tui.
Features
Programmatic Usage
import { config, credentials, createApiClient } from '@author-today-tools/cli-core';
// Configuration management
const profile = config.getProfile();
config.setProfile('work', {
email: '[email protected]',
apiUrl: 'https://api.author.today',
});
// Credential storage
await credentials.setCredentials({
token: 'bearer-token',
expiresAt: Date.now() + 3600000,
});
// API client
const client = await createApiClient();
const works = await client.getUserLibrary();See @author-today-tools/cli-core for more details on configuration and authentication.
Technology Stack
- Runtime: Node.js 24+ (Jod)
- Language: TypeScript 5.8.3
- Build: pkgroll 2.23.0
- Testing: Vitest 4.0.18
- CLI Framework: Commander.js 12.1.0
- Shared Core: @author-today-tools/cli-core (config, credentials)
- Output: chalk 5.4.1, cli-table3 0.6.5, ora 8.1.1, boxen 8.0.1
Project Structure
packages/cli/
├── src/
│ ├── commands/ # Commander command definitions ✅
│ │ ├── auth.ts # Authentication commands
│ │ ├── works.ts # Works management
│ │ ├── chapters.ts # Chapter operations
│ │ ├── library.ts # Library browsing
│ │ ├── reading.ts # Reading progress
│ │ ├── search.ts # Search functionality
│ │ └── notifications.ts # Notifications
│ ├── utils/ # CLI utilities ✅
│ │ ├── logger.ts # Logging utility
│ │ └── formatter.ts # Output formatting
│ ├── cli.ts # Commander setup ✅
│ └── index.ts # Entry point ✅
├── tests/ # Integration tests
├── dist/ # Build output (ESM + CJS)
├── package.json
├── tsconfig.json
├── vitest.config.ts
└── README.mdLicense
MIT
