import config from './deno.json' with { type: 'json' } import { Command } from '@cliffy/command' import { UpgradeCommand } from '@cliffy/command/upgrade' import { JsrProvider } from '@cliffy/command/upgrade/provider/jsr' import { cmd as send } from './cli/send.ts' import { cmd as preview } from './cli/preview.ts' const upgradeCommand = new UpgradeCommand({ args: [ '--allow-read', '--allow-env', '--allow-net=0.0.0.0', '--allow-sys=osRelease,networkInterfaces', '--allow-run=/usr/sbin/sendmail,whoami', '--name=cohamail', ], provider: [ new JsrProvider({ package: config.name as `@${string}/${string}`, main: 'cli', }), ], }) const cli = new Command() .name('cohamail') .description('Mail cli for coh@bit.') .version(config.version) .command('preview', preview) .command('send', send) .command('upgrade', upgradeCommand) if (import.meta.main) { if (Deno.args.length) { cli.parse(Deno.args) } else { cli.showHelp() } }