🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

red-coast

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

red-coast

A CLI toolkit for AI-powered text translation, image OCR, project compression, and two-factor authentication (OTP) management.

latest
Source
npmnpm
Version
0.0.10
Version published
Maintainers
1
Created
Source

RedCoast

npm version npm downloads bundle License

中文文档

In the vast digital wilderness, information is as noisy and disordered as cosmic background radiation. To extract sparks of logic from these chaotic signals, RedCoast was born — not as a simple toolset, but as a search-and-intercept operation aimed at raw data.

Like the secret base built atop Radar Peak in the 1960s, RedCoast is designed to construct a high-powered information processing matrix that runs on local nodes, independent of external dependencies. It does not seek permission from the cloud, nor does it bow before noise. Its purpose is pure: collect, parse, reconstruct.

"We don't need to know whether other civilizations exist in the universe. We only need to be here — at our terminals — and establish our own order of civilization."

Features

  • 🌐 Translate — Translate text into 9 languages via any OpenAI-compatible LLM
  • 👁 OCR — Extract text from local images using vision models
  • 🔏 Redact — Mask sensitive information in images using vision models
  • 📦 Archive — Archive project directories respecting .gitignore
  • 📄 PDF — Process PDF files via Ghostscript (compress, convert to images, split)
  • 🔐 OTP — Manage TOTP/HOTP two-factor authentication accounts in the terminal
  • 🔧 Provider — Manage LLM providers with unified text/vision model configuration

Installation

npm install -g red-coast
# or
pnpm add -g red-coast

Quick Start

1. Configure

# Add an LLM provider (interactive prompts for API Key, Base URL, Text model, Vision model)
rc provider add openai

# Configure a command to use a provider
rc translate config
rc ocr config
rc redact config

First-time runs without config will launch an interactive setup wizard automatically.

2. Translate

# Translate inline text
rc translate "Hello, world!" --to zh

# Interactive mode
rc translate

# Auto-detect target language from system locale
rc translate "Hello" --to auto

3. OCR

# Extract text from an image
rc ocr ./screenshot.png

# Interactive mode
rc ocr

4. Redact

# Mask sensitive info in an image (auto-detects name, phone, email, DOB)
rc redact ./id-card.jpg

# Specify custom targets
rc redact ./form.png --targets "姓名,手机号,地址"

# Specify output path
rc redact ./form.png --output ./form-safe.png

5. Archive

# Archive current directory (respects .gitignore)
rc archive .

# Custom format
rc archive ./my-project --format tar.gz

# Custom output directory and name
rc archive . --output ~/Desktop --name my-backup

6. OTP

# Interactive: pick account & generate OTP
rc otp generate

# Generate for a specific account
rc otp generate "GitHub:alice@example.com"

# Generate and copy to clipboard
rc otp generate --copy

# Add a new account
rc otp add

# List all accounts with live codes
rc otp list --watch

7. Provider

Manage LLM providers. Each provider stores API credentials and model presets (text/vision).

# Add a new provider
rc provider add openai

# List all providers
rc provider list

# Show provider details
rc provider show openai

# Edit a provider (apiKey, baseURL, models)
rc provider edit openai

# Remove a provider
rc provider remove openai

Commands

translate [text]

Translate text using an LLM.

rc translate [text] [--to <lang>]
CodeLanguage
autoAuto-detect from system locale
zhChinese
enEnglish
jaJapanese
koKorean
frFrench
deGerman
esSpanish
ruRussian
arArabic

Priority: --to flag › translate.targetLang config › interactive prompt

translate config

View and modify translate settings. Existing values are pre-filled — press Enter to keep, or type a new value.

rc translate config

Prompts for: Provider selection, Default target lang, Custom prompt. Models are configured at the provider level via rc provider add/edit.

ocr [image]

Extract text from a local image using a vision model.

rc ocr [image-path]

Supported formats: .jpg .jpeg .png .gif .webp

ocr config

View and modify OCR settings. Existing values are pre-filled.

rc ocr config

Prompts for: Provider selection, Custom OCR prompt. Models are configured at the provider level via rc provider add/edit.

redact [image]

Detect and mask sensitive information in an image using a vision model. Outputs a new file with black rectangles over detected areas.

rc redact [image] [--output <path>] [--targets <targets>]
OptionDescription
-o, --outputOutput file path (default: <input>-redacted.<ext>)
-t, --targetsComma-separated targets to detect (default: 姓名,手机号,电子邮箱,出生日期)
rc redact ./id-card.jpg                          # auto-detect default targets
rc redact ./form.png --targets "姓名,手机号,地址" # custom targets
rc redact ./form.png --output ./form-safe.png    # custom output path

redact config

View and modify redact settings. Existing values are pre-filled.

rc redact config

Prompts for: Provider selection, Sensitive targets, Custom detection prompt. Models are configured at the provider level via rc provider add/edit.

archive [input]

Archive a project directory respecting .gitignore.

rc archive [input] [--format <fmt>] [--output <path>] [--name <name>]
OptionDescription
-f, --formatzip (default) · tar · tar.gz
-o, --outputOutput directory (default: same as input)
-n, --nameCustom archive name

Archive naming: <name>_v<version>.zip if package.json exists, otherwise <dir-name>.zip.

pdf <subcommand>

Process PDF files using Ghostscript. Requires Ghostscript to be installed.

rc pdf <subcommand> [input] [options]
SubcommandDescription
compressCompress a PDF file
to-imageConvert PDF pages to images
splitSplit a PDF file

Note: Ghostscript is required. It will be auto-installed via winget/brew/apt if not found.

pdf compress

Compress a PDF file to reduce file size.

rc pdf compress [input] [-o output] [-q quality]
OptionDescription
-o, --outputOutput file path (default: <input>-compressed.pdf)
-q, --qualityQuality: screen / ebook / printer / prepress / default (default: ebook)

Quality presets:

  • screen — 72 dpi, smallest size
  • ebook — 150 dpi, recommended for web
  • printer — 300 dpi, high quality
  • prepress — 300 dpi, maximum quality
  • default — preserve original quality
rc pdf compress document.pdf                    # compress with ebook quality
rc pdf compress document.pdf -q screen          # smallest size
rc pdf compress document.pdf -o small.pdf -q printer

pdf to-image

Convert PDF pages to images.

rc pdf to-image [input] [-o output-dir] [-f format] [-d dpi] [-p pages]
OptionDescription
-o, --outputOutput directory (default: same as input file)
-f, --formatImage format: png / jpg / tiff (default: png)
-d, --dpiResolution in DPI (default: 150)
-p, --pagesPage range, e.g. "1-3,5,7-"
rc pdf to-image document.pdf                    # convert all pages to PNG
rc pdf to-image document.pdf -f jpg -d 300      # high-res JPG
rc pdf to-image document.pdf -p "1-3"           # only pages 1-3

pdf split

Split a PDF file into multiple files.

rc pdf split [input] [-o output-dir] [-p pages]
OptionDescription
-o, --outputOutput directory (default: same as input file)
-p, --pagesPage range or each (default: each)
rc pdf split document.pdf                       # split each page
rc pdf split document.pdf -p "1-3,5"            # extract pages 1-3 and 5

otp <subcommand>

Manage two-factor authentication accounts. Each operation is a dedicated subcommand.

rc otp <subcommand> [account] [options]
SubcommandAliasDescription
addaAdd a new account (manual entry or otpauth:// URI)
listlsList all accounts with current OTP codes
generate [account]gGenerate OTP for an account
delete [account]delDelete an account
rename [account]mvRename an account
info [account]iShow detailed info for an account
export [file]Export accounts to a backup file
import [file]Import accounts from a backup file

Options for generate and list:

OptionDescription
-w, --watchAuto-refresh OTP codes every second
-c, --copyCopy the generated OTP to clipboard (generate only)
rc otp generate                               # interactive: pick account & generate
rc otp generate "GitHub:alice@example.com"    # generate for specific account
rc otp generate --copy                        # generate & copy to clipboard
rc otp list --watch                           # live-refresh all codes
rc otp add                                    # add a new account
rc otp delete                                 # delete an account
rc otp export backup.json                     # export to file
rc otp import backup.json                     # import from file

provider <subcommand>

Manage LLM providers. Each provider stores API credentials and model presets (text model for translate, vision model for OCR/redact).

rc provider <subcommand> [name]
SubcommandAliasDescription
add [name]Add a new provider
listlsList all providers
show [name]Show provider details
edit [name]Edit a provider
remove [name]rmRemove a provider

provider add [name]

Add a new LLM provider. Prompts for API Key, Base URL, Text model, Vision model.

rc provider add openai                  # create "openai" provider
rc provider add                         # interactive name prompt

provider list

List all providers with their API key (masked) and usage status.

rc provider list

provider show [name]

Show provider details: API key (masked), base URL, models, and which commands use it.

rc provider show openai

provider edit [name]

Edit an existing provider. Pre-fills current values as defaults. Allows changing API key, base URL, text model, vision model.

rc provider edit openai                 # edit "openai"
rc provider edit                        # interactive picker

provider remove [name]

Remove a provider. Warns if the provider is in use by any command.

rc provider remove openai               # remove "openai"
rc provider remove                      # interactive picker

Global Options

OptionDescription
--debugEnable verbose debug logging
-h, --helpShow help
-v, --versionShow version

Security

  • OTP secrets are stored in plain text in the config file — keep your system secure
  • Encrypted exports use AES-256-CBC with scrypt key derivation and require a user-set passphrase
  • Keep backup files secure, especially unencrypted exports

License

MIT License © OSpoon

Keywords

cli

FAQs

Package last updated on 10 May 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts