Skip to content

feat(vis): show LAN URLs when binding to 0.0.0.0 for remote control#1878

Open
bj456736 wants to merge 1 commit into
MoonshotAI:mainfrom
bj456736:feat/lan-remote-control-urls
Open

feat(vis): show LAN URLs when binding to 0.0.0.0 for remote control#1878
bj456736 wants to merge 1 commit into
MoonshotAI:mainfrom
bj456736:feat/lan-remote-control-urls

Conversation

@bj456736

Copy link
Copy Markdown
Contributor

When vis-server binds to 0.0.0.0 or :: (all interfaces), the startup banner and CLI output now display the actual LAN IP addresses that other devices on the same network can use to connect. This enables lan-range remote control from phones, tablets, or other machines.

Changes

  • apps/vis/server/src/config.ts: Add isAllInterfaces() and getLocalNetworkAddresses() helpers
  • apps/vis/server/src/start.ts: Add lanUrls field to StartedVisServer, populated when binding to all interfaces
  • apps/vis/server/src/startup-banner.ts: List LAN URLs in startup banner when applicable
  • apps/vis/server/src/index.ts: Pass lanUrls to banner formatter
  • apps/kimi-code/src/cli/sub/vis.ts: Print LAN access URLs in CLI output
  • apps/vis/server/test/lib/config.test.ts: Add unit tests for new helpers

Testing

  • 127.0.0.1 binding → no LAN URLs shown ✓
  • 0.0.0.0 binding → LAN URLs discovered and displayed ✓
  • Unit tests for isAllInterfaces and getLocalNetworkAddresses pass (5 new tests) ✓

When vis-server binds to 0.0.0.0 or :: (all interfaces), the startup
banner and CLI output now display the actual LAN IP addresses that
other devices on the same network can use to connect. This enables
lan-range remote control from phones, tablets, or other machines.

Changes:
- Add isAllInterfaces() and getLocalNetworkAddresses() to config.ts
- Add lanUrls field to StartedVisServer in start.ts
- Update formatStartupBanner() to list LAN URLs when applicable
- Update vis CLI handler to print LAN access URLs
- Add unit tests for isAllInterfaces and getLocalNetworkAddresses
@changeset-bot

changeset-bot Bot commented Jul 18, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 57f1eec

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

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

@pkg-pr-new

pkg-pr-new Bot commented Jul 18, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@57f1eec
npx https://pkg.pr.new/@moonshot-ai/kimi-code@57f1eec

commit: 57f1eec

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

Copy link
Copy Markdown

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: 57f1eec340

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@@ -0,0 +1,11 @@
---
"@moonshot-ai/kimi-code": patch
"@moonshot-ai/vis-server": patch

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 Remove ignored vis-server from the changeset

This repo's changeset config ignores @moonshot-ai/vis-server, and Changesets fails publishing when an ignored package is mentioned in the same changeset as a non-ignored package. Because this file includes both publishable @moonshot-ai/kimi-code and ignored @moonshot-ai/vis-server, the release PR's pnpm changeset version/publish path will fail instead of cutting the CLI patch; keep only the publishable package and describe the bundled vis-server behavior there.

Useful? React with 👍 / 👎.

describe('getLocalNetworkAddresses', () => {
it('returns non-empty array of IPv4 URLs for a valid port', () => {
const addresses = getLocalNetworkAddresses(3001);
expect(addresses.length).toBeGreaterThan(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.

P2 Badge Mock host interfaces in the new config test

On CI or developer machines with only loopback interfaces, or with no non-internal IPv4 interface, getLocalNetworkAddresses() legitimately returns an empty array, so this new assertion fails for host setup rather than product behavior. Since os.networkInterfaces() is environment-dependent, mock it for this test and cover the empty-interface case separately instead of requiring length > 0.

Useful? React with 👍 / 👎.

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