New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

zerohost-cli

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zerohost-cli

Command-line interface for ZeroHost ephemeral text sharing

latest
Source
npmnpm
Version
1.1.1
Version published
Maintainers
1
Created
Source

ZeroHost CLI

Command-line interface for ZeroHost ephemeral text sharing

Share text, code, and files securely from your terminal. All shares are automatically deleted after expiry with zero data retention.

Installation

# Install globally with npm
npm install -g zerohost-cli

# Install globally with yarn
yarn global add zerohost-cli

# Or use npx (no installation required)
npx zerohost-cli "Hello, world!"

Quick Start

# Share text directly
zerohost "Hello, world!"

# Share from file
zerohost --file README.md

# Share from stdin (pipe)
echo "Hello, world!" | zerohost
cat file.txt | zerohost

# Interactive mode
zerohost --interactive

Features

  • 🔒 Privacy-first: No permanent storage, automatic deletion
  • Fast: Share in seconds from any terminal
  • 🔑 API Key Support: Premium features for PRO users
  • 📱 QR Codes: Share links via QR code
  • 📋 Clipboard: Auto-copy URLs to clipboard
  • 🔥 Burn After Reading: Self-destruct after first view
  • 🛡️ Password Protection: Secure sensitive content
  • 🎯 Smart Detection: Auto-detect file types for syntax highlighting
  • 🏷️ Reference Labels: Track shares with custom labels (visible in account dashboard)

Usage

Basic Commands

# Share text
zerohost "Your text here"

# Share with custom expiry
zerohost "Expires in 1 hour" --expires 1h

# Password protect
zerohost "Secret content" --password mypassword

# Burn after reading
zerohost "Self-destruct message" --burn

# Add reference label for tracking
zerohost "Deploy logs" --reference deploy-1

# Combine options
zerohost "Secret code" --expires 2h --password secret --burn --qr --reference ticket-42

File Sharing

# Share a file
zerohost --file script.py

# Share with custom expiry
zerohost --file config.json --expires 1d

# Share and show QR code
zerohost --file README.md --qr

Piping Content

# From command output
ls -la | zerohost
ps aux | zerohost --expires 1h

# From file
cat /var/log/nginx/access.log | zerohost

# From curl response
curl -s https://api.github.com/user | zerohost --expires 2h

Interactive Mode

zerohost --interactive

Interactive mode allows you to:

  • Enter content in your default editor
  • Choose expiry time from a menu
  • Set password protection
  • Enable burn after reading
  • Generate QR codes

Authentication

For premium features, authenticate with your API key:

# Login (saves API key locally)
zerohost --login

# Use API key for single command
zerohost "text" --api-key YOUR_API_KEY

# Check authentication status
zerohost --config

# Logout
zerohost --logout

Premium Features (PRO Plan)

  • Unlimited shares (vs 2/day free limit)
  • Custom expiry times up to 7 days
  • Password protection
  • API key authentication
  • Priority support

Get your API key from your ZeroHost account dashboard.

Options

OptionAliasDescriptionExample
--file <path>-fShare content from file--file script.py
--expires <time>-eExpiry time (1h, 24h, 1w)--expires 2h
--password <pwd>-pPassword protect--password secret
--burn-bBurn after reading--burn
--reference <ref>-rReference label for tracking (max 8 chars)--reference deploy-1
--interactive-iInteractive mode--interactive
--qr-qShow QR code--qr
--copy-cCopy to clipboard--copy
--api-key <key>Use API key--api-key abc123
--silentMinimal output--silent
--configShow configuration--config
--loginAuthenticate--login
--logoutRemove auth--logout

Examples

Development Workflow

# Share build logs with reference for tracking
npm run build 2>&1 | zerohost --expires 1d --reference build-42

# Share git diff with password and reference
git diff | zerohost --password review --expires 2h --reference PR-123

# Share error logs (burn after reading)
tail -100 /var/log/app.log | zerohost --burn --reference error-log

# Share configuration with tracking label
zerohost --file .env.example --expires 1h --qr --reference dev-env

System Administration

# Share system info
uname -a | zerohost
df -h | zerohost --expires 1h

# Share process list
ps aux | grep nginx | zerohost

# Share network configuration
ifconfig | zerohost --password sysadmin

Code Sharing

# Share code snippets
zerohost --file function.js --expires 1d --copy

# Share with syntax highlighting hint
zerohost --file script.py  # Auto-detected as Python

# Share repository state
git log --oneline -10 | zerohost

Configuration

The CLI stores configuration in your system's config directory:

  • macOS: ~/Library/Preferences/zerohost-cli/config.json
  • Linux: ~/.config/zerohost-cli/config.json
  • Windows: %APPDATA%/zerohost-cli/config.json

Configuration includes:

  • Stored API key (encrypted)
  • Default preferences
  • Usage statistics

Environment Variables

VariableDescriptionExample
ZEROHOST_API_KEYDefault API keyexport ZEROHOST_API_KEY=abc123
ZEROHOST_BASE_URLCustom API endpointFor development only
NO_COLORDisable colored outputexport NO_COLOR=1

Exit Codes

CodeDescription
0Success
1General error
2Authentication error
3Network error
4File not found
5Invalid input

Troubleshooting

Common Issues

"Command not found"

# Make sure it's installed globally
npm list -g zerohost-cli

# Or use npx
npx zerohost-cli --version

"API key invalid"

# Re-authenticate
zerohost --logout
zerohost --login

# Or check your account dashboard for the correct key

"Network error"

# Check internet connection
curl -I https://zerohost.net

# Try with verbose output
zerohost "test" --verbose

"Rate limit exceeded"

  • Free users: Wait for daily limit reset
  • Or upgrade to PRO for unlimited shares

Debug Mode

# Enable debug output
DEBUG=zerohost* zerohost "test content"

# Check configuration
zerohost --config

# Test API connection
zerohost --login

Development

# Clone repository
git clone https://github.com/zerohost-official/cli.git
cd cli

# Install dependencies
npm install

# Run in development
npm run dev

# Run tests
npm test

# Build for production
npm run build

Contributing

  • Fork the repository
  • Create a feature branch: git checkout -b feature/amazing-feature
  • Commit changes: git commit -am 'Add amazing feature'
  • Push to branch: git push origin feature/amazing-feature
  • Submit a pull request

Security

Report security vulnerabilities to security@zerohost.net.

License

MIT © ZeroHost

Keywords

cli

FAQs

Package last updated on 07 Mar 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