Skip to content

CATALYST-1718: Add catalyst logs command to the CLI#2921

Merged
jordanarldt merged 1 commit intoalphafrom
CATALYST-1718
Mar 20, 2026
Merged

CATALYST-1718: Add catalyst logs command to the CLI#2921
jordanarldt merged 1 commit intoalphafrom
CATALYST-1718

Conversation

@jordanarldt
Copy link
Copy Markdown
Contributor

@jordanarldt jordanarldt commented Mar 13, 2026

Jira: CATALYST-1718

What/Why?

Adds a catalyst logs tail command that streams live logs from deployed Catalyst applications via SSE. The command connects to the Infrastructure API's log tail endpoint and supports multiple output formats (default, json, pretty, short, request) for different use cases — human-readable by default, json for piping to other tools.

The implementation includes TTL-based reconnection to avoid holding long-lived connections, retry logic with back-off for transient failures, and fatal error detection for 4xx responses. A query subcommand is stubbed for future historical log retrieval.

Also extracts shared CLI options (--store-hash, --access-token, --api-host, --project-uuid) into lib/shared-options.ts to deduplicate option definitions across deploy, project, and logs commands.

Testing

  • Full test suite added in logs.spec.ts covering SSE parsing, log formatting across all output formats, stream reconnection, TTL expiry, fatal error handling, and retry exhaustion.
  • Run: cd packages/catalyst && pnpm test
  • Manual: pnpm build && pnpm exec dist/cli.js logs --store-hash <hash> --access-token <token>

Proof of life

Screen.Recording.2026-03-13.at.11.29.38.AM.mov

Migration

No breaking changes. The shared options produce identical CLI flags and env var bindings as before.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 13, 2026

⚠️ No Changeset found

Latest commit: bce8fc0

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 13, 2026

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

Project Deployment Actions Updated (UTC)
catalyst Ready Ready Preview, Comment Mar 20, 2026 10:00pm

Request Review

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 13, 2026

Bundle Size Report

Comparing against baseline from c965f4d (2026-03-20).

No bundle size changes detected.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 13, 2026

Unlighthouse Performance Comparison — Vercel

Comparing PR preview deployment Unlighthouse scores vs production Unlighthouse scores.

Summary Score

Aggregate score across all categories as reported by Unlighthouse.

Prod Desktop Prod Mobile Preview Desktop Preview Mobile
Score 92 93 91 94

Category Scores

Category Prod Desktop Prod Mobile Preview Desktop Preview Mobile
Performance 77 74 76 73
Accessibility 95 95 95 95
Best Practices 100 100 95 95
SEO 100 100 100 100

Core Web Vitals

Metric Prod Desktop Prod Mobile Preview Desktop Preview Mobile
LCP 3.6 s 4.1 s 3.7 s 4.4 s
CLS 0.001 0.245 0 0.245
FCP 1.2 s 1.2 s 1.1 s 1.2 s
TBT 30 ms 0 ms 0 ms 0 ms
Max Potential FID 80 ms 40 ms 50 ms 50 ms
Time to Interactive 3.6 s 4.2 s 3.7 s 4.4 s

Full Unlighthouse report →

@jordanarldt jordanarldt force-pushed the CATALYST-1718 branch 2 times, most recently from 044dd5a to 7aa9ce6 Compare March 13, 2026 16:28
@jordanarldt jordanarldt marked this pull request as ready for review March 13, 2026 16:36
@jordanarldt jordanarldt requested a review from a team as a code owner March 13, 2026 16:36
const lines = raw.split('\n');
const dataLines: string[] = [];

lines.forEach((line) => {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🍹 do we want to map instead of forEach + side effect?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, definitely. Dang Claude, be more functional! 😆

Copy link
Copy Markdown
Contributor

@jorgemoya jorgemoya left a comment

Choose a reason for hiding this comment

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

Looks good to me! Some minor finishing touches.

Can you update packages/catalyst/src/cli/index.spec.ts to make sure the new command is accounted for, should be pretty quick.

Are we doing CLAUDE.md or AGENTS.md? Maybe something we can discuss later!

Nice job!

@jordanarldt
Copy link
Copy Markdown
Contributor Author

Looks good to me! Some minor finishing touches.

Can you update packages/catalyst/src/cli/index.spec.ts to make sure the new command is accounted for, should be pretty quick.

Are we doing CLAUDE.md or AGENTS.md? Maybe something we can discuss later!

Nice job!

I renamed it to AGENTS.md for now, just incase an engineer is using another model

Copy link
Copy Markdown
Contributor

@jorgemoya jorgemoya left a comment

Choose a reason for hiding this comment

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

This PR needs to target the alpha branch as base.

@jordanarldt jordanarldt merged commit 2726af4 into alpha Mar 20, 2026
16 checks passed
@jordanarldt jordanarldt deleted the CATALYST-1718 branch March 20, 2026 22:18
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.

4 participants