-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathcli.js
26 lines (19 loc) · 733 Bytes
/
cli.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env node
import debug from "debug";
import bot from "./bot.js";
import { program } from "commander";
const log = debug("minecraft-openai.cli:log");
const error = debug("minecraft-openai.cli:error");
program
.name("minecraft-openai")
.description("Playing Minecraft with OpenAI (proof of concept)")
program.command('start')
.description('start the bot')
.option("--host <host>", "hostname of the minecraft server", "localhost")
.option("--port <port>", "port of the minecraft server", 25565)
.option("--username <username>", "username of the bot", "OpenAI")
.action(async(options) => {
log("starting bot");
await bot(options.host, options.port, "OpenAI").catch(error);
});
program.parse();