Skip to content

feat: add Relaycast CLI package#119

Merged
khaliqgant merged 2 commits intomainfrom
codex/add-relaycast-cli
Apr 17, 2026
Merged

feat: add Relaycast CLI package#119
khaliqgant merged 2 commits intomainfrom
codex/add-relaycast-cli

Conversation

@khaliqgant
Copy link
Copy Markdown
Member

@khaliqgant khaliqgant commented Apr 17, 2026

Summary

  • add @relaycast/cli with a relaycast binary backed by the MCP tool registry
  • expose MCP tool names as CLI commands, plus tools, help, and version helpers
  • wire cli into the npm publish workflow, release notes, version sync, lockfile, and README docs
  • document CLI authentication with RELAY_API_KEY / --relay-api-key and RELAY_AGENT_TOKEN / --relay-agent-token

Verification

  • npm install
  • npm run -w @relaycast/cli lint
  • npm run -w @relaycast/cli test
  • npm run -w @relaycast/cli build
  • npx turbo build --filter=@relaycast/cli
  • npx tsx packages/cli/src/cli.ts tools

Note: npm install reports the existing audit count of 11 vulnerabilities (7 moderate, 4 high).


Open with Devin

@github-actions
Copy link
Copy Markdown

Preview deployed!

Environment URL
API https://pr119-api.relaycast.dev
Health https://pr119-api.relaycast.dev/health
Observer https://pr119-observer.relaycast.dev/observer

This preview shares the staging database and will be cleaned up when the PR is merged or closed.

Run E2E tests

npm run e2e -- https://pr119-api.relaycast.dev --ci

Open observer dashboard

https://pr119-observer.relaycast.dev/observer

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e8c0190178

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/cli/src/index.ts Outdated
Comment on lines +102 to +104
const result = await session.callTool(parsed.command, toolArgs);
writeToolResult(io.stdout, result, parsed.outputJson);
return 0;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Return non-zero when tool invocation reports isError

runCli always returns 0 after session.callTool, even when the MCP result indicates a tool-level failure (isError: true). In this repo, many expected failures are represented that way (for example, calling message.post before registration), so shell scripts and CI jobs using relaycast will treat failed operations as success and continue incorrectly. This should map tool error results to a non-zero exit code.

Useful? React with 👍 / 👎.

Comment thread packages/cli/src/index.ts
Comment on lines +380 to +382
if (!next || isFlag(next)) {
return { value: true, consumed: false };
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Reject missing values for value-taking flags

readFlagValue treats a missing value as boolean true for every flag, including string/number options. That causes malformed invocations to be accepted silently (for example relaycast workspace.set_key --api-key passes api_key: true, and relaycast --relay-base-url workspace.list consumes the command as the URL). The CLI should throw a clear error when non-boolean flags are missing a value instead of coercing to true.

Useful? React with 👍 / 👎.

devin-ai-integration[bot]

This comment was marked as resolved.

index.ts: return non-zero exit when tool result has isError=true (P1)
index.ts: reject missing values for non-boolean flags (P2)
index.ts: handle negated --no-* flags correctly in parseCliArgs

Co-Authored-By: My Senior Dev <dev@myseniordev.com>
@khaliqgant khaliqgant merged commit 5df8f68 into main Apr 17, 2026
4 checks passed
@khaliqgant khaliqgant deleted the codex/add-relaycast-cli branch April 17, 2026 09:00
Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 1 new potential issue.

View 8 additional findings in Devin Review.

Open in Devin Review

Comment thread packages/cli/src/index.ts
allowBooleanDefault = false,
): { value: string | boolean; consumed: boolean } {
const next = argv[index + 1];
if (!next || isFlag(next)) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 readFlagValue rejects empty-string values due to falsy check

The !next check on line 391 is true for both undefined (when there is no next argument) and '' (an empty string). This means relaycast message.post --text "" would throw "Missing value for --text" instead of accepting the empty string as the value. The same issue affects global flags via readGlobalFlagValue at packages/cli/src/index.ts:412. The --flag= inline syntax works around this because empty inline values go through inlineValue != null at packages/cli/src/index.ts:248, bypassing readFlagValue entirely.

Suggested change
if (!next || isFlag(next)) {
if (next == null || isFlag(next)) {
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

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