codex-link 0.1.0 → 0.1.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.js +26 -18
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
// src/index.ts
|
|
4
4
|
import { watch as watch2 } from "fs";
|
|
5
5
|
import { join as join4 } from "path";
|
|
6
|
+
import { fileURLToPath } from "url";
|
|
6
7
|
import { Command } from "commander";
|
|
7
8
|
|
|
8
9
|
// ../shared/src/env.ts
|
|
@@ -971,25 +972,32 @@ async function runUnshare(target, apiUrl) {
|
|
|
971
972
|
await revokeTrackedSession(target, context);
|
|
972
973
|
context.logger.log(`Revoked ${target}`);
|
|
973
974
|
}
|
|
974
|
-
|
|
975
|
-
program
|
|
976
|
-
program.
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
975
|
+
function createProgram() {
|
|
976
|
+
const program = new Command();
|
|
977
|
+
program.name("cdxl").description("Publish and track Codex chats").showHelpAfterError().showSuggestionAfterError();
|
|
978
|
+
program.command("share").description("Create a public share for one Codex session and print its URL.").argument("<sessionId>", "Codex session ID to publish").option("--api-url <url>", "Override the CodexLink API base URL").action(async (sessionId, options) => {
|
|
979
|
+
await runShare(sessionId, options.apiUrl);
|
|
980
|
+
});
|
|
981
|
+
program.command("track").description("Keep one session synced to the same public link as new messages arrive.").argument("<sessionId>", "Codex session ID to track continuously").option("--api-url <url>", "Override the CodexLink API base URL").action(async (sessionId, options) => {
|
|
982
|
+
await runTrack(sessionId, options.apiUrl);
|
|
983
|
+
});
|
|
984
|
+
program.command("monitor").description("Watch for new local Codex sessions and offer to start tracking them.").option("--api-url <url>", "Override the CodexLink API base URL").action(async (options) => {
|
|
985
|
+
await runMonitor(options.apiUrl);
|
|
986
|
+
});
|
|
987
|
+
program.command("unshare").description("Revoke a public share by share ID or by a locally tracked session ID.").argument("<shareOrSessionId>", "Share ID or tracked session ID to revoke").option("--api-url <url>", "Override the CodexLink API base URL").action(async (target, options) => {
|
|
988
|
+
await runUnshare(target, options.apiUrl);
|
|
989
|
+
});
|
|
990
|
+
return program;
|
|
991
|
+
}
|
|
992
|
+
var isMainModule = process.argv[1] === fileURLToPath(import.meta.url);
|
|
993
|
+
if (isMainModule) {
|
|
994
|
+
createProgram().parseAsync(process.argv).catch((error) => {
|
|
995
|
+
console.error(error);
|
|
996
|
+
process.exitCode = 1;
|
|
997
|
+
});
|
|
998
|
+
}
|
|
992
999
|
export {
|
|
1000
|
+
createProgram,
|
|
993
1001
|
runMonitor,
|
|
994
1002
|
runShare,
|
|
995
1003
|
runTrack,
|