@sadikkhan02/notifykit-cli

中文文档
1.0.0发布于 2026/11/02MITTypeScriptES Module

Interactive setup wizard and CLI generator for NotifyKit

原始使用文档
文档目录7 节
  1. Quick Start
  2. Non-Interactive / CI/CD Usage
  3. Command-Line Options
  4. Channel & Provider Flags
  5. Provider Credential Flags
  6. Security & Merge Safety
  7. License

@sadikkhan02/notifykit-cli

Interactive setup wizard and non-interactive CI tool for configuring NotifyKit in any Node.js project.

Quick Start

Run the wizard in your project root:

npx @sadikkhan02/notifykit init

The wizard will guide you through:

  1. Selecting notification channels (Email, SMS, Push)
  2. Selecting provider adapters:
    • Email: Nodemailer (Universal SMTP / Mailtrap / Gmail / SES)
    • SMS: Twilio (Global reach) or MSG91 (India-optimized, DLT compliant)
    • Push: Firebase Cloud Messaging (Android, iOS, Web)
  3. Configuring Redis queue connectivity (local, Docker, or cloud)
  4. Capturing provider credentials with masked password inputs
  5. Reviewing a summary before making changes
  6. Merge-safe writing of .env and .env.example
  7. Automatically installing only the selected adapter packages and peer SDKs

Non-Interactive / CI/CD Usage

For automated environments, Docker containers, and CI/CD pipelines, specify configuration flags with --yes:

# Configure Twilio SMS
npx @sadikkhan02/notifykit init \
  --channels=sms \
  --sms=twilio \
  --twilio-sid=ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx \
  --twilio-token=your_auth_token \
  --twilio-from=+1234567890 \
  --yes

# Configure Nodemailer Email with dry-run
npx @sadikkhan02/notifykit init \
  --channels=email \
  --email=nodemailer \
  --smtp-host=smtp.mailtrap.io \
  --smtp-port=587 \
  --smtp-user=my_user \
  --smtp-password=my_secret \
  --dry-run \
  --yes

Command-Line Options

OptionTypeDescription
-y, --yesBooleanConfirm actions non-interactively (required in non-TTY environments)
--dry-runBooleanPreview configuration without modifying files or installing packages
--skip-installBooleanWrite .env without executing package manager installation
--cwd <path>StringTarget directory (defaults to process.cwd())
--package-manager <pm>StringForce package manager (npm, pnpm, yarn, bun)
-h, --helpBooleanDisplay help screen
-v, --versionBooleanDisplay version

Channel & Provider Flags

FlagValuesDescription
--channelsemail, sms, pushComma-separated list of channels to configure
--emailnodemailerEmail provider selection
--smstwilio, msg91SMS provider selection
--pushfcmPush provider selection
--redis-urlURL stringRedis connection string (default: redis://localhost:6379)

Provider Credential Flags

  • Nodemailer: --smtp-host, --smtp-port, --smtp-user, --smtp-password, --smtp-from, --smtp-secure
  • Twilio: --twilio-sid, --twilio-token, --twilio-from, --twilio-messaging-service-sid
  • MSG91: --msg91-auth-key, --msg91-flow-id, --msg91-sender-id
  • FCM: --fcm-service-account, --fcm-project-id

Security & Merge Safety

  • Zero Secret Leakage: Sensitive tokens and passwords are never logged to stdout, stderr, or terminal diagnostics.
  • Merge-Safe .env Updates: Unrelated variables (such as DATABASE_URL or PORT), blank lines, and comments are 100% preserved.
  • Safe .env.example Generation: Places example placeholders in .env.example without exposing real credentials.
  • Shell Injection Prevention: Package manager commands pass discrete argument arrays directly to execa, avoiding raw shell command concatenation.
  • Idempotent: Re-running the wizard updates existing NotifyKit keys without duplicating sections.

License

MIT

版本与发布记录

@sadikkhan02/notifykit-cli 共发布 2 个版本,首次发布于 2026/11/02;过去 12 个月发布了 2 个版本。

版本发布日期距今
1.0.0latest2026/11/021 天前
0.0.0-stage2026/11/021 天前

关于 @sadikkhan02/notifykit-cli 的常见问题

@sadikkhan02/notifykit-cli 是什么?

用于NotifyKit的交互式设置向导和CLI生成器

如何安装 @sadikkhan02/notifykit-cli?

在项目目录运行 npm install @sadikkhan02/notifykit-cli,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 notifykit-cli,可以用 npx notifykit-cli 直接运行。

@sadikkhan02/notifykit-cli 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@sadikkhan02/notifykit-cli 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@sadikkhan02/notifykit-cli 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=20.0.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@sadikkhan02/notifykit-cli 可以商用吗?

@sadikkhan02/notifykit-cli 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@sadikkhan02/notifykit-cli 还在维护吗?

最新版本 1.0.0 发布于 2026/11/02(1 天前);至今共发布 2 个版本,其中过去 12 个月发布了 2 个;首次发布于 2026/11/02。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。