Skip to content

feat: add welcome message and update check on no arguments in CLI#89

Open
Shubhdeep12 wants to merge 4 commits intoresend:mainfrom
Shubhdeep12:feat/welcome-message
Open

feat: add welcome message and update check on no arguments in CLI#89
Shubhdeep12 wants to merge 4 commits intoresend:mainfrom
Shubhdeep12:feat/welcome-message

Conversation

@Shubhdeep12
Copy link
Contributor

@Shubhdeep12 Shubhdeep12 commented Mar 13, 2026

related #88

  • added welcome message
  • added test for welcome and logo
image

Summary by cubic

Show a friendly welcome when the CLI runs with no arguments. It prints the ASCII logo and command hints, runs the update check, and exits 0.

  • New Features

    • Added src/lib/logo.ts with printWelcome using picocolors, tests for logo/welcome, and welcome_error handling.
    • Preserved behavior for other commands; skip update check when update runs.
  • Refactors

    • Removed unnecessary process.exit in the CLI and improved test exec options for stability.

Written for commit 9080aa6. Summary will update on new commits.

Copy link
Contributor

@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.

4 issues found across 4 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="tests/welcome.test.ts">

<violation number="1" location="tests/welcome.test.ts:18">
P2: `execFileSync('npx', ...)` runs without a shell. On Windows `npx` is a `.cmd` shim, and Node requires `shell: true` to execute `.cmd`/`.bat` files after the CVE-2024-27980 changes. This will fail the test on Windows regardless of CLI behavior. Add a Windows-only shell or wrap with `cmd.exe`/`npx.cmd`.</violation>
</file>

<file name="src/cli.ts">

<violation number="1" location="src/cli.ts:108">
P2: No-argument CLI path makes update-check failures fatal, unlike the existing best-effort updater behavior.</violation>

<violation number="2" location="src/cli.ts:109">
P2: Forced `process.exit(0)` after welcome/update output can truncate pending stdout/stderr writes.</violation>
</file>

<file name="src/lib/logo.ts">

<violation number="1" location="src/lib/logo.ts:40">
P2: Welcome-screen command hints misuse `|` as “or”, causing copy/pasted examples to execute as invalid shell pipelines.</violation>
</file>

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


const hints: [string, string][] = [
['resend --help', 'Display help and commands'],
['resend login | logout', 'Authenticate with Resend'],
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Mar 13, 2026

Choose a reason for hiding this comment

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

P2: Welcome-screen command hints misuse | as “or”, causing copy/pasted examples to execute as invalid shell pipelines.

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

<comment>Welcome-screen command hints misuse `|` as “or”, causing copy/pasted examples to execute as invalid shell pipelines.</comment>

<file context>
@@ -0,0 +1,67 @@
+
+  const hints: [string, string][] = [
+    ['resend --help', 'Display help and commands'],
+    ['resend login | logout', 'Authenticate with Resend'],
+    ['resend auth list | switch | remove', 'Manage profiles'],
+    ['resend emails send | batch | receiving', 'Send and manage emails'],
</file context>
Fix with Cubic

@Shubhdeep12
Copy link
Contributor Author

i think we can add some branding in CLI. wdyt about this @felipefreitag ?

@felipefreitag
Copy link
Contributor

Thanks, I'll check with the team

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.

2 participants