diff --git a/cli.ts b/cli.ts index f59c79d..4c99b0a 100644 --- a/cli.ts +++ b/cli.ts @@ -1,14 +1,34 @@ 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) {