Skip to content

feat: add predict and predictions CLI commands#22

Open
sidneyswift wants to merge 1 commit intomainfrom
feature/predictions-commands
Open

feat: add predict and predictions CLI commands#22
sidneyswift wants to merge 1 commit intomainfrom
feature/predictions-commands

Conversation

@sidneyswift
Copy link
Copy Markdown
Contributor

@sidneyswift sidneyswift commented Apr 10, 2026

Summary

  • recoup predict --url <fileUrl> --modality <type> — run an engagement prediction
  • recoup predictions list — list past predictions with scores
  • recoup predictions get <id> — get full prediction detail
  • Both support --json flag for machine-readable output

Test plan

  • Build passes (pnpm build)
  • recoup predict --help shows correct options
  • recoup predictions list --help and recoup predictions get --help work

Made with Cursor


Summary by cubic

Add CLI support to run engagement predictions and browse history. Includes human-readable and JSON output for easy scripting.

  • New Features
    • recoup predict --url <fileUrl> --modality <video|audio|text> [--json] — runs a prediction and prints score, modality, duration, inference time, peaks, weak spots, and ID.
    • recoup predictions list [--limit <n>] [--offset <n>] [--json] — lists past predictions with ID, modality, score, and created time.
    • recoup predictions get <id> [--json] — shows full details for a prediction, including file URL, timing, peaks, and weak spots.
    • Registered the new commands in the CLI entrypoint.

Written for commit 27b960b. Summary will update on new commits.

recoup predict --url <fileUrl> --modality <type> runs a neural
engagement prediction. recoup predictions list/get manages history.

Made-with: Cursor
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 10, 2026

Warning

Rate limit exceeded

@sidneyswift has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 28 minutes and 24 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 28 minutes and 24 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4b2fa665-fc8a-476f-a23f-8ce3627e8590

📥 Commits

Reviewing files that changed from the base of the PR and between f736a24 and 27b960b.

📒 Files selected for processing (3)
  • src/bin.ts
  • src/commands/predict.ts
  • src/commands/predictions.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/predictions-commands

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 issues found across 3 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/commands/predict.ts">

<violation number="1" location="src/commands/predict.ts:5">
P2: Custom agent: **Flag AI Slop and Fabricated Changes**

Narrating JSDoc that restates the code. The first line duplicates the `.description()` string, and the rest summarizes the obvious `post()` call and `console.log` output. Remove it or replace with genuinely useful context (e.g., expected API error codes, rate-limit behavior).</violation>
</file>

<file name="src/commands/predictions.ts">

<violation number="1" location="src/commands/predictions.ts:60">
P2: The peak-moments and weak-spots rendering blocks are duplicated almost verbatim from `predict.ts`. If the API response shape changes (e.g., a renamed field), both files need identical edits. Consider extracting a small shared helper (e.g., `printMoments(label, items)`) to keep them in sync.</violation>

<violation number="2" location="src/commands/predictions.ts:86">
P2: Custom agent: **Flag AI Slop and Fabricated Changes**

Remove this narrating JSDoc block — it restates what `.description()` and the subcommand definitions already express. No other command file in the project has such a comment, and Commander already exposes this information via `--help`.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review, or fix all with cubic.

Comment thread src/commands/predict.ts
import { post } from "../client.js";
import { printJson, printError } from "../output.js";

/**
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot Apr 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Custom agent: Flag AI Slop and Fabricated Changes

Narrating JSDoc that restates the code. The first line duplicates the .description() string, and the rest summarizes the obvious post() call and console.log output. Remove it or replace with genuinely useful context (e.g., expected API error codes, rate-limit behavior).

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/commands/predict.ts, line 5:

<comment>Narrating JSDoc that restates the code. The first line duplicates the `.description()` string, and the rest summarizes the obvious `post()` call and `console.log` output. Remove it or replace with genuinely useful context (e.g., expected API error codes, rate-limit behavior).</comment>

<file context>
@@ -0,0 +1,67 @@
+import { post } from "../client.js";
+import { printJson, printError } from "../output.js";
+
+/**
+ * `recoup predict` — run a neural engagement prediction on content.
+ *
</file context>
Fix with Cubic

}
});

/**
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot Apr 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Custom agent: Flag AI Slop and Fabricated Changes

Remove this narrating JSDoc block — it restates what .description() and the subcommand definitions already express. No other command file in the project has such a comment, and Commander already exposes this information via --help.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/commands/predictions.ts, line 86:

<comment>Remove this narrating JSDoc block — it restates what `.description()` and the subcommand definitions already express. No other command file in the project has such a comment, and Commander already exposes this information via `--help`.</comment>

<file context>
@@ -0,0 +1,96 @@
+    }
+  });
+
+/**
+ * `recoup predictions` — manage engagement prediction history.
+ *
</file context>
Fix with Cubic

console.log(` Created: ${data.created_at}`);
console.log();

const peaks = data.peak_moments as
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot Apr 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: The peak-moments and weak-spots rendering blocks are duplicated almost verbatim from predict.ts. If the API response shape changes (e.g., a renamed field), both files need identical edits. Consider extracting a small shared helper (e.g., printMoments(label, items)) to keep them in sync.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/commands/predictions.ts, line 60:

<comment>The peak-moments and weak-spots rendering blocks are duplicated almost verbatim from `predict.ts`. If the API response shape changes (e.g., a renamed field), both files need identical edits. Consider extracting a small shared helper (e.g., `printMoments(label, items)`) to keep them in sync.</comment>

<file context>
@@ -0,0 +1,96 @@
+      console.log(`  Created:          ${data.created_at}`);
+      console.log();
+
+      const peaks = data.peak_moments as
+        | { time_seconds: number; score: number }[]
+        | undefined;
</file context>
Fix with Cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant