Skip to content

Remove stack emulator CLI commands#1522

Merged
N2D4 merged 5 commits into
devfrom
devin/1780081405-remove-cli-emulator
May 29, 2026
Merged

Remove stack emulator CLI commands#1522
N2D4 merged 5 commits into
devfrom
devin/1780081405-remove-cli-emulator

Conversation

@N2D4
Copy link
Copy Markdown
Contributor

@N2D4 N2D4 commented May 29, 2026

Summary

  • Remove registration and implementation of the stack emulator command group.
  • Stop bundling emulator runtime assets into the stack CLI build output.
  • Update CLI/docs/generated metadata to avoid directing users to stack emulator start.

Validation

  • pnpm --filter @stackframe/stack-cli typecheck
  • cd packages/stack-cli && pnpm exec eslint --ext .tsx,.ts .
  • pnpm -C /home/ubuntu/repos/stack-auth exec vitest run packages/stack-cli/src
  • pnpm -C /home/ubuntu/repos/stack-auth --filter @stackframe/stack-cli build
  • node packages/stack-cli/dist/index.js --help
  • pnpm -C /home/ubuntu/repos/stack-auth lint
  • pnpm -C /home/ubuntu/repos/stack-auth codegen

Note: pnpm -C /home/ubuntu/repos/stack-auth typecheck currently fails in @stackframe/backend because generated Prisma client types are missing; the package-specific stack CLI typecheck passes.

Link to Devin session: https://app.devin.ai/sessions/86ff0cfc6c30453ca6c2e05877d40499
Requested by: @N2D4

Summary by CodeRabbit

  • Documentation

    • Removed local emulator command documentation and updated CLI guides to reference development environment workflows instead.
    • Updated SDK package references in documentation and CLI messaging.
  • Refactor

    • Removed the entire local emulator command functionality from the CLI.
    • Updated internal messaging and terminology throughout from "local emulator" to "development environment."
  • Chores

    • Updated repository URLs across package metadata to point to the new repository.

Review Change Stack

@devin-ai-integration
Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@vercel
Copy link
Copy Markdown

vercel Bot commented May 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
stack-auth-hosted-components Ready Ready Preview, Comment May 29, 2026 8:19pm
stack-auth-internal-tool Ready Ready Preview, Comment May 29, 2026 8:19pm
stack-auth-mcp Ready Ready Preview, Comment May 29, 2026 8:19pm
stack-auth-skills Ready Ready Preview, Comment May 29, 2026 8:19pm
stack-backend Ready Ready Preview, Comment May 29, 2026 8:19pm
stack-dashboard Ready Ready Preview, Comment May 29, 2026 8:19pm
stack-demo Ready Ready Preview, Comment May 29, 2026 8:19pm
stack-docs Ready Ready Preview, Comment May 29, 2026 8:19pm
stack-preview-backend Ready Ready Preview, Comment May 29, 2026 8:19pm
stack-preview-dashboard Ready Ready Preview, Comment May 29, 2026 8:19pm

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 29, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 821c1405-a5b6-463a-9f3d-c9ef8c6772c8

📥 Commits

Reviewing files that changed from the base of the PR and between fb7addb and 21ccab7.

📒 Files selected for processing (2)
  • docs-mintlify/llms-full.txt
  • packages/stack-shared/src/ai/unified-prompts/skill-site-prompt.ts
✅ Files skipped from review due to trivial changes (2)
  • packages/stack-shared/src/ai/unified-prompts/skill-site-prompt.ts
  • docs-mintlify/llms-full.txt

📝 Walkthrough

Walkthrough

Removes the stack emulator CLI/module and emulator asset-copying, updates CLI/init/auth/local-client messaging from "local emulator" to "development environment", simplifies init/.env generation, and updates docs and package repository metadata.

Changes

Emulator command removal and terminology standardization

Layer / File(s) Summary
Remove emulator asset copying from build script
packages/stack-cli/scripts/copy-runtime-assets.mjs
Removes emulator-specific generation/copy steps; retains dashboard asset copying.
Deregister emulator command from CLI entrypoint
packages/stack-cli/src/index.ts
Removes import and registration of the stack emulator subcommand.
Update init command to remove emulator selection flow
packages/stack-cli/src/commands/init.ts
Removes dynamic "local" prompt label, uses fixed "Hexclave Cloud" / "Local config file" choices, drops emulator next-steps messaging, and simplifies .env header and writer signature.
Update exec and project commands for development environment terminology
packages/stack-cli/src/commands/exec.ts, packages/stack-cli/src/commands/project.ts
Rewords help text and error messages to reference "development environment" instead of "local emulator" (options, descriptions, validation and unreachable-environment warnings).
Update authentication and local-environment client libraries; remove emulator paths
packages/stack-cli/src/lib/auth.ts, packages/stack-cli/src/lib/emulator-paths.ts, packages/stack-cli/src/lib/local-emulator-client.ts
Standardizes error messages and JSDoc to "development environment"; refactors auth response-body error paths; removes exported emulator port constants and emulatorImageDir helper.
Remove emulator command module and tests
packages/stack-cli/src/commands/emulator.ts, packages/stack-cli/src/commands/emulator.test.ts
Removes emulator CLI module and its test suite, deleting exported helpers for emulator management and associated tests.
Update CLI documentation and snippets
docs-mintlify/guides/going-further/cli.mdx, docs-mintlify/llms-full.txt, docs-mintlify/snippets/hexclave-agent-reminders.jsx
Removes "Local emulator commands" section, adds Warning for stack exec auth/privileges, narrows CLI description, and replaces @hexclave/stack with @hexclave/next in docs/snippets.
Update package repository metadata
packages/js/package.json, packages/react/package.json, packages/stack/package.json, packages/tanstack-start/package.json, packages/template/package.json
Updates repository URLs to point to https://github.com/hexclave/hexclave.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested reviewers

  • BilalG1
  • nams1570

Poem

🐰 I nudged the tiny VM away,

Docs tidied up for a brighter day.
"Development environment" now in view,
Fewer commands, the code feels new.
A nibble of carrot, and a patch or two.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 8.70% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and accurately summarizes the main change: removing the stack emulator CLI commands from the codebase.
Description check ✅ Passed The description provides a clear summary of changes, validation steps performed, and relevant context including the Devin session link and requestor.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch devin/1780081405-remove-cli-emulator

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 29, 2026

Greptile Summary

This PR removes the stack emulator CLI command group, its runtime asset bundling, and all user-facing references to stack emulator start. Error messages and help text across the CLI are updated to say "development environment" instead of "local emulator."

  • emulator.ts (949 lines) and emulator.test.ts (226 lines) are deleted entirely; registerEmulatorCommand is unregistered from index.ts, and the corresponding copyEmulatorAssets() build step is removed from copy-runtime-assets.mjs.
  • exec.ts, init.ts, project.ts, auth.ts, and local-emulator-client.ts are updated to remove references to stack emulator start and rename messaging from "local emulator" to "development environment".

Confidence Score: 4/5

Safe to merge — the removal is complete and consistent across commands, build scripts, and docs, with no broken imports or missing call-site updates.

The deletion of emulator.ts and its test file is clean, all registration and import sites are updated, and the messaging changes across exec/init/project/auth/local-emulator-client are consistent. The only residual issue is a handful of exported-but-now-unreferenced functions and constants left in emulator-paths.ts — dead code that doesn't affect runtime behaviour but should be cleaned up.

packages/stack-cli/src/lib/emulator-paths.ts — several exported functions and constants are now unreachable and can be removed.

Important Files Changed

Filename Overview
packages/stack-cli/src/commands/emulator.ts Deleted entirely — all 949 lines of QEMU emulator command logic are removed cleanly.
packages/stack-cli/src/commands/emulator.test.ts Deleted entirely — test file for the removed emulator command.
packages/stack-cli/src/lib/emulator-paths.ts Only comments updated; several exported functions (emulatorImageDir, emulatorMinioPort, emulatorInbucketPort, emulatorMockOAuthPort) and their corresponding constants are now dead exports after emulator.ts was deleted.
packages/stack-cli/src/commands/init.ts Removed emulator-specific UI labels, the variant parameter from writeProjectKeysToEnv, and post-init emulator start instructions; behavior change is intentional and consistent with emulator removal.
packages/stack-cli/src/index.ts Removed import and registration of registerEmulatorCommand — clean and complete.
packages/stack-cli/scripts/copy-runtime-assets.mjs copyEmulatorAssets() and its QEMU/env file path variables removed; now only copies dashboard assets.
packages/stack-cli/src/commands/exec.ts Error message and help text updated from 'local emulator' to 'development environment' — cosmetic and correct.
packages/stack-cli/src/lib/auth.ts Error messages updated to remove stack emulator start hints and rename 'Local emulator' to 'Development environment'.
packages/stack-cli/src/lib/local-emulator-client.ts Error messages updated consistently; no logic changes.
packages/stack-cli/src/commands/project.ts Help text and warning updated to remove 'local emulator' and stack emulator start references.
docs-mintlify/guides/going-further/cli.mdx Removed 'Local emulator commands' section and description references to the local emulator.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[stack CLI entry point\nindex.ts] --> B[registerExecCommand]
    A --> C[registerInitCommand]
    A --> D[registerProjectCommand]
    A --> E[registerDevCommand]
    A --> F[registerWhoamiCommand]
    A --> G[registerFixCommand]
    A --> H[registerDoctorCommand]

    subgraph REMOVED ["❌ Removed"]
        R1[registerEmulatorCommand\nemulator.ts]
        R2[copyEmulatorAssets\ncopy-runtime-assets.mjs]
        R3[emulator.test.ts]
    end

    C -->|"Local config file\n(was: Local emulator)"| C1[handleCreate\ncreates hexclave.config.ts only]
    C -->|"Hexclave Cloud"| C2[handleCreateCloud\nwriteProjectKeysToEnv]

    D --> D1["project list / create\n(--dev: development environment)"]
    B --> B1["exec --config-file\n(was: local emulator)"]

    B1 --> EP[emulator-paths.ts\nstill resolves PCK path + ports]
    C1 --> EP
Loading

Comments Outside Diff (1)

  1. packages/stack-cli/src/lib/emulator-paths.ts, line 38-67 (link)

    P2 Dead exports after emulator.ts deletion

    emulatorImageDir, emulatorMinioPort, emulatorInbucketPort, emulatorMockOAuthPort (and their corresponding DEFAULT_EMULATOR_* constants) are no longer called anywhere in the codebase now that emulator.ts has been removed. They can be deleted together with the three unused constants (DEFAULT_EMULATOR_MINIO_PORT, DEFAULT_EMULATOR_INBUCKET_PORT, DEFAULT_EMULATOR_MOCK_OAUTH_PORT) at the top of the file.

    Prompt To Fix With AI
    This is a comment left during a code review.
    Path: packages/stack-cli/src/lib/emulator-paths.ts
    Line: 38-67
    
    Comment:
    **Dead exports after emulator.ts deletion**
    
    `emulatorImageDir`, `emulatorMinioPort`, `emulatorInbucketPort`, `emulatorMockOAuthPort` (and their corresponding `DEFAULT_EMULATOR_*` constants) are no longer called anywhere in the codebase now that `emulator.ts` has been removed. They can be deleted together with the three unused constants (`DEFAULT_EMULATOR_MINIO_PORT`, `DEFAULT_EMULATOR_INBUCKET_PORT`, `DEFAULT_EMULATOR_MOCK_OAUTH_PORT`) at the top of the file.
    
    How can I resolve this? If you propose a fix, please make it concise.

    Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
packages/stack-cli/src/lib/emulator-paths.ts:38-67
**Dead exports after emulator.ts deletion**

`emulatorImageDir`, `emulatorMinioPort`, `emulatorInbucketPort`, `emulatorMockOAuthPort` (and their corresponding `DEFAULT_EMULATOR_*` constants) are no longer called anywhere in the codebase now that `emulator.ts` has been removed. They can be deleted together with the three unused constants (`DEFAULT_EMULATOR_MINIO_PORT`, `DEFAULT_EMULATOR_INBUCKET_PORT`, `DEFAULT_EMULATOR_MOCK_OAUTH_PORT`) at the top of the file.

Reviews (1): Last reviewed commit: "Remove stack emulator CLI commands" | Re-trigger Greptile

Copy link
Copy Markdown

@vercel vercel Bot left a comment

Choose a reason for hiding this comment

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

Additional Suggestion:

E2E tests are testing the 'emulator' command group which has been removed from the stack-cli package, causing test failures

Fix on Vercel

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
docs-mintlify/guides/going-further/cli.mdx (1)

75-75: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Stale emulator reference left in init description.

The init flow no longer offers an emulator-based option (it now offers "Hexclave Cloud" vs "Local config file"), but this line still tells users the wizard can "create a local config file for the emulator." Update to match the narrowed scope.

📝 Suggested wording
-The wizard can create a cloud project, create a local config file for the emulator, or link an existing project. In interactive terminals, it can run an agent to apply the setup changes to your app. Use `--no-agent` to print manual setup instructions instead.
+The wizard can create a cloud project, create a local config file, or link an existing project. In interactive terminals, it can run an agent to apply the setup changes to your app. Use `--no-agent` to print manual setup instructions instead.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs-mintlify/guides/going-further/cli.mdx` at line 75, Summary: The init
description incorrectly mentions creating "a local config file for the emulator"
when the flow no longer supports an emulator; update the wording to reflect the
actual options ("Hexclave Cloud" vs "Local config file"). Fix: edit the sentence
in the init flow text (the line that currently reads "The wizard can create a
cloud project, create a local config file for the emulator, or link an existing
project...") to remove "for the emulator" and instead say something like "create
a local config file" or explicitly "create a local config file for local use"
and keep the rest of the sentence (including the note about running an agent and
--no-agent) intact so it matches the current init options.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/stack-cli/src/commands/init.ts`:
- Around line 168-171: Replace the truthiness check on args.projectId with an
explicit null/undefined check: change the condition in init.ts from if
(args.projectId) to if (args.projectId != null) (or !== undefined if you
prefer), keeping the body that logs the dashboard URL and using
encodeURIComponent(args.projectId) as before; this ensures you're explicitly
testing for null/undefined rather than truthiness.

---

Outside diff comments:
In `@docs-mintlify/guides/going-further/cli.mdx`:
- Line 75: Summary: The init description incorrectly mentions creating "a local
config file for the emulator" when the flow no longer supports an emulator;
update the wording to reflect the actual options ("Hexclave Cloud" vs "Local
config file"). Fix: edit the sentence in the init flow text (the line that
currently reads "The wizard can create a cloud project, create a local config
file for the emulator, or link an existing project...") to remove "for the
emulator" and instead say something like "create a local config file" or
explicitly "create a local config file for local use" and keep the rest of the
sentence (including the note about running an agent and --no-agent) intact so it
matches the current init options.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5b5f63f3-4b7b-4527-874d-c0a592324714

📥 Commits

Reviewing files that changed from the base of the PR and between da0e74a and ae4ce46.

📒 Files selected for processing (11)
  • docs-mintlify/guides/going-further/cli.mdx
  • packages/stack-cli/scripts/copy-runtime-assets.mjs
  • packages/stack-cli/src/commands/emulator.test.ts
  • packages/stack-cli/src/commands/emulator.ts
  • packages/stack-cli/src/commands/exec.ts
  • packages/stack-cli/src/commands/init.ts
  • packages/stack-cli/src/commands/project.ts
  • packages/stack-cli/src/index.ts
  • packages/stack-cli/src/lib/auth.ts
  • packages/stack-cli/src/lib/emulator-paths.ts
  • packages/stack-cli/src/lib/local-emulator-client.ts
💤 Files with no reviewable changes (3)
  • packages/stack-cli/src/index.ts
  • packages/stack-cli/src/commands/emulator.ts
  • packages/stack-cli/src/commands/emulator.test.ts

Comment thread packages/stack-cli/src/commands/init.ts Outdated
Copy link
Copy Markdown

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

No issues found across 11 files

Re-trigger cubic

Copilot AI review requested due to automatic review settings May 29, 2026 20:10
@N2D4 N2D4 review requested due to automatic review settings May 29, 2026 20:10
@N2D4 N2D4 merged commit 0838a22 into dev May 29, 2026
26 of 36 checks passed
@N2D4 N2D4 deleted the devin/1780081405-remove-cli-emulator branch May 29, 2026 20:12
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