Skip to content

renamed-to/cli.renamed.to

Repository files navigation

renamed.to

renamed.to CLI

AI-powered file renaming, document extraction, and PDF splitting from your terminal

npm version CI Documentation License

FeaturesInstallationQuick StartCommandsWatch ModeServer



✨ Features

🤖 AI-Powered Renaming
Intelligently rename files based on content analysis

📁 Smart Organization
Auto-organize files into AI-suggested folder structures

📄 Document Extraction
Extract structured data from invoices, receipts, contracts

✂️ PDF Splitting
Split multi-page PDFs using AI or rule-based methods

👁️ Watch Mode
Auto-process files as they arrive in watched directories

🔐 Secure Auth
OAuth device flow — no secrets to manage


📦 Installation

npm pnpm Homebrew
npm install -g @renamed-to/cli
pnpm add -g @renamed-to/cli
brew install renamed-to/tap/renamed

🚀 Quick Start

# 1. Authenticate with your renamed.to account
renamed auth device

# 2. Rename files using AI
renamed rename invoice.pdf receipt.jpg

# 3. Extract data from documents
renamed extract invoice.pdf --schema invoice

# 4. Split PDFs intelligently
renamed pdf-split multi-doc.pdf --wait
🎬 See it in action
$ renamed rename screenshot.png
✔ Analyzing screenshot.png...
  screenshot.png → 2024-01-15_product-mockup.png

$ renamed rename --apply *.pdf
✔ Renamed 3 files
  invoice-scan.pdf     → 2024-01-10_acme-corp-invoice-4521.pdf
  contract.pdf         → 2024-01-08_service-agreement-clientco.pdf
  receipt-photo.pdf    → 2024-01-15_amazon-order-12345.pdf

📖 Commands

🔑 Authentication

renamed auth device           # OAuth device flow (recommended)
renamed auth login --token X  # Use API token
renamed auth logout           # Remove stored credentials
renamed auth whoami           # Show current user

The device flow uses a built-in public client ID — no configuration needed.


📝 File Renaming

renamed rename <files...> [options]
Option Description
-a, --apply Automatically apply suggested names
-o, --output-dir <dir> Base directory for organized output (uses AI folder suggestions)
Examples
# Get suggestions
renamed rename screenshot.png

# Apply automatically
renamed rename --apply *.pdf

# Organize into folders
renamed rename --apply --output-dir ~/Documents/organized ~/Downloads/*.jpg

📊 Document Extraction

renamed extract <file> [options]
Option Description
-s, --schema <type> Schema: invoice, receipt, contract, resume, custom
-f, --fields <list> Comma-separated fields for custom schema
-o, --output <format> Output: json (default), table, csv
Examples
# Extract invoice data
renamed extract invoice.pdf --schema invoice

# Custom fields
renamed extract doc.pdf --schema custom --fields "name,date,total"

# Output as CSV
renamed extract receipt.jpg --schema receipt --output csv

✂️ PDF Splitting

renamed pdf-split <file> [options]
Option Description
-m, --mode <mode> smart (AI), every-n-pages, by-bookmarks
-i, --instructions <text> AI instructions for smart mode
-n, --pages-per-split <n> Pages per split (for every-n-pages)
-o, --output-dir <dir> Output directory
-w, --wait Wait for completion and download files
Examples
# AI-powered splitting
renamed pdf-split merged.pdf --wait

# Split by invoice numbers
renamed pdf-split invoices.pdf -i "Split by invoice number" --wait

# Fixed page intervals
renamed pdf-split book.pdf --mode every-n-pages -n 10 --wait

👁️ Watch Mode

Monitor directories and automatically organize files using AI:

renamed watch <directory> [options]
Option Description
-p, --patterns <glob...> File patterns (default: *.pdf *.jpg *.png)
-o, --output-dir <dir> Base output directory for organized files
-f, --failed-dir <dir> Directory for files that fail processing
-n, --dry-run Preview without moving files
--concurrency <n> Parallel processing (1-10, default: 2)
Example: Organize Downloads folder
renamed watch ~/Downloads --output-dir ~/Documents/organized

Files are organized into AI-suggested folder structures:

~/Documents/organized/
├── invoices/
│   └── 2024/
│       └── acme-invoice-001.pdf
├── receipts/
│   └── amazon-order-12345.pdf
└── contracts/
    └── service-agreement.pdf

🖥️ Server Deployment

Run as a systemd service on Linux servers:

# Install service
sudo cp examples/systemd/renamed.service /etc/systemd/system/
sudo systemctl enable renamed
sudo systemctl start renamed

# Check health
echo "" | nc -U /tmp/renamed-health.sock

See SERVER-SETUP.md for full documentation.


⚙️ Configuration

renamed config init              # Create user config
renamed config init --global     # Create system config
renamed config validate          # Validate config files
renamed config show              # Display effective configuration
Example config file

~/.config/renamed/config.yaml:

watch:
  patterns: ["*.pdf", "*.jpg", "*.png"]
rateLimit:
  concurrency: 2
  retryAttempts: 3
health:
  enabled: true
  socketPath: "/tmp/renamed-health.sock"
logging:
  level: info
  json: false

🌍 Environment Variables

Variable Description
RENAMED_API_TOKEN API token for authentication
RENAMED_CLIENT_ID Custom OAuth client ID
RENAMED_CLIENT_SECRET OAuth client secret (confidential clients)

📋 Supported Files

Type Formats Max Size
📄 Documents PDF 100MB (split), 25MB (other)
🖼️ Images JPG, JPEG, PNG, TIFF 25MB

🛠️ Development

git clone https://github.com/renamed-to/cli.renamed.to.git
cd cli.renamed.to
pnpm install
pnpm build
pnpm test

WebsiteDocumentationIssues

Built with ❤️ by the renamed.to team

About

AI-powered CLI for smart file renaming, document extraction, and PDF splitting

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages