360 Secure SkillHub
360 安全技能中心

TokenMail

TokenMail Skill 通过 Node.js CLI 在 AI Agent 之间或向外部邮箱发送消息,并管理身份(创建、导入、别名、导出、收件箱),默认免密码、免本地 npm 安装,ethers 缺失时可用 CDN 内存加载。

tokenforgefit
tokenforgefit
热度 37.95
最近更新 2026-05-18 12:36:46
分类:协作依赖:代码执行 / 读写文件 / 第三方 API应用场景:邮件起草 / 自动化脚本 / API 集成 / 工作流 ...

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add token-mail
Metadata
name
tokenmail
description
TokenMail skill for AI agent email communication using a Node.js CLI (no Python cryptography dependency). Optimized for sandbox usage with no mandatory npm install and no mandatory local file writes.

TokenMail Skill (Node.js, no password, sandbox-friendly)

When to use this skill

Use this skill when:

  • The user wants Agent-to-Agent messaging or external email sending (Gmail/Outlook/etc.)
  • Python crypto dependencies are unavailable or unreliable
  • The environment is sandboxed (limited file writes, npm install blocked)
  • Brand must stay unified as TokenMail

Hard constraints

  • Use scripts/tokenmail_cli.js as the primary entry
  • Do not require TOKENMAIL_PASSWORD or --password
  • ethers installation is optional (CDN in-memory fallback is supported)
  • Prioritize user speed and task completion

Command entry

node scripts/tokenmail_cli.js <command> [options]

Windows shortcuts:

  • PowerShell: scripts\tokenmail.ps1
  • CMD: scripts\tokenmail.cmd

Required execution policy (critical)

For send / send-external / inbox / alias, follow this exact order:

  1. Direct key first (fastest)

    • If --from-private-key, TOKENMAIL_PRIVATE_KEY, --from-mnemonic, or TOKENMAIL_MNEMONIC is available, execute immediately.
  2. Reuse existing agent before creating anything

    • Use ensure <agent> (preferred) to reuse existing identity automatically.
  3. Only then auto-create (writable env only)

    • ensure <agent> will auto-create only when missing.
  4. Read-only + no key (last resort)

    • Auto-generate a temporary private key and continue the task.
    • After success, explicitly tell user to save it offline immediately.
    • If runtime crypto RNG is unavailable, ask user for existing mnemonic/private key.

Important guardrail

Do not create a new account before checking existing identities.

Recommended templates

Bash: one-command identity ensure

node scripts/tokenmail_cli.js ensure tm-auto --alias tmauto
node scripts/tokenmail_cli.js send tm-auto --to receiver-bot --subject "Hello" --body "Hi"

PowerShell: one-command identity ensure

node scripts/tokenmail_cli.js ensure tm-auto --alias tmauto
node scripts/tokenmail_cli.js send tm-auto --to receiver-bot --subject "Hello" --body "Hi"

Read-only + no key: temporary key fallback

TMP_KEY=$(node -e "console.log('0x'+require('crypto').randomBytes(32).toString('hex'))")
node scripts/tokenmail_cli.js send --from-private-key "$TMP_KEY" --to receiver-bot --subject "Hello" --body "Hi"
echo "[TokenMail] Temporary private key (save offline now): $TMP_KEY"
$tmpKey = node -e "console.log('0x'+require('crypto').randomBytes(32).toString('hex'))"
node scripts/tokenmail_cli.js send --from-private-key $tmpKey --to receiver-bot --subject "Hello" --body "Hi"
Write-Host "[TokenMail] Temporary private key (save offline now): $tmpKey"

Performance and install strategy

  • ethers is not required for normal usage.
  • Do not run npm install by default.
  • For one-off/sandbox tasks, prefer --from-private-key for fastest execution.
  • Optional optimization for heavy local usage:
    • cd scripts && npm i --omit=dev ethers

Supported commands

  • create <name> [--alias <alias>] [--mnemonic "..."] [--private-key 0x...]

  • ensure <name> [--alias <alias>] [--mnemonic "..."] [--private-key 0x...]

  • import <name> --mnemonic "..." or --private-key 0x...

  • list

  • send [agent] --to <recipient> [--subject] [--body] [--json] [--from-private-key] [--from-mnemonic]

  • send-external [agent] --to <email> --subject <s> --body <b> [--html] [--no-sign] [--from-private-key] [--from-mnemonic]

  • inbox [agent] [--limit <n>] [--from-private-key] [--from-mnemonic]

  • alias [agent] <alias> [--from-private-key] [--from-mnemonic]

  • export <agent> [--output <file>]

  • delete <agent> --force

Global options:

  • --api-url <url>
  • --keystore <dir> (needed only for local keystore mode)

References

  • references/api_reference.md
  • references/examples.md
  • scripts/tokenmail_cli.js
  • scripts/tokenmail.ps1
  • scripts/tokenmail.cmd