]> git.giacomolli.uk - onechat/blobdiff - main.go
Import WhatsApp exports before live messages
[onechat] / main.go
diff --git a/main.go b/main.go
index 04b06770977eac566ca0599a0766f4864b095bbb..f4f09c47ba7f78919630a61b11b1899216715d31 100644 (file)
--- a/main.go
+++ b/main.go
@@ -15,6 +15,8 @@ const usage = `Usage: onechat [COMMAND]
 Commands:
   chat                     talk to the agent in this terminal (default)
   daemon                   run the agent, Telegram, and WhatsApp
+  import [-n] ZIP...        import WhatsApp history (stop the daemon first)
+    -n                     print the plan without model calls
   login                    log in to ChatGPT with a device code
   probe LOG COUNT [BUILDS] measure the compactor on a log, with real calls
   help                     show this help
@@ -52,6 +54,8 @@ func run() error {
                return daemon(ctx, os.Stdout)
        case len(args) == 0 || len(args) == 1 && args[0] == "chat":
                return terminal(ctx, os.Stdin, os.Stdout)
+       case len(args) > 0 && args[0] == "import":
+               return whatsappImport(ctx, args[1:], os.Stdout)
        case len(args) > 0 && args[0] == "probe":
                err := probe(ctx, args[1:], os.Stdout)
                if err != nil {