#!/usr/bin/env node /* Отправить команду в мир через dev-эндпоинт (сервер должен быть запущен с DEV_HTTP=1): node scripts/dev-cmd.mjs Тестер '!рубить' */ const [name, ...rest] = process.argv.slice(2); const text = rest.join(' '); if (!name || !text) { console.error('usage: node scripts/dev-cmd.mjs <ник> '); process.exit(1); } const res = await fetch('http://localhost:3000/dev/command', { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ name, text }), }); console.log(res.status, await res.text());