@otonix/cli 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +89 -0
- package/dist/commands/agent.d.ts +2 -0
- package/dist/commands/agent.js +173 -0
- package/dist/commands/launch.d.ts +2 -0
- package/dist/commands/launch.js +208 -0
- package/dist/commands/wallet.d.ts +2 -0
- package/dist/commands/wallet.js +166 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +44 -0
- package/dist/lib/chain.d.ts +15293 -0
- package/dist/lib/chain.js +42 -0
- package/dist/lib/config.d.ts +21 -0
- package/dist/lib/config.js +39 -0
- package/dist/lib/display.d.ts +14 -0
- package/dist/lib/display.js +50 -0
- package/package.json +40 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { Command } from "commander";
|
|
3
|
+
import chalk from "chalk";
|
|
4
|
+
import { printBanner } from "./lib/display.js";
|
|
5
|
+
import { walletCommand } from "./commands/wallet.js";
|
|
6
|
+
import { agentCommand } from "./commands/agent.js";
|
|
7
|
+
import { launchCommand } from "./commands/launch.js";
|
|
8
|
+
const args = process.argv.slice(2);
|
|
9
|
+
const showBanner = args.length === 0 ||
|
|
10
|
+
args.includes("--help") ||
|
|
11
|
+
args.includes("-h");
|
|
12
|
+
if (showBanner)
|
|
13
|
+
printBanner();
|
|
14
|
+
const program = new Command();
|
|
15
|
+
program
|
|
16
|
+
.name("otonix")
|
|
17
|
+
.description(chalk.bold.hex("#4d6fff")("OTONIX CLI") + chalk.dim(" — Web4 Autonomous Agent Infrastructure"))
|
|
18
|
+
.version("0.1.0", "-v, --version")
|
|
19
|
+
.configureOutput({
|
|
20
|
+
writeOut: str => process.stdout.write(str),
|
|
21
|
+
writeErr: str => process.stderr.write(str),
|
|
22
|
+
});
|
|
23
|
+
walletCommand(program);
|
|
24
|
+
agentCommand(program);
|
|
25
|
+
launchCommand(program);
|
|
26
|
+
program
|
|
27
|
+
.command("config")
|
|
28
|
+
.description("Show current config file location and settings")
|
|
29
|
+
.action(async () => {
|
|
30
|
+
const { loadConfig, configPath } = await import("./lib/config.js");
|
|
31
|
+
const cfg = loadConfig();
|
|
32
|
+
console.log("\n" + chalk.bold.hex("#4d6fff")("◈ OTONIX") + " " + chalk.dim("Config") + "\n" + chalk.dim("─".repeat(44)));
|
|
33
|
+
console.log(chalk.dim("File: ") + chalk.white(configPath()));
|
|
34
|
+
console.log(chalk.dim("Wallet: ") + chalk.white(cfg.wallet?.address ?? "(none)"));
|
|
35
|
+
console.log(chalk.dim("Agents: ") + chalk.white(Object.keys(cfg.agents).join(", ") || "(none)"));
|
|
36
|
+
console.log(chalk.dim("API base: ") + chalk.white(cfg.apiBase));
|
|
37
|
+
console.log(chalk.dim("Deployer: ") + chalk.white(cfg.deployerAddress));
|
|
38
|
+
console.log(chalk.dim("Treasury: ") + chalk.white(cfg.treasuryAddress));
|
|
39
|
+
console.log();
|
|
40
|
+
});
|
|
41
|
+
program.parse(process.argv);
|
|
42
|
+
if (!args.length) {
|
|
43
|
+
program.outputHelp();
|
|
44
|
+
}
|