all repos — momix @ 623410e806f3318fb20af938664583ced886ce0e

A CLI tool to manage recipes for Thermomix

main.ts (view raw)

 1import { Command } from "@cliffy/command";
 2import db from "./db.ts";
 3
 4import store from "./commands/store.ts";
 5import list from "./commands/list.ts";
 6import select from "./commands/select.ts";
 7
 8await new Command()
 9  .name("cookidoo")
10  .version("0.1.0")
11  .description("Recipe CLI")
12  .action(function () {
13    this.showHelp();
14  })
15
16  .command("store <recipeId:string>", "Store a recipe in the database")
17  .action((_options, recipeId: string) => store(db, recipeId))
18
19  .command("list", "Liste stored recipes")
20  .action(() => list(db))
21
22  .command("select", "Select recipes for course list")
23  .action(() => select(db))
24
25  .parse(Deno.args);
26
27db.close();