@elizaos/plugin-cli 2.0.0-alpha.9 → 2.0.0-beta.1

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/dist/index.d.ts CHANGED
@@ -11,50 +11,25 @@
11
11
  */
12
12
  import type { IAgentRuntime, Plugin } from "@elizaos/core";
13
13
  import { Command } from "commander";
14
- export {
15
- addSubcommand,
16
- clearCliCommands,
17
- defineCliCommand,
18
- getCliCommand,
19
- listCliCommands,
20
- registerAllCommands,
21
- registerCliCommand,
22
- unregisterCliCommand,
23
- } from "./registry.js";
14
+ export { addSubcommand, clearCliCommands, defineCliCommand, getCliCommand, listCliCommands, registerAllCommands, registerCliCommand, unregisterCliCommand, } from "./registry.js";
24
15
  export * from "./types.js";
25
- export {
26
- createDefaultDeps,
27
- createProgressReporter,
28
- DEFAULT_CLI_NAME,
29
- DEFAULT_CLI_VERSION,
30
- formatBytes,
31
- formatCliCommand,
32
- formatDuration,
33
- isInteractive,
34
- parseDurationMs,
35
- parseTimeoutMs,
36
- resolveCliName,
37
- withProgress,
38
- } from "./utils.js";
16
+ export { createDefaultDeps, createProgressReporter, DEFAULT_CLI_NAME, DEFAULT_CLI_VERSION, formatBytes, formatCliCommand, formatDuration, isInteractive, parseDurationMs, parseTimeoutMs, resolveCliName, withProgress, } from "./utils.js";
39
17
  /**
40
18
  * Build the Commander program with all registered commands
41
19
  */
42
20
  export declare function buildProgram(options?: {
43
- name?: string;
44
- version?: string;
45
- getRuntime?: () => IAgentRuntime | null;
21
+ name?: string;
22
+ version?: string;
23
+ getRuntime?: () => IAgentRuntime | null;
46
24
  }): Command;
47
25
  /**
48
26
  * Run the CLI with the given arguments
49
27
  */
50
- export declare function runCli(
51
- argv?: string[],
52
- options?: {
53
- name?: string;
54
- version?: string;
55
- getRuntime?: () => IAgentRuntime | null;
56
- },
57
- ): Promise<void>;
28
+ export declare function runCli(argv?: string[], options?: {
29
+ name?: string;
30
+ version?: string;
31
+ getRuntime?: () => IAgentRuntime | null;
32
+ }): Promise<void>;
58
33
  /**
59
34
  * CLI Plugin for ElizaOS
60
35
  *
@@ -87,4 +62,4 @@ export declare function runCli(
87
62
  export declare const cliPlugin: Plugin;
88
63
  export default cliPlugin;
89
64
  export { Command } from "commander";
90
- //# sourceMappingURL=index.d.ts.map
65
+ //# sourceMappingURL=index.d.ts.map
@@ -32,21 +32,12 @@ export declare function clearCliCommands(): void;
32
32
  /**
33
33
  * Helper to create a CLI command definition
34
34
  */
35
- export declare function defineCliCommand(
36
- name: string,
37
- description: string,
38
- register: CliRegistrationFn,
39
- options?: {
40
- aliases?: string[];
41
- priority?: number;
42
- },
43
- ): CliCommand;
35
+ export declare function defineCliCommand(name: string, description: string, register: CliRegistrationFn, options?: {
36
+ aliases?: string[];
37
+ priority?: number;
38
+ }): CliCommand;
44
39
  /**
45
40
  * Helper to create a subcommand on an existing command
46
41
  */
47
- export declare function addSubcommand(
48
- parent: Command,
49
- name: string,
50
- description: string,
51
- ): Command;
52
- //# sourceMappingURL=registry.d.ts.map
42
+ export declare function addSubcommand(parent: Command, name: string, description: string): Command;
43
+ //# sourceMappingURL=registry.d.ts.map
package/dist/types.d.ts CHANGED
@@ -9,29 +9,29 @@ import type { Command } from "commander";
9
9
  * Logger interface for CLI context
10
10
  */
11
11
  export interface CliLogger {
12
- info: (msg: string) => void;
13
- warn: (msg: string) => void;
14
- error: (msg: string) => void;
15
- debug?: (msg: string) => void;
12
+ info: (msg: string) => void;
13
+ warn: (msg: string) => void;
14
+ error: (msg: string) => void;
15
+ debug?: (msg: string) => void;
16
16
  }
17
17
  /**
18
18
  * CLI context provided to command handlers
19
19
  */
20
20
  export interface CliContext {
21
- /** Commander program instance */
22
- program: Command;
23
- /** Optional runtime getter for plugins that need it */
24
- getRuntime?: () => IAgentRuntime | null;
25
- /** CLI name (e.g., "elizaos", "otto") */
26
- cliName: string;
27
- /** CLI version */
28
- version: string;
29
- /** Optional configuration object */
30
- config?: Record<string, unknown>;
31
- /** Optional workspace directory */
32
- workspaceDir?: string;
33
- /** Optional logger for CLI output */
34
- logger?: CliLogger;
21
+ /** Commander program instance */
22
+ program: Command;
23
+ /** Optional runtime getter for plugins that need it */
24
+ getRuntime?: () => IAgentRuntime | null;
25
+ /** CLI name (e.g., "elizaos", "otto") */
26
+ cliName: string;
27
+ /** CLI version */
28
+ version: string;
29
+ /** Optional configuration object */
30
+ config?: Record<string, unknown>;
31
+ /** Optional workspace directory */
32
+ workspaceDir?: string;
33
+ /** Optional logger for CLI output */
34
+ logger?: CliLogger;
35
35
  }
36
36
  /**
37
37
  * CLI command registration function signature
@@ -41,87 +41,87 @@ export type CliRegistrationFn = (ctx: CliContext) => void;
41
41
  * CLI command definition
42
42
  */
43
43
  export interface CliCommand {
44
- /** Command name (e.g., "run", "config") */
45
- name: string;
46
- /** Command description */
47
- description: string;
48
- /** Command aliases */
49
- aliases?: string[];
50
- /** Registration function */
51
- register: CliRegistrationFn;
52
- /** Priority for registration order (lower = earlier) */
53
- priority?: number;
44
+ /** Command name (e.g., "run", "config") */
45
+ name: string;
46
+ /** Command description */
47
+ description: string;
48
+ /** Command aliases */
49
+ aliases?: string[];
50
+ /** Registration function */
51
+ register: CliRegistrationFn;
52
+ /** Priority for registration order (lower = earlier) */
53
+ priority?: number;
54
54
  }
55
55
  /**
56
56
  * CLI plugin configuration
57
57
  */
58
58
  export interface CliPluginConfig {
59
- /** CLI name */
60
- name?: string;
61
- /** CLI version */
62
- version?: string;
63
- /** Commands to register */
64
- commands?: CliCommand[];
59
+ /** CLI name */
60
+ name?: string;
61
+ /** CLI version */
62
+ version?: string;
63
+ /** Commands to register */
64
+ commands?: CliCommand[];
65
65
  }
66
66
  /**
67
67
  * Progress reporter interface
68
68
  */
69
69
  export interface ProgressReporter {
70
- /** Start progress reporting */
71
- start(message: string): void;
72
- /** Update progress message */
73
- update(message: string): void;
74
- /** Complete with success */
75
- success(message: string): void;
76
- /** Complete with failure */
77
- fail(message: string): void;
78
- /** Stop progress reporting */
79
- stop(): void;
70
+ /** Start progress reporting */
71
+ start(message: string): void;
72
+ /** Update progress message */
73
+ update(message: string): void;
74
+ /** Complete with success */
75
+ success(message: string): void;
76
+ /** Complete with failure */
77
+ fail(message: string): void;
78
+ /** Stop progress reporting */
79
+ stop(): void;
80
80
  }
81
81
  /**
82
82
  * Progress options
83
83
  */
84
84
  export interface ProgressOptions {
85
- /** Initial message */
86
- message?: string;
87
- /** Whether to show spinner */
88
- spinner?: boolean;
85
+ /** Initial message */
86
+ message?: string;
87
+ /** Whether to show spinner */
88
+ spinner?: boolean;
89
89
  }
90
90
  /**
91
91
  * CLI dependencies for command execution
92
92
  */
93
93
  export interface CliDeps {
94
- /** Log function */
95
- log: (message: string) => void;
96
- /** Error function */
97
- error: (message: string) => void;
98
- /** Exit function */
99
- exit: (code: number) => void;
94
+ /** Log function */
95
+ log: (message: string) => void;
96
+ /** Error function */
97
+ error: (message: string) => void;
98
+ /** Exit function */
99
+ exit: (code: number) => void;
100
100
  }
101
101
  /**
102
102
  * Duration parsing result
103
103
  */
104
104
  export interface ParsedDuration {
105
- /** Duration in milliseconds */
106
- ms: number;
107
- /** Original string */
108
- original: string;
109
- /** Whether parsing was successful */
110
- valid: boolean;
105
+ /** Duration in milliseconds */
106
+ ms: number;
107
+ /** Original string */
108
+ original: string;
109
+ /** Whether parsing was successful */
110
+ valid: boolean;
111
111
  }
112
112
  /**
113
113
  * Command options commonly used across CLI commands
114
114
  */
115
115
  export interface CommonCommandOptions {
116
- /** JSON output format */
117
- json?: boolean;
118
- /** Verbose output */
119
- verbose?: boolean;
120
- /** Quiet mode (minimal output) */
121
- quiet?: boolean;
122
- /** Force action without confirmation */
123
- force?: boolean;
124
- /** Dry run (show what would happen) */
125
- dryRun?: boolean;
116
+ /** JSON output format */
117
+ json?: boolean;
118
+ /** Verbose output */
119
+ verbose?: boolean;
120
+ /** Quiet mode (minimal output) */
121
+ quiet?: boolean;
122
+ /** Force action without confirmation */
123
+ force?: boolean;
124
+ /** Dry run (show what would happen) */
125
+ dryRun?: boolean;
126
126
  }
127
- //# sourceMappingURL=types.d.ts.map
127
+ //# sourceMappingURL=types.d.ts.map
package/dist/utils.d.ts CHANGED
@@ -3,12 +3,7 @@
3
3
  *
4
4
  * Common utilities for CLI operations.
5
5
  */
6
- import type {
7
- CliDeps,
8
- ParsedDuration,
9
- ProgressOptions,
10
- ProgressReporter,
11
- } from "./types.js";
6
+ import type { CliDeps, ParsedDuration, ProgressOptions, ProgressReporter } from "./types.js";
12
7
  /**
13
8
  * Default CLI name
14
9
  */
@@ -24,18 +19,11 @@ export declare function createDefaultDeps(): CliDeps;
24
19
  /**
25
20
  * Create a progress reporter
26
21
  */
27
- export declare function createProgressReporter(
28
- deps: CliDeps,
29
- options?: ProgressOptions,
30
- ): ProgressReporter;
22
+ export declare function createProgressReporter(deps: CliDeps, options?: ProgressOptions): ProgressReporter;
31
23
  /**
32
24
  * Execute with progress reporting
33
25
  */
34
- export declare function withProgress<T>(
35
- deps: CliDeps,
36
- message: string,
37
- fn: () => Promise<T>,
38
- ): Promise<T>;
26
+ export declare function withProgress<T>(deps: CliDeps, message: string, fn: () => Promise<T>): Promise<T>;
39
27
  /**
40
28
  * Parse a duration string to milliseconds
41
29
  *
@@ -50,21 +38,15 @@ export declare function parseDurationMs(input: string): ParsedDuration;
50
38
  /**
51
39
  * Parse a timeout string with defaults
52
40
  */
53
- export declare function parseTimeoutMs(
54
- input: string | undefined,
55
- defaultMs: number,
56
- ): number;
41
+ export declare function parseTimeoutMs(input: string | undefined, defaultMs: number): number;
57
42
  /**
58
43
  * Format a CLI command with profile/env context
59
44
  */
60
- export declare function formatCliCommand(
61
- command: string,
62
- options?: {
63
- cliName?: string;
64
- profile?: string;
65
- env?: string;
66
- },
67
- ): string;
45
+ export declare function formatCliCommand(command: string, options?: {
46
+ cliName?: string;
47
+ profile?: string;
48
+ env?: string;
49
+ }): string;
68
50
  /**
69
51
  * Resolve CLI name from argv
70
52
  */
@@ -81,4 +63,4 @@ export declare function formatBytes(bytes: number): string;
81
63
  * Format duration to human readable string
82
64
  */
83
65
  export declare function formatDuration(ms: number): string;
84
- //# sourceMappingURL=utils.d.ts.map
66
+ //# sourceMappingURL=utils.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elizaos/plugin-cli",
3
- "version": "2.0.0-alpha.9",
3
+ "version": "2.0.0-beta.1",
4
4
  "description": "CLI framework plugin for ElizaOS agents - provides command registration, execution, and utilities",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -19,7 +19,7 @@
19
19
  "build": "tsc",
20
20
  "build:watch": "tsc --watch",
21
21
  "dev": "tsc --watch",
22
- "test": "vitest run --passWithNoTests",
22
+ "test": "vitest run",
23
23
  "lint": "bunx @biomejs/biome check --write --unsafe .",
24
24
  "lint:check": "bunx @biomejs/biome check .",
25
25
  "format": "bunx @biomejs/biome format --write .",
@@ -27,16 +27,13 @@
27
27
  "typecheck": "tsc --noEmit"
28
28
  },
29
29
  "dependencies": {
30
- "@elizaos/core": "2.0.0-alpha.3",
31
- "commander": "^12.1.0"
32
- },
33
- "peerDependencies": {
34
- "@elizaos/core": "2.0.0-alpha.3"
30
+ "@elizaos/core": "2.0.0-beta.1",
31
+ "commander": "^14.0.0"
35
32
  },
36
33
  "devDependencies": {
37
- "@biomejs/biome": "^2.3.11",
34
+ "@biomejs/biome": "^2.4.14",
38
35
  "strip-literal": "^3.1.0",
39
- "typescript": "^5.7.3",
36
+ "typescript": "^6.0.3",
40
37
  "vitest": "^4.0.18"
41
38
  },
42
39
  "keywords": [