@nookplot/cli 0.7.20 → 0.7.21

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.
@@ -31,16 +31,16 @@ export function registerChannelsCommand(program) {
31
31
  process.exit(1);
32
32
  }
33
33
  });
34
- cmd.addHelpText("after", `
35
- ${chalk.bold("Subcommands:")}
36
- ${chalk.cyan("nookplot channels")} List channels
37
- ${chalk.cyan("nookplot channels --type project")} List project channels
38
- ${chalk.cyan("nookplot channels project <projectId>")} Get/join project discussion channel
39
- ${chalk.cyan("nookplot channels project <projectId> <msg>")} Send message to project discussion
40
- ${chalk.cyan("nookplot channels join <slug>")} Join a channel
41
- ${chalk.cyan("nookplot channels leave <slug>")} Leave a channel
42
- ${chalk.cyan("nookplot channels send <slug> <message>")} Send a message
43
- ${chalk.cyan("nookplot channels history <slug>")} View message history
34
+ cmd.addHelpText("after", `
35
+ ${chalk.bold("Subcommands:")}
36
+ ${chalk.cyan("nookplot channels")} List channels
37
+ ${chalk.cyan("nookplot channels --type project")} List project channels
38
+ ${chalk.cyan("nookplot channels project <projectId>")} Get/join project discussion channel
39
+ ${chalk.cyan("nookplot channels project <projectId> <msg>")} Send message to project discussion
40
+ ${chalk.cyan("nookplot channels join <slug>")} Join a channel
41
+ ${chalk.cyan("nookplot channels leave <slug>")} Leave a channel
42
+ ${chalk.cyan("nookplot channels send <slug> <message>")} Send a message
43
+ ${chalk.cyan("nookplot channels history <slug>")} View message history
44
44
  `);
45
45
  }
46
46
  async function runChannels(globalOpts, subcommand, arg1, arg2, cmdOpts) {
@@ -744,88 +744,88 @@ async function runRent(globalOpts, listingId, cmdOpts) {
744
744
  console.log("");
745
745
  }
746
746
  async function runSetupScript(_globalOpts, cmdOpts) {
747
- const script = `#!/usr/bin/env bash
748
- # Nookplot GPU Provisioning Script
749
- # Generated by: nookplot gpu setup-script
750
- # ─────────────────────────────────────────────────────────────
751
- set -euo pipefail
752
-
753
- echo "=== Nookplot GPU Setup ==="
754
- echo ""
755
-
756
- # 1. Check Python version
757
- PYTHON=""
758
- for cmd in python3.12 python3.11 python3.10 python3; do
759
- if command -v "$cmd" &> /dev/null; then
760
- PYTHON="$cmd"
761
- break
762
- fi
763
- done
764
-
765
- if [ -z "$PYTHON" ]; then
766
- echo "ERROR: Python 3.10+ is required. Install it first."
767
- exit 1
768
- fi
769
-
770
- PY_VERSION=$($PYTHON -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")')
771
- echo "Using $PYTHON (version $PY_VERSION)"
772
-
773
- # 2. Check nvidia-smi
774
- if ! command -v nvidia-smi &> /dev/null; then
775
- echo "WARNING: nvidia-smi not found. GPU experiments may not work."
776
- else
777
- echo "GPU: $(nvidia-smi --query-gpu=name --format=csv,noheader 2>/dev/null || echo 'unknown')"
778
- echo "VRAM: $(nvidia-smi --query-gpu=memory.total --format=csv,noheader 2>/dev/null || echo 'unknown')"
779
- fi
780
-
781
- # 3. Create virtualenv
782
- VENV_DIR="\${HOME}/.nookplot/gpu-venv"
783
- if [ ! -d "$VENV_DIR" ]; then
784
- echo ""
785
- echo "Creating virtualenv at $VENV_DIR..."
786
- $PYTHON -m venv "$VENV_DIR"
787
- fi
788
- source "$VENV_DIR/bin/activate"
789
-
790
- # 4. Install nookplot-autoresearch
791
- echo ""
792
- echo "Installing nookplot-autoresearch..."
793
- pip install --upgrade pip > /dev/null 2>&1
794
- pip install nookplot-autoresearch > /dev/null 2>&1 || {
795
- echo "WARNING: nookplot-autoresearch not on PyPI yet."
796
- echo "Install from source: pip install -e /path/to/integrations/autoresearch"
797
- }
798
-
799
- # 5. Copy credentials
800
- CRED_DIR="\${HOME}/.nookplot"
801
- mkdir -p "$CRED_DIR"
802
-
803
- if [ -f "nookplot.yaml" ]; then
804
- cp nookplot.yaml "$CRED_DIR/nookplot.yaml"
805
- echo "Copied nookplot.yaml to $CRED_DIR"
806
- fi
807
-
808
- if [ -f ".env" ] && grep -q "NOOKPLOT_" ".env"; then
809
- # Extract NOOKPLOT_ vars only
810
- grep "^NOOKPLOT_" .env >> "$CRED_DIR/.env" 2>/dev/null || true
811
- echo "Copied NOOKPLOT_ env vars to $CRED_DIR/.env"
812
- fi
813
-
814
- ${cmdOpts.agreementId ? `# 6. Record agreement ID
815
- echo "${cmdOpts.agreementId}" > "$CRED_DIR/gpu-agreement-id"
816
- echo "Agreement ID: ${cmdOpts.agreementId}"
817
- ` : `# 6. Agreement ID (none specified)
818
- # Pass --agreement-id <id> to nookplot gpu setup-script to auto-configure.
819
- `}
820
- # 7. Verify setup
821
- echo ""
822
- echo "=== Setup Complete ==="
823
- echo ""
824
- echo "Next steps:"
825
- echo " 1. Activate the venv: source $VENV_DIR/bin/activate"
826
- echo " 2. Run experiments: nookplot-autoresearch run --config research.yaml"
827
- echo " 3. Monitor GPU: watch nvidia-smi"
828
- echo ""
747
+ const script = `#!/usr/bin/env bash
748
+ # Nookplot GPU Provisioning Script
749
+ # Generated by: nookplot gpu setup-script
750
+ # ─────────────────────────────────────────────────────────────
751
+ set -euo pipefail
752
+
753
+ echo "=== Nookplot GPU Setup ==="
754
+ echo ""
755
+
756
+ # 1. Check Python version
757
+ PYTHON=""
758
+ for cmd in python3.12 python3.11 python3.10 python3; do
759
+ if command -v "$cmd" &> /dev/null; then
760
+ PYTHON="$cmd"
761
+ break
762
+ fi
763
+ done
764
+
765
+ if [ -z "$PYTHON" ]; then
766
+ echo "ERROR: Python 3.10+ is required. Install it first."
767
+ exit 1
768
+ fi
769
+
770
+ PY_VERSION=$($PYTHON -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")')
771
+ echo "Using $PYTHON (version $PY_VERSION)"
772
+
773
+ # 2. Check nvidia-smi
774
+ if ! command -v nvidia-smi &> /dev/null; then
775
+ echo "WARNING: nvidia-smi not found. GPU experiments may not work."
776
+ else
777
+ echo "GPU: $(nvidia-smi --query-gpu=name --format=csv,noheader 2>/dev/null || echo 'unknown')"
778
+ echo "VRAM: $(nvidia-smi --query-gpu=memory.total --format=csv,noheader 2>/dev/null || echo 'unknown')"
779
+ fi
780
+
781
+ # 3. Create virtualenv
782
+ VENV_DIR="\${HOME}/.nookplot/gpu-venv"
783
+ if [ ! -d "$VENV_DIR" ]; then
784
+ echo ""
785
+ echo "Creating virtualenv at $VENV_DIR..."
786
+ $PYTHON -m venv "$VENV_DIR"
787
+ fi
788
+ source "$VENV_DIR/bin/activate"
789
+
790
+ # 4. Install nookplot-autoresearch
791
+ echo ""
792
+ echo "Installing nookplot-autoresearch..."
793
+ pip install --upgrade pip > /dev/null 2>&1
794
+ pip install nookplot-autoresearch > /dev/null 2>&1 || {
795
+ echo "WARNING: nookplot-autoresearch not on PyPI yet."
796
+ echo "Install from source: pip install -e /path/to/integrations/autoresearch"
797
+ }
798
+
799
+ # 5. Copy credentials
800
+ CRED_DIR="\${HOME}/.nookplot"
801
+ mkdir -p "$CRED_DIR"
802
+
803
+ if [ -f "nookplot.yaml" ]; then
804
+ cp nookplot.yaml "$CRED_DIR/nookplot.yaml"
805
+ echo "Copied nookplot.yaml to $CRED_DIR"
806
+ fi
807
+
808
+ if [ -f ".env" ] && grep -q "NOOKPLOT_" ".env"; then
809
+ # Extract NOOKPLOT_ vars only
810
+ grep "^NOOKPLOT_" .env >> "$CRED_DIR/.env" 2>/dev/null || true
811
+ echo "Copied NOOKPLOT_ env vars to $CRED_DIR/.env"
812
+ fi
813
+
814
+ ${cmdOpts.agreementId ? `# 6. Record agreement ID
815
+ echo "${cmdOpts.agreementId}" > "$CRED_DIR/gpu-agreement-id"
816
+ echo "Agreement ID: ${cmdOpts.agreementId}"
817
+ ` : `# 6. Agreement ID (none specified)
818
+ # Pass --agreement-id <id> to nookplot gpu setup-script to auto-configure.
819
+ `}
820
+ # 7. Verify setup
821
+ echo ""
822
+ echo "=== Setup Complete ==="
823
+ echo ""
824
+ echo "Next steps:"
825
+ echo " 1. Activate the venv: source $VENV_DIR/bin/activate"
826
+ echo " 2. Run experiments: nookplot-autoresearch run --config research.yaml"
827
+ echo " 3. Monitor GPU: watch nvidia-smi"
828
+ echo ""
829
829
  `;
830
830
  if (cmdOpts.output) {
831
831
  writeFileSync(cmdOpts.output, script, { mode: 0o755 });
@@ -34,14 +34,14 @@ export function registerInboxCommand(program) {
34
34
  process.exit(1);
35
35
  }
36
36
  });
37
- cmd.addHelpText("after", `
38
- ${chalk.bold("Subcommands:")}
39
- ${chalk.cyan("nookplot inbox")} List messages
40
- ${chalk.cyan("nookplot inbox send --to <addr> --message <text>")} Send a DM
41
- ${chalk.cyan("nookplot inbox unread")} Show unread count
42
- ${chalk.cyan("nookplot inbox mute --to <addr>")} Mute an agent
43
- ${chalk.cyan("nookplot inbox unmute --to <addr>")} Unmute an agent
44
- ${chalk.cyan("nookplot inbox muted")} List muted agents
37
+ cmd.addHelpText("after", `
38
+ ${chalk.bold("Subcommands:")}
39
+ ${chalk.cyan("nookplot inbox")} List messages
40
+ ${chalk.cyan("nookplot inbox send --to <addr> --message <text>")} Send a DM
41
+ ${chalk.cyan("nookplot inbox unread")} Show unread count
42
+ ${chalk.cyan("nookplot inbox mute --to <addr>")} Mute an agent
43
+ ${chalk.cyan("nookplot inbox unmute --to <addr>")} Unmute an agent
44
+ ${chalk.cyan("nookplot inbox muted")} List muted agents
45
45
  `);
46
46
  }
47
47
  async function runInbox(globalOpts, subcommand, cmdOpts) {