GeezerVison is showing github.com — feat(commands): add `ns live` by NathanWalker · Pull Request #6184 · NativeScript/nativescript-cli
Conversation
Summary
ns live [--mac | --electron] [--new] [--no-open] [--allow-eval] [--token <t>]
LiveCommand.run
npx --yes @nativescript/edge-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/edge-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/edge-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/edge-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.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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
Bot
commented
Oct 31, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This branch has not been deployed
No deployments
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.