npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

localjsons-cli

v1.0.3

Published

Command Line Interface for Localjsons - A powerful localization platform

Readme

Localjsons CLI

A powerful command-line interface for Localjsons - the modern localization platform.

Installation

npm (Recommended)

npm install -g localjsons-cli

Direct Download

Download the latest release for your platform:

Docker

docker pull localjsons/cli:latest
docker run --rm localjsons/cli --version

Quick Start

  1. Initialize a project:

    localjsons init your-project-id
  2. Upload translation files:

    localjsons upload
  3. Download translations:

    localjsons download
  4. Check project status:

    localjsons status

Commands

localjsons init [projectId]

Initialize a new Localjsons project.

Options:

  • -k, --api-key <key> - API key for authentication
  • -u, --base-url <url> - Base URL for the API
  • --skip-prompts - Skip interactive prompts and use defaults

Example:

localjsons init my-project --api-key your-api-key

localjsons upload [files...]

Upload translation files to Localjsons.

Options:

  • -c, --config <path> - Path to config file (default: localjsons.json)
  • --dry-run - Show what would be uploaded without actually uploading

Example:

localjsons upload "locales/*.json"
localjsons upload --dry-run

localjsons download

Download latest translations from Localjsons.

Options:

  • -c, --config <path> - Path to config file (default: localjsons.json)
  • --dry-run - Show what would be downloaded without actually downloading

Example:

localjsons download
localjsons download --dry-run

localjsons status

Check project status and translation progress.

Options:

  • -c, --config <path> - Path to config file (default: localjsons.json)

Example:

localjsons status

localjsons config [action] [key] [value]

Manage configuration settings.

Actions:

  • list - List all configuration (default)
  • get <key> - Get a specific configuration value
  • set <key> <value> - Set a configuration value

Example:

localjsons config list
localjsons config get upload.sourceLanguage
localjsons config set download.targetLanguages "es,fr,de"

localjsons version

Show version information.

Example:

localjsons version

Configuration

The CLI uses a localjsons.json configuration file in your project root:

{
  "projectId": "your-project-id",
  "apiKey": "your-api-key",
  "baseUrl": "http://localhost:3000/api",
  "upload": {
    "sourceLanguage": "en",
    "filePatterns": ["**/*.json", "**/locales/*.json"],
    "excludePatterns": ["node_modules/**", "dist/**", "build/**"]
  },
  "download": {
    "targetLanguages": ["es", "fr", "de"],
    "outputPath": "./locales",
    "format": "json"
  }
}

Configuration Options

  • projectId: Your Localjsons project ID
  • apiKey: Your API key for authentication
  • baseUrl: Base URL for the API (optional)
  • upload.sourceLanguage: Source language for translations
  • upload.filePatterns: Glob patterns for files to upload
  • upload.excludePatterns: Glob patterns for files to exclude
  • download.targetLanguages: Languages to download
  • download.outputPath: Directory to save downloaded files
  • download.format: Output format (json, yaml, properties)

File Formats

The CLI supports multiple file formats:

  • JSON: {"key": "value"} (default)
  • YAML: key: value
  • Properties: key=value

Examples

Basic Workflow

# Initialize project
localjsons init my-project

# Upload source files
localjsons upload "src/locales/*.json"

# Download translations
localjsons download

# Check status
localjsons status

Advanced Usage

# Upload specific files
localjsons upload "locales/en.json" "locales/es.json"

# Dry run to see what would be uploaded
localjsons upload --dry-run

# Use custom config file
localjsons upload -c config/localjsons.json

# Set configuration
localjsons config set download.targetLanguages "es,fr,de,it"

Environment Variables

You can use environment variables instead of storing sensitive data in the config file:

  • LOCALJSONS_API_KEY - Your API key
  • LOCALJSONS_BASE_URL - Base URL for the API (use http://localhost:3000/api in development)
  • LOCALJSONS_PROJECT_ID - Your project ID

Troubleshooting

Common Issues

  1. Config file not found

    • Run localjsons init to create a configuration file
  2. Authentication failed

    • Check your API key in the config file or environment variables
  3. No files found to upload

    • Check your file patterns in the configuration
    • Use --dry-run to see what files would be processed
  4. Network errors

    • Check your internet connection
    • Verify the base URL if using a custom API endpoint

Getting Help

  • Documentation: https://docs.localjsons.com/cli
  • GitHub Issues: https://github.com/localjsons/cli/issues
  • Support: https://localjsons.com/support

License

MIT License - see LICENSE for details.

Contributing

Contributions are welcome! Please see our Contributing Guide for details.