Skip to content

Commit

Permalink
feat: context -> agent config
Browse files Browse the repository at this point in the history
  • Loading branch information
byeongsu-hong committed Feb 28, 2024
1 parent 297ed5e commit 900facd
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions script/commands/context.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { Command } from "commander";
import { CONTAINER, Dependencies } from "../shared/ioc";
import { saveAgentConfig } from "../shared/context";
import { getNetwork } from "../shared/config";

const contextCmd = new Command("context");

contextCmd
.command("make-agent-config")
.description("Make an agent config")
.option("-o --output <output-dir>", "The output directory")
.action(async (_, cmd) => {
const opts = cmd.optsWithGlobals();
const { ctx } = CONTAINER.get(Dependencies);
const network = getNetwork(opts.networkId);

await saveAgentConfig(
network,
ctx,
opts.output && { contextPath: opts.output }
);
});

export { contextCmd };

0 comments on commit 900facd

Please sign in to comment.