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/grocery.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("grocery", "Select recipes for grocery list")
23 .action(() => select(db))
24
25 .parse(Deno.args);
26
27db.close();