Skip to content

Conversation

BYK
Copy link
Member

@BYK BYK commented Oct 9, 2025

This CLI introduces commands like logs or errors which can also be
combined with a , or + to listen to multiple streams at once.

The first iteration will be a streaming log like tail -f but in the next
iteration we will add a no-follow mode that accepts some filters like a
timeWindow or limit as the MCP does.

Closes #958.

BYK and others added 5 commits October 9, 2025 13:14
This CLI introduces commands like `logs` or `errors` which can also be
combined with a `,` or `+` to listen to multiple streams at once.

The first iteration will be a streaming log like `tail -f` but in the next
iteration we will add a `no-follow` mode that accepts some filters like a
`timeWindow` or `limit` as the MCP does.

This requires connecting to an already running upstream sidecar instance,
which we also wanna address with the streaming/follow mode.
@BYK BYK changed the title adi/fix/cli formatting Add a CLI that agents can also use instead of the MCP Oct 9, 2025
@BYK BYK requested review from MathurAditya724 and betegon October 9, 2025 14:39
Copy link

vercel bot commented Oct 9, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
spotlightjs Skipped Skipped Oct 10, 2025 7:23pm

Copy link

vercel bot commented Oct 9, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
spotlightjs Building Building Preview Comment Oct 9, 2025 3:15pm

cursor[bot]

This comment was marked as outdated.

@betegon
Copy link
Member

betegon commented Oct 9, 2025

250 new lines and 17 files modified but not a single comment from cursor 🥇. Having a look at this later today (I want to try it locally also)

edit: oh cursor took like 10 mins to leave a comment and there were no 👀 in the PR description...

Examples:
spotlight-sidecar # Start on default port 8969
spotlight-sidecar --port 3000 # Start on port 3000
spotlight-sidecar -p 3000 -d # Start on port 3000 with debug logging
Copy link

Choose a reason for hiding this comment

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

Potential bug: The code does not validate the result of envelope.getParsedEnvelope(), leading to a crash if the envelope is malformed (null) or empty (empty items array).
  • Description: The function envelope.getParsedEnvelope() can return null if the envelope header is malformed. The code destructures this result via const { event } = envelope.getParsedEnvelope() without a null check, which will cause the process to crash. Additionally, even with a valid envelope, if it contains no items, the event[1] array will be empty. The subsequent access event[1][0][0].type will then cause a crash due to an out-of-bounds access. Both scenarios, a malformed header or a valid but empty envelope, will lead to a server crash.

  • Suggested fix: Before destructuring or accessing properties, check if the return value of envelope.getParsedEnvelope() is null. Also, add a check to ensure the event[1] array (the envelope items) is not empty before attempting to access its elements. A guard clause like if (!envelope || !event || event[1].length === 0) { return; } would prevent both crashes.
    severity: 0.9, confidence: 0.95

Did we get this right? 👍 / 👎 to inform future reviews.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

Copy link
Member

@betegon betegon left a comment

Choose a reason for hiding this comment

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

First pass. Added a couple of commits to fix some bugs. I'll do another review later.

I tried it locally, it's great and we need to improve the formatter 😆 .

@BYK BYK force-pushed the adi/fix/cli-formatting branch from 209026c to 29dc7af Compare October 10, 2025 10:41
cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

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.

Spotlight CLI

4 participants