svamp-cli 0.1.32 → 0.1.33

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/cli.mjs CHANGED
@@ -86,8 +86,10 @@ async function main() {
86
86
  await handleAgentCommand();
87
87
  } else if (subcommand === "session") {
88
88
  await handleSessionCommand();
89
- } else if (subcommand === "--help" || subcommand === "-h" || !subcommand) {
89
+ } else if (subcommand === "--help" || subcommand === "-h") {
90
90
  printHelp();
91
+ } else if (!subcommand || subcommand === "start") {
92
+ await handleInteractiveCommand();
91
93
  } else if (subcommand === "--version" || subcommand === "-v") {
92
94
  const pkg = await import('./package-CMmjP_vD.mjs').catch(() => ({ default: { version: "unknown" } }));
93
95
  console.log(`svamp version: ${pkg.default.version}`);
@@ -97,6 +99,45 @@ async function main() {
97
99
  process.exit(1);
98
100
  }
99
101
  }
102
+ async function handleInteractiveCommand() {
103
+ const { runInteractive } = await import('./run-COUdcjR7.mjs');
104
+ const interactiveArgs = subcommand === "start" ? args.slice(1) : args;
105
+ let directory = process.cwd();
106
+ let resumeSessionId;
107
+ let continueSession = false;
108
+ let permissionMode;
109
+ const claudeArgs = [];
110
+ let pastSeparator = false;
111
+ for (let i = 0; i < interactiveArgs.length; i++) {
112
+ if (pastSeparator) {
113
+ claudeArgs.push(interactiveArgs[i]);
114
+ continue;
115
+ }
116
+ if (interactiveArgs[i] === "--") {
117
+ pastSeparator = true;
118
+ continue;
119
+ }
120
+ if ((interactiveArgs[i] === "-d" || interactiveArgs[i] === "--directory") && i + 1 < interactiveArgs.length) {
121
+ directory = interactiveArgs[++i];
122
+ } else if ((interactiveArgs[i] === "--resume" || interactiveArgs[i] === "-r") && i + 1 < interactiveArgs.length) {
123
+ resumeSessionId = interactiveArgs[++i];
124
+ } else if (interactiveArgs[i] === "--continue" || interactiveArgs[i] === "-c") {
125
+ continueSession = true;
126
+ } else if ((interactiveArgs[i] === "--permission-mode" || interactiveArgs[i] === "-p") && i + 1 < interactiveArgs.length) {
127
+ permissionMode = interactiveArgs[++i];
128
+ } else if (interactiveArgs[i] === "--help" || interactiveArgs[i] === "-h") {
129
+ printInteractiveHelp();
130
+ return;
131
+ }
132
+ }
133
+ await runInteractive({
134
+ directory,
135
+ resumeSessionId,
136
+ continueSession,
137
+ permissionMode,
138
+ claudeArgs: claudeArgs.length > 0 ? claudeArgs : void 0
139
+ });
140
+ }
100
141
  async function handleAgentCommand() {
101
142
  const agentArgs = args.slice(1);
102
143
  if (agentArgs.length === 0 || agentArgs[0] === "--help" || agentArgs[0] === "-h") {
@@ -653,32 +694,36 @@ async function uninstallDaemonService() {
653
694
  }
654
695
  function printHelp() {
655
696
  console.log(`
656
- svamp \u2014 Svamp CLI with Hypha transport
697
+ svamp \u2014 AI workspace on Hypha Cloud
657
698
 
658
699
  Usage:
700
+ svamp Start interactive Claude session (synced to cloud)
701
+ svamp start [-d <path>] Same as above, with explicit directory
659
702
  svamp login [url] Login to Hypha (opens browser, stores token)
660
703
  svamp daemon start Start the daemon (detached)
661
704
  svamp daemon stop Stop the daemon (sessions preserved for restart)
662
- svamp daemon stop --cleanup Stop and mark all sessions as stopped
663
705
  svamp daemon status Show daemon status
664
706
  svamp daemon install Install as system service (launchd/systemd/wrapper)
665
- svamp daemon uninstall Remove system service
666
- svamp session list List active daemon sessions
667
- svamp session machines List discoverable machines
707
+ svamp session list List active sessions
668
708
  svamp session spawn Spawn a new session on the daemon
669
- svamp session attach <id> Attach to a session (interactive)
709
+ svamp session attach <id> Attach to a session
670
710
  svamp session --help Show all session commands
671
711
  svamp agent list List known agents
672
712
  svamp agent <name> Start local agent session (gemini, codex)
673
- svamp agent -- <cmd> Start custom ACP agent
674
713
  svamp --version Show version
675
714
  svamp --help Show this help
676
715
 
716
+ Interactive mode:
717
+ When you run 'svamp' with no arguments, Claude starts in your terminal
718
+ with full interactive access. Your session is synced to Hypha Cloud so
719
+ it's visible in the web app. When a message arrives from the web app,
720
+ svamp switches to remote mode to process it, then you can press
721
+ Space-Space to return to local mode.
722
+
677
723
  Environment variables:
678
- HYPHA_SERVER_URL Hypha server URL (required for daemon)
724
+ HYPHA_SERVER_URL Hypha server URL (required for cloud sync)
679
725
  HYPHA_TOKEN Hypha auth token (stored by login command)
680
726
  HYPHA_WORKSPACE Hypha workspace / user ID (stored by login command)
681
- SVAMP_MACHINE_ID Machine identifier (optional, auto-generated)
682
727
  SVAMP_HOME Config directory (default: ~/.svamp)
683
728
  `);
684
729
  }
@@ -736,6 +781,34 @@ Examples:
736
781
  svamp session attach abc12345
737
782
  `);
738
783
  }
784
+ function printInteractiveHelp() {
785
+ console.log(`
786
+ svamp \u2014 Interactive Claude session with cloud sync
787
+
788
+ Usage:
789
+ svamp [-d <path>] [--resume <id>] [--continue] [--permission-mode <mode>] [-- <claude-args>]
790
+ svamp start [-d <path>] [...]
791
+
792
+ Options:
793
+ -d, --directory <path> Working directory (default: cwd)
794
+ -r, --resume <id> Resume a Claude session by ID
795
+ -c, --continue Continue the last Claude session
796
+ -p, --permission-mode <m> Permission mode: default, acceptEdits, bypassPermissions, plan
797
+ -- Pass remaining args to Claude CLI
798
+
799
+ Modes:
800
+ Local mode Full interactive Claude terminal UI (default)
801
+ Remote mode Processes messages from the web app
802
+
803
+ Switching:
804
+ When a message arrives from the web app \u2192 automatically switches to remote mode
805
+ Space Space Switch from remote mode back to local mode
806
+ Ctrl-C Ctrl-C Exit from remote mode
807
+
808
+ The session is synced to Hypha Cloud so it's visible in the web app.
809
+ Works offline if no Hypha credentials are configured.
810
+ `);
811
+ }
739
812
  function printAgentHelp() {
740
813
  console.log(`
741
814
  svamp agent \u2014 Interactive agent sessions (local, no daemon required)