@zhongqian97-code/ecode 0.5.16 → 0.5.17
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.js +55 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5935,6 +5935,60 @@ var require2 = createRequire(import.meta.url);
|
|
|
5935
5935
|
var { version } = require2("../package.json");
|
|
5936
5936
|
var VERSION = version;
|
|
5937
5937
|
var rawArgs = process.argv.slice(2);
|
|
5938
|
+
function isHelpFlag(arg) {
|
|
5939
|
+
return arg === "-h" || arg === "--help" || arg === "-help";
|
|
5940
|
+
}
|
|
5941
|
+
function renderRootHelp() {
|
|
5942
|
+
return `ecode \u2014 terminal + web AI coding assistant
|
|
5943
|
+
|
|
5944
|
+
Usage:
|
|
5945
|
+
ecode [options]
|
|
5946
|
+
ecode sessions <subcommand> [args]
|
|
5947
|
+
ecode web [options]
|
|
5948
|
+
|
|
5949
|
+
Options:
|
|
5950
|
+
-h, --help, -help Show help
|
|
5951
|
+
-v, --version Show version
|
|
5952
|
+
--auto Auto-approve normal shell commands
|
|
5953
|
+
--log-dir <dir> Override JSONL log directory
|
|
5954
|
+
--replay <file> Replay a session log
|
|
5955
|
+
--fork <file:turn> Fork a session log at a turn
|
|
5956
|
+
--pipe Read prompt from stdin and output JSONL
|
|
5957
|
+
|
|
5958
|
+
Commands:
|
|
5959
|
+
sessions Inspect, replay, and fork logged sessions
|
|
5960
|
+
web Start the web admin server
|
|
5961
|
+
|
|
5962
|
+
Run \`ecode sessions -h\` or \`ecode web -h\` for command-specific help.`;
|
|
5963
|
+
}
|
|
5964
|
+
function renderSessionsHelp() {
|
|
5965
|
+
return `Usage: ecode sessions <list|inspect|replay|fork> [args...]
|
|
5966
|
+
|
|
5967
|
+
list \u5217\u51FA\u6240\u6709\u5386\u53F2\u4F1A\u8BDD
|
|
5968
|
+
inspect <id> \u663E\u793A\u4F1A\u8BDD\u8BE6\u60C5
|
|
5969
|
+
replay <id> \u8F93\u51FA\u7528\u4E8E\u56DE\u653E\u7684\u547D\u4EE4
|
|
5970
|
+
fork <id> [turn] \u8F93\u51FA\u7528\u4E8E\u5206\u53C9\u5230\u6307\u5B9A\u8F6E\u6B21\u7684\u547D\u4EE4`;
|
|
5971
|
+
}
|
|
5972
|
+
function renderWebHelp() {
|
|
5973
|
+
return `Usage: ecode web [options]
|
|
5974
|
+
|
|
5975
|
+
Options:
|
|
5976
|
+
-h, --help, -help Show help
|
|
5977
|
+
--host <host> Bind host (default: 127.0.0.1)
|
|
5978
|
+
--port <port> Bind port (default: 4310)`;
|
|
5979
|
+
}
|
|
5980
|
+
if (isHelpFlag(rawArgs[0])) {
|
|
5981
|
+
console.log(renderRootHelp());
|
|
5982
|
+
process.exit(0);
|
|
5983
|
+
}
|
|
5984
|
+
if (rawArgs[0] === "sessions" && (!rawArgs[1] || isHelpFlag(rawArgs[1]))) {
|
|
5985
|
+
console.log(renderSessionsHelp());
|
|
5986
|
+
process.exit(0);
|
|
5987
|
+
}
|
|
5988
|
+
if (rawArgs[0] === "web" && isHelpFlag(rawArgs[1])) {
|
|
5989
|
+
console.log(renderWebHelp());
|
|
5990
|
+
process.exit(0);
|
|
5991
|
+
}
|
|
5938
5992
|
var autoMode = false;
|
|
5939
5993
|
var cliLogDir;
|
|
5940
5994
|
var replayFile;
|
|
@@ -6025,7 +6079,7 @@ if (rawArgs[0] === "sessions") {
|
|
|
6025
6079
|
}
|
|
6026
6080
|
if (rawArgs[0] === "web") {
|
|
6027
6081
|
let webPort = 4310;
|
|
6028
|
-
let webHost = "
|
|
6082
|
+
let webHost = "127.0.0.1";
|
|
6029
6083
|
for (let i = 1; i < rawArgs.length; i++) {
|
|
6030
6084
|
const arg = rawArgs[i];
|
|
6031
6085
|
const next = rawArgs[i + 1];
|