
Security News
/Research
Compromised Injective SDK npm Package Exfiltrates Wallet Keys and Mnemonics
Compromised Injective SDK npm version 1.20.21 exfiltrates wallet private keys and mnemonics through fake telemetry functionality.
@preferred-natural-language/cli
Advanced tools
Cross-platform natural language preference detection for AI assistants
A cross-platform natural language preference detection tool for AI assistants through MCP (Model Context Protocol).
# Install globally (recommended)
npm install -g @preferred-natural-language/cli
# Or use with npx (no installation)
npx @preferred-natural-language/cli detect
# Detect current language preference
pnl detect
# Set language preference
pnl set zh-CN
# Show detailed information
pnl show
# List all supported languages
pnl list
# Start MCP server (for programmatic use)
pnl mcp
Install the plugin:
From Marketplaces:
/plugin marketplace add wakanachan/preferred-natural-language
/plugin install preferred-natural-language@wakanachan/preferred-natural-language
For Local Development:
# Clone the repository
git clone https://github.com/wakanachan/preferred-natural-language
cd preferred-natural-language
# Install as local marketplace
/plugin marketplace add ./.claude-plugin
/plugin install preferred-natural-language@pnl-dev-marketplace
Restart Claude Code to load the plugin (required after installation)
Automatic Language Detection:
language://preferencedetect-language, set-language, list-languagesAvailable Slash Commands:
/detect-language # Detect current language preference
/set-language # Set language preference (e.g., zh-CN, ja-JP)
/list-languages # List all 70+ supported languages
Install the extension:
For Local Development:
# Clone the repository
git clone https://github.com/wakanachan/preferred-natural-language
cd preferred-natural-language
# Install from local path (root directory contains gemini-extension.json)
gemini extensions install .
# Or use link command
gemini extensions link .
Restart Gemini CLI to load the extension (changes only apply on restart)
Update Extension (when updates are available):
# Update specific extension
gemini extensions update preferred-natural-language
# Or update all extensions at once
gemini extensions update --all
Automatic Language Detection:
GEMINI.mdAvailable Slash Commands:
/detect-language # Detect current language preference
/set-language # Set language preference (e.g., zh-CN, ja-JP)
/list-languages # List all 70+ supported languages
We support 70+ languages and regional variants, with full i18n output for 10 major languages:
| Language | Code | Native Name |
|---|---|---|
| English | en, en-US, en-GB | English |
| Chinese (Simplified) | zh-CN | 简体中文 |
| Japanese | ja-JP | 日本語 |
| Korean | ko-KR | 한국어 |
| Russian | ru-RU | Русский |
| Portuguese | pt-BR, pt-PT | Português |
| Spanish | es-ES | Español |
| French | fr-FR | Français |
| German | de-DE | Deutsch |
View the complete list of 70+ supported languages →
The tool detects language preferences using a strict 5-level priority:
.preferred-language.json) - Highest priorityCLAUDE_CODE_NATURAL_LANGUAGEGEMINI_CLI_NATURAL_LANGUAGEos-locale package)LANGUAGE > LC_ALL > LC_MESSAGES > LANGen-US) - Lowest priorityCreate .preferred-language.json in your project root:
{
"language": "zh-CN",
"fallback": "en-US"
}
# Platform-specific (priority 2)
export CLAUDE_CODE_NATURAL_LANGUAGE="zh-CN"
export GEMINI_CLI_NATURAL_LANGUAGE="ja-JP"
# Standard Unix variables (priority 4)
export LANGUAGE="zh_CN:en_US"
export LC_ALL="zh_CN.UTF-8"
export LANG="zh_CN.UTF-8"
# Create config file interactively
pnl set zh-CN
# This creates .preferred-language.json with:
# { "language": "zh-CN", "fallback": "en-US" }
preferred-natural-language/
├── src/ # Source code
│ ├── languageDetector.ts # Core 5-level priority detection
│ ├── types.ts # Type definitions
│ ├── languageNames.ts # 70+ language mappings
│ ├── config.ts # Configuration paths
│ ├── index.ts # Unified exports
│ ├── cli/ # CLI commands (Commander.js)
│ │ ├── commands/ # detect, set, show, list, mcp
│ │ ├── utils/ # Display utilities
│ │ └── index.ts # CLI entry point
│ ├── i18n/ # Internationalization
│ │ ├── index.ts # I18n class
│ │ └── locales/ # 10 language files
│ └── mcp/ # MCP server
│ └── server.ts # Resource + Prompt + Tools
├── bin/
│ └── pnl.js # CLI entry point
├── __tests__/ # Test suites
│ ├── unit/ # Unit tests
│ ├── integration/ # Integration tests
│ └── e2e/ # End-to-end tests
├── .claude-plugin/ # Claude Code plugin (marketplace)
│ ├── marketplace.json # Marketplace config
│ └── pnl/ # Plugin root
│ ├── .claude-plugin/plugin.json
│ ├── .mcp.json # MCP server config
│ ├── commands/ # Slash commands
│ └── scripts/start-mcp.js # Smart MCP launcher
├── gemini-extension.json # Gemini CLI extension manifest
├── GEMINI.md # Gemini context file
├── commands/ # Gemini slash commands (.toml)
└── scripts/start-mcp.js # Shared MCP launcher
@preferred-natural-language/clipnl mcp subcommand via smart launchers# All tests (unit + integration + e2e)
npm test
# Specific test suites
npm run test:unit # Fast unit tests
npm run test:integration # Integration tests
npm run test:e2e # End-to-end tests
# Development
npm run test:watch # Watch mode
npm run test:coverage # With coverage report
npm run test:ci # CI mode (no watch)
# Clone repository
git clone https://github.com/wakanachan/preferred-natural-language.git
cd preferred-natural-language
# Install dependencies
npm install
# Build
npm run build
# Run tests
npm test
# Building
npm run build # Build project
# Testing
npm run test:unit # Unit tests
npm run test:integration # Integration tests
npm run test:e2e # E2E tests
npm run test:coverage # With coverage
npm run test:pr # PR validation (unit + integration)
import { LanguageDetector, SUPPORTED_LANGUAGES } from '@preferred-natural-language/cli';
// Detect language
const detector = new LanguageDetector();
const result = await detector.detect();
// { language: 'zh-CN', source: 'os-locale', confidence: 'high' }
// List supported languages
console.log(SUPPORTED_LANGUAGES);
// { 'en': 'English', 'zh-CN': 'Chinese (Simplified)', ... }
The MCP server provides:
Resource (auto-loaded):
language://preference - User's language preference (JSON)Prompt:
use-preferred-language - Generates language instruction for AITools:
detect-language - Detect current languageset-language(language, fallback?) - Set language preferencelist-languages() - List all 70+ supported languagesinterface LanguageDetectionResult {
language: string; // BCP-47 code (e.g., 'zh-CN')
source: DetectionSource; // Detection source
confidence: 'high' | 'medium' | 'low';
}
type DetectionSource =
| `config-file:${string}` // Config file path
| 'GEMINI_CLI_NATURAL_LANGUAGE'
| 'CLAUDE_CODE_NATURAL_LANGUAGE'
| 'os-locale'
| 'LANGUAGE' | 'LC_ALL' | 'LC_MESSAGES' | 'LANG'
| 'HTTP_ACCEPT_LANGUAGE'
| 'fallback';
We welcome contributions! Please see our Contributing Guide for details.
git checkout -b feature/amazing-feature)git push origin feature/amazing-feature)git commit -m "feat: 添加新功能描述
- 详细说明 1
- 详细说明 2
🤖 Generated with Claude Code
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>"
This project is licensed under the MIT License - see the LICENSE file for details.
Made with ❤️ for the AI community
Supporting Claude Code and Gemini CLI
FAQs
Cross-platform natural language preference detection for AI assistants
The npm package @preferred-natural-language/cli receives a total of 4 weekly downloads. As such, @preferred-natural-language/cli popularity was classified as not popular.
We found that @preferred-natural-language/cli demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
/Research
Compromised Injective SDK npm version 1.20.21 exfiltrates wallet private keys and mnemonics through fake telemetry functionality.

Security News
npm v12 is generally available, turning install scripts off by default and beginning the deprecation of 2FA-bypass publishing tokens.

Research
/Security News
Socket tracks the activity as Operation “Muck and Load”: a threat actor uses commit-farming workflows, public dead drops, and protected archives to stage Windows RAT and infostealer malware.