Skip to content

feat(commands): add ns live - #6184

Draft
NathanWalker wants to merge 1 commit into
mainfrom
feat/live-command
Draft

NathanWalker wants to merge 1 commit into
mainfrom
feat/live-command

Conversation

@NathanWalker

Copy link
Copy Markdown
Contributor

Summary

ns live [--mac | --electron] [--new] [--no-open] [--allow-eval] [--token <t>]
  LiveCommand.run
    npx --yes @nativescript/cloudflare-cli@latest live <the rest of argv>
      creates a project on preview.nativescript.org, or reopens this folder's (.ns-edge.json)
      opens its browser IDE
      phone:              prints a QR code for NativeScript Preview
      --mac / --electron: runs the app on this Mac, streamed into the IDE
    non-zero exit -> ctx.fail("ns live exited with code N.", { help: false })

ns live is the one-command entry point for live NativeScript projects on Cloudflare (ns-edge). It forwards to @nativescript/cloudflare-cli, the same way ns preview forwards to @nativescript/preview-cli. People without the NativeScript CLI get the same thing with npx nativescript live or npx @nativescript/cloudflare-cli live.

 lib/
 ├── bootstrap.ts                         # registerBuiltInCommand("live", …)
+├── commands/live.ts                     # Command({ name: "live", params: "any", allowUnknownOptions: true })
 docs/man_pages/project/testing/
+└── live.md
 test/commands/
+└── live.ts

Questions for review (why this is a draft):

  • @latest or a pinned version? @latest ships live-CLI fixes without a NativeScript CLI release. A pin makes a given ns version reproducible.
  • npx or install? ns preview installs its CLI into the project. ns live needs no project and is usually run from an empty folder, so it uses npx and npm's cache.

Evidence

  • Tests: test/commands/live.ts covers both paths:
    • ns live --mac --new spawns npx --yes @nativescript/cloudflare-cli@latest live --mac --new.
    • A non-zero exit fails with ns live exited with code 1.
  • Against the published live CLI, from an empty folder:
    $ ns live --ios
    --ios isn't available yet. Run `live` for a phone app or `live --mac` for a Mac app.
    ns live exited with code 1.
    
  • The live CLI itself, checked on production: live, live --mac and live --electron each created a free project from an empty folder.
    • The phone project printed a QR code for NativeScript Preview.
    • The Mac app rendered in 259 ms.
    • The Electron app rendered in 2.4 s and streamed to the IDE at 25 fps.
  • ns live --help renders the new man page.

Merge Danger

Door: two-way

A new command name; nothing existing changes.

Blast Radius: additive

live becomes a reserved command name, so an extension that registers its own live command would now collide with it.

Runs `npx @nativescript/cloudflare-cli live` with the rest of the command
line: it creates a project on preview.nativescript.org (or reopens this
folder's), opens its browser IDE and runs it on a phone through NativeScript
Preview, or on this Mac with --mac / --electron. It needs no project, so the
live CLI runs through npx rather than being installed into one, and its
non-zero exit fails the command.
@coderabbitai

coderabbitai Bot commented Oct 31, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

This branch has not been deployed

No deployments
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