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

@daliusd/deepl-cli

v0.1.0

Published

CLI tool for translating text using the DeepL API

Downloads

96

Readme

@daliusd/deepl-cli

CLI tool for translating text using the DeepL API. Pipe-friendly, configurable, supports context and formality options.

Installation

npm install -g @daliusd/deepl-cli

Requires Node.js >= 18.

Configuration

Create a config file at ~/.config/deepl-cli/config.json:

mkdir -p ~/.config/deepl-cli

Using a static API key

{
  "api_key": "your-deepl-api-key"
}

Using a command to retrieve the API key

This is useful with password managers like pass, 1Password CLI, etc.

{
  "api_key_command": "pass show deepl-api-key"
}

If both api_key and api_key_command are present, api_key_command takes precedence.

You can get a DeepL API key by creating a DeepL API account (free tier: 500,000 characters/month).

Usage

deepl-cli [options] [text]

Options

| Option | Short | Description | |--------|-------|-------------| | --target <lang> | -t | Target language code (required, e.g. de, en-US, fr) | | --source <lang> | -s | Source language code (default: auto-detect) | | --context <text> | -c | Additional context to influence translation (not translated, not billed) | | --formality <level> | -f | Formality: less, more, default, prefer_less, prefer_more | | --verbose | -v | Show metadata (detected source language, billed characters) | | --help | -h | Show help | | --version | | Show version |

Examples

Translate text to German:

deepl-cli -t de "Hello, world!"

Translate with context (context influences translation but is not translated or billed):

deepl-cli -t de -c "This is a greeting in a formal business email" "Hello"

Pipe text via stdin:

echo "Hello, world!" | deepl-cli -t de

Use formal language:

deepl-cli -t de -f more "How are you?"

Show translation metadata:

deepl-cli -t de -v "Hello, world!"
# stdout: Hallo, Welt!
# stderr: Detected source language: en
# stderr: Billed characters: 13

Specify source language explicitly:

deepl-cli -t de -s en "Hello"

Piping

The translated text is printed to stdout with no extra formatting, making it easy to use in pipelines:

echo "Hello" | deepl-cli -t de | pbcopy

When --verbose is used, metadata is written to stderr so stdout remains clean for piping.

Language codes

Language codes are case-insensitive and follow ISO 639-1, with some target languages including regional variants:

  • Source: en, de, fr, ja, es, etc. (or omit for auto-detection)
  • Target: en-US, en-GB, pt-BR, pt-PT, de, fr, etc.

See the DeepL API documentation for the full list of supported languages.

Development

git clone https://github.com/daliusd/deepl-cli.git
cd deepl-cli
npm install
npm run build
npm test

Scripts

| Command | Description | |---------|-------------| | npm run build | Compile TypeScript to dist/ | | npm test | Run unit tests (node:test) |

Publishing

npm run build
npm publish --access public

License

MIT