Skip to content

Commit afa18fd

Browse files
committed
cli fixes and such
1 parent aaeae24 commit afa18fd

File tree

8 files changed

+17
-22
lines changed

8 files changed

+17
-22
lines changed

bun.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@
197197
"name": "create-eliza",
198198
"version": "1.0.0-alpha.26",
199199
"bin": {
200-
"create-eliza": "index.js",
200+
"create-eliza": "index.mjs",
201201
},
202202
},
203203
"packages/docs": {

packages/cli/src/commands/plugin.ts

+6-13
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,8 @@
1-
import { promises as fs, existsSync } from "node:fs";
2-
import path from "node:path";
3-
import { fileURLToPath } from "node:url";
41
import {
5-
branchExists,
6-
createBranch,
7-
createPullRequest,
8-
forkExists,
9-
forkRepository,
10-
getFileContent,
11-
getGitHubCredentials,
12-
updateFile,
2+
getGitHubCredentials
133
} from "@/src/utils/github";
144
import { handleError } from "@/src/utils/handle-error";
15-
import { publishToGitHub, publishToNpm, testPublishToGitHub, testPublishToNpm } from "@/src/utils/plugin-publisher";
5+
import { publishToGitHub, testPublishToGitHub, testPublishToNpm } from "@/src/utils/plugin-publisher";
166
import {
177
getRegistrySettings,
188
initializeDataDir,
@@ -22,11 +12,14 @@ import {
2212
import { logger } from "@elizaos/core";
2313
import { Command } from "commander";
2414
import { execa } from "execa";
15+
import { existsSync, promises as fs } from "node:fs";
16+
import path from "node:path";
17+
import { fileURLToPath } from "node:url";
2518
import prompts from "prompts";
2619

2720
export const plugin = new Command()
2821
.name("plugin")
29-
.description("Manage ElizaOS plugins in a project");
22+
.description("Manage ElizaOS plugins, including publishing");
3023

3124
/**
3225
* Note: The plugin creation functionality is now in the main create.ts file.

packages/cli/src/commands/project.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { execa } from "execa";
1111

1212
export const project = new Command()
1313
.name("project")
14-
.description("Manage ElizaOS plugins in a project");
14+
.description("Manage an ElizaOS project");
1515

1616
project
1717
.command("list-plugins")

packages/cli/src/utils/copy-template.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export async function copyTemplate(
7777
} else {
7878
// In production, use the templates directory from the CLI package
7979
templateDir = path.resolve(
80-
path.dirname(require.resolve("elizaos/package.json")),
80+
path.dirname(require.resolve("@elizaos/cli/package.json")),
8181
"templates",
8282
templateType === "project" ? "project-starter" : "plugin-starter",
8383
);
@@ -97,7 +97,7 @@ export async function copyTemplate(
9797

9898
// get the package.json of this package
9999
const cliPackageJsonPath = path.resolve(
100-
path.dirname(require.resolve("elizaos/package.json")),
100+
path.dirname(require.resolve("@elizaos/cli/package.json")),
101101
"package.json",
102102
);
103103

packages/create-eliza/index.js packages/create-eliza/index.mjs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env node
2+
13
import { spawn } from 'node:child_process';
24
import { fileURLToPath } from 'node:url';
35
import { dirname, join } from 'node:path';

packages/create-eliza/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
"access": "public"
88
},
99
"bin": {
10-
"create-eliza": "index.js"
10+
"create-eliza": "index.mjs"
1111
},
1212
"scripts": {
13-
"create-eliza": "bun run cli/index.js init"
13+
"create-eliza": "bun run index.mjs"
1414
},
1515
"license": "MIT",
1616
"author": {
@@ -24,7 +24,7 @@
2424
},
2525
"files": [
2626
"cli",
27-
"index.js",
27+
"index.mjs",
2828
"package.json"
2929
],
3030
"keywords": [

packages/plugin-discord/src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1064,7 +1064,7 @@ const discordPlugin: Plugin = {
10641064
logger.warn(
10651065
"Discord API Token not provided - Discord plugin is loaded but will not be functional",
10661066
);
1067-
logger.info(
1067+
logger.warn(
10681068
"To enable Discord functionality, please provide DISCORD_API_TOKEN in your .eliza/.env file",
10691069
);
10701070
}

packages/plugin-starter/src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const configSchema = z.object({
2727
.optional()
2828
.transform((val) => {
2929
if (!val) {
30-
console.warn("Warning: Example plugin variable is not provided");
30+
logger.warn("Example plugin variable is not provided (this is expected)");
3131
}
3232
return val;
3333
}),

0 commit comments

Comments
 (0)