Initial commit with translated description

This commit is contained in:
2026-03-29 08:34:04 +08:00
commit 80ef0a90d7
24 changed files with 4556 additions and 0 deletions

31
send-card-cli.js Normal file
View File

@@ -0,0 +1,31 @@
#!/usr/bin/env node
const { sendCard } = require('./feishu-helper.js');
// CLI Arguments:
// 1. Message content
// 2. Prefix (e.g., "[INFO]")
const msg = process.argv[2];
const prefix = process.argv[3] || '[INFO]';
const target = process.env.FEISHU_LOG_TARGET || process.env.LOG_TARGET || '';
if (!target) { process.stderr.write('[CardFail] FEISHU_LOG_TARGET or LOG_TARGET env var not set\n'); process.exit(1); }
if (!msg) process.exit(0);
(async () => {
try {
const color = prefix.includes('ERROR') || prefix.includes('CRITICAL') || prefix.includes('FAILURE')
? 'red'
: prefix.includes('WARNING') || prefix.includes('WARN')
? 'orange'
: 'blue';
await sendCard({
target,
title: `🧬 Evolver [${new Date().toISOString().substring(11,19)}]`,
text: `${prefix} ${msg}`,
color
});
} catch (e) {
process.stderr.write(`[CardFail] ${e.message}\n`);
process.exit(1);
}
})();