Cross-platform Codex workspace switcher with a preserved macOS shell workflow.
Project description
codex-workspaces
codex-workspaces switches between multiple Codex workspace directories by keeping each workspace in ~/.codex-<name> and pointing the active ~/.codex path at the selected workspace.
The project now has two entry points:
- A cross-platform Python 3 CLI for Linux, macOS, and Windows.
- The original macOS Bash script, still kept at
codex-workspaces, for users who installed the shell workflow directly.
On macOS, the Python CLI preserves the original app workflow: stop Codex App, switch the workspace link, and start Codex App again. On Linux and Windows, app control is skipped and the CLI only switches the workspace link.
Features
- Manage workspace directories such as
~/.codex-workand~/.codex-personal. - Switch the active
~/.codexsymlink or directory link. - Create workspace directories and migrate an existing real
~/.codexdirectory. - Keep macOS Codex App stop/start/restart support.
- Block unsafe operations from a detected Codex built-in terminal when they cannot be delegated safely.
- Support English and Chinese output through
CODEX_WORKSPACES_LANG. - Package as a Python project with tests, CI, and PyPI publishing workflow.
Requirements
- Python 3.9 or newer for the Python CLI.
- macOS is required only for Codex App control commands:
start,stop, andrestart. - Linux and macOS use directory symlinks.
- Windows uses directory symlinks when available and falls back to directory junctions.
Install
Install the Python CLI from PyPI:
python3 -m pip install codex-workspaces
For isolated CLI installs, pipx is recommended:
pipx install codex-workspaces
Install from a local checkout for development:
python3 -m pip install -e ".[dev]"
The legacy macOS shell installer is still available:
tmp="$(mktemp -t codex-workspaces.XXXXXX)" && curl -fsSL https://raw.githubusercontent.com/blockchain-project-lives/codex-workspaces/main/codex-workspaces -o "$tmp" && bash "$tmp" install && rm -f "$tmp"
Workspace Layout
Default layout:
~/.codex -> active workspace link
~/.codex-work workspace directory named work
~/.codex-personal workspace directory named personal
Customize paths with CODEX_WORKSPACES_LINK and CODEX_WORKSPACES_PREFIX.
Usage
Create workspaces:
codex-workspaces create personal
codex-workspaces create work
If you already have a real ~/.codex directory, migrate it first:
codex-workspaces create personal --migrate-current
Switch workspaces:
codex-workspaces work
codex-workspaces use personal
codex-workspaces switch work
On macOS, switching stops and restarts Codex App by default. Skip those steps when needed:
codex-workspaces work --no-stop --no-start
Inspect workspaces:
codex-workspaces list
codex-workspaces current
Control Codex App on macOS:
codex-workspaces stop
codex-workspaces start
codex-workspaces restart
Environment Variables
| Variable | Default | Description |
|---|---|---|
CODEX_APP_NAME |
Codex |
macOS app name to control. |
CODEX_QUIT_TIMEOUT |
20 |
Seconds to wait for app exit. |
CODEX_WORKSPACES_LINK |
$HOME/.codex |
Active workspace link path. |
CODEX_WORKSPACES_PREFIX |
$HOME/.codex- |
Workspace directory prefix. |
CODEX_WORKSPACES_LANG |
auto | Force output language with en or zh. |
Only the CODEX_WORKSPACES_* variables are used for workspace-specific configuration.
Development
python3 -m pip install -e ".[dev]"
python3 -m pytest
python3 -m build
python3 -m twine check dist/*
Design, test, and release notes live in docs/.
Publishing
CI runs tests on Linux, macOS, and Windows across Python 3.9, 3.11, and 3.13. The Publish to PyPI workflow builds and publishes distributions when a GitHub Release is published or the workflow is run manually.
Configure TestPyPI and PyPI Trusted Publishing for this repository before using the release workflows. See docs/RELEASE.zh-CN.md.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file codex_workspaces-0.1.0.tar.gz.
File metadata
- Download URL: codex_workspaces-0.1.0.tar.gz
- Upload date:
- Size: 27.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0b5433b4aa3ac8005342cdf55730394ee8ccb50c624c20f272f7d84453406894
|
|
| MD5 |
0616b53faf7d4648ed4e8a4fd6072110
|
|
| BLAKE2b-256 |
4914a57eeefa1ca7dc99d43c6a223b0a58362898b7dbcd0d9b11d303a8c1a421
|
Provenance
The following attestation bundles were made for codex_workspaces-0.1.0.tar.gz:
Publisher:
publish.yml on blockchain-project-lives/codex-workspaces
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
codex_workspaces-0.1.0.tar.gz -
Subject digest:
0b5433b4aa3ac8005342cdf55730394ee8ccb50c624c20f272f7d84453406894 - Sigstore transparency entry: 2069018259
- Sigstore integration time:
-
Permalink:
blockchain-project-lives/codex-workspaces@7ede5fe6ec04ff34d7283c7edff7521fd739f411 -
Branch / Tag:
refs/heads/release/v0.2.0 - Owner: https://github.com/blockchain-project-lives
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7ede5fe6ec04ff34d7283c7edff7521fd739f411 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file codex_workspaces-0.1.0-py3-none-any.whl.
File metadata
- Download URL: codex_workspaces-0.1.0-py3-none-any.whl
- Upload date:
- Size: 14.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0c699ccfbfd9d44eb7dd59da6a067c448cd55075eedc611e4138864f3f399ae3
|
|
| MD5 |
08555d01580302b2671894b0eaff2b21
|
|
| BLAKE2b-256 |
1df6b5f4edafe0b353b702c736bc371cc6f2069c45c703ccebe57d37d786e350
|
Provenance
The following attestation bundles were made for codex_workspaces-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on blockchain-project-lives/codex-workspaces
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
codex_workspaces-0.1.0-py3-none-any.whl -
Subject digest:
0c699ccfbfd9d44eb7dd59da6a067c448cd55075eedc611e4138864f3f399ae3 - Sigstore transparency entry: 2069018492
- Sigstore integration time:
-
Permalink:
blockchain-project-lives/codex-workspaces@7ede5fe6ec04ff34d7283c7edff7521fd739f411 -
Branch / Tag:
refs/heads/release/v0.2.0 - Owner: https://github.com/blockchain-project-lives
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7ede5fe6ec04ff34d7283c7edff7521fd739f411 -
Trigger Event:
workflow_dispatch
-
Statement type: