Skip to content

Conversation

@kylecarbs
Copy link
Member

When running cmux via make start (development mode), the data directory is now ~/.cmux-dev instead of ~/.cmux. This prevents development state from interfering with production state.

Changes

  • Set CMUX_DEV_MODE=1 environment variable in the start Make target
  • Modified getCmuxHome() to append -dev suffix when CMUX_DEV_MODE=1
  • Preserves existing CMUX_TEST_ROOT behavior for test isolation

Testing

Verified with make typecheck - all type checks pass.

Generated with cmux

- Set CMUX_DEV_MODE=1 in 'make start' to use ~/.cmux-dev
- Modified getCmuxHome() to append '-dev' suffix when CMUX_DEV_MODE=1
- Preserves CMUX_TEST_ROOT behavior for test isolation

This prevents dev state from interfering with prod state during development.

_Generated with `cmux`_
Use existing NODE_ENV convention rather than inventing new env var.
- Removed explicit NODE_ENV=development from make start
- Set NODE_ENV=production in packaged apps via app.isPackaged check
- Dev builds (undefined NODE_ENV) automatically use ~/.cmux-dev
- Packaged apps (NODE_ENV=production) use ~/.cmux

This is cleaner and doesn't require explicit env vars in Makefile.
- Set NODE_ENV=development explicitly in 'make start' and 'make dev-server'
- Default behavior (no NODE_ENV or any other value) uses ~/.cmux
- Only NODE_ENV=development uses ~/.cmux-dev
- Removes all automatic detection logic - fully explicit

This is cleaner and easier to understand.
@kylecarbs kylecarbs requested a review from ThomasK33 November 13, 2025 14:33
@kylecarbs kylecarbs added this pull request to the merge queue Nov 13, 2025
Merged via the queue into main with commit a8b86e9 Nov 13, 2025
14 checks passed
@kylecarbs kylecarbs deleted the dev-data-dir-separation branch November 13, 2025 14:44
ammar-agent added a commit that referenced this pull request Nov 13, 2025
Renames CMUX_TEST_ROOT to CMUX_ROOT for clearer intent - this env var is
not just for tests, but for any scenario where you want to override the
default data directory.

The -dev suffix behavior from #573 is preserved:
- `make start` uses `~/.cmux-dev` (NODE_ENV=development)
- Packaged apps use `~/.cmux`
- `CMUX_ROOT=/custom/path` overrides both

Changes:
- Renamed CMUX_TEST_ROOT → CMUX_ROOT in all files
- Updated comments to reflect the clearer naming
- All existing behavior preserved

_Generated with `cmux`_
ammario pushed a commit that referenced this pull request Nov 13, 2025
Renames `CMUX_TEST_ROOT` to `CMUX_ROOT` for clearer intent. This
environment variable overrides the default cmux data directory and is
useful beyond just testing scenarios (e.g., when developers want to run
with a clean slate or isolate different development environments).

## Changes

- `CMUX_TEST_ROOT` → `CMUX_ROOT` in all references (`paths.ts`,
`main-desktop.ts`, `electronTest.ts`)
- Updated comments to match the new name

## Behavior

No behavior changes - this is purely a rename:
- `make start` still uses `~/.cmux-dev` (via `NODE_ENV=development`,
behavior from #573)
- Packaged apps still use `~/.cmux`
- `CMUX_ROOT=/custom/path` still overrides everything

The rename clarifies that this variable isn't just for tests -
developers can use it anytime they want explicit control over the data
directory.

_Generated with `cmux`_
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.

2 participants