Usage
Flags
—reset
Reset and reconfigure existing workspace configuration.--reset prompts you to reconfigure both repositories from scratch.
—repo
Specify which repository context to use as the default.site
This determines which repository Dex commands target by default when --repo is not explicitly passed to other commands.
First-time setup
When you rundex setup for the first time, the wizard guides you through:
Site repo (dexdsl.github.io)
Choose to use an existing local path or clone the repository via GitHub CLI.
Configuration modes
For each repository, you can:Use existing local repo path
Provides a prompt to enter the absolute path to an existing local repository. Validation:- Path must exist
- Must be a valid git repository (contains
.git/) - Must be a repository root (not a subdirectory)
Clone repository (guided)
Requires GitHub CLI (
gh) to be installed and authenticated.gh is not authenticated, the wizard prompts:
gh auth login interactively.
After authentication, you provide:
- Repo URL - Full GitHub repo URL (e.g.,
https://github.com/user/repo.git) - Parent directory - Where to clone the repo (e.g.,
~/projects) - Folder name - Name of the cloned directory (auto-inferred from URL)
Workspace config file
Setup writes configuration to:Config overrides
You can override the config file location with environment variables: Explicit config file path:DEX_CONFIG_DIR, the config file becomes $DEX_CONFIG_DIR/dexdsl/workspaces.json.
Workspace resolution
When you run any Dex command, workspace resolution works as follows:- Read workspace config from file
- Determine active repo (explicit
--repoflag, ordefaultRepofrom config) - Resolve active repo root from config
- Change working directory (
chdir) to repo root - Execute command in that context
All Dex commands operate in the context of the resolved workspace root. You do NOT need to
cd into the repo directory manually.Default repo URLs
During setup, the wizard auto-detects default URLs from: Site repo:$DEX_SITE_REPO_URLenvironment variablegit config --get remote.origin.urlin the Dex script directory
$DEX_API_REPO_URLenvironment variable- Inferred from site repo URL by replacing
dexdsl.github.iowithdex-api
Non-interactive fallback
If Dex is run in a non-interactive environment (no TTY) without a valid workspace config:- Dex falls back to the current working directory
- Prints guidance to run
dex setupmanually - Commands may fail if they require workspace-specific paths
Examples
First-time setup
Reset existing configuration
Set API as default repo
api as the default repo for Dex commands.
Override config location
~/my-workspace.json instead of the default location.
Troubleshooting
Workspace config canceled
If you cancel setup partway through:dex setup to complete configuration.
GitHub CLI not installed
- Install
ghfrom https://cli.github.com/ - Or choose “Use existing local repo path” during setup
gh auth login failed
- Run
gh auth loginmanually in your terminal - Or choose “Use existing local repo path” during setup
Invalid repo path
.git/).
Operational behavior
Auto-resolve workspace root
Dex automatically resolves the active repo root from workspace config before executing commands.
- You can run
dexcommands from any directory - You do NOT need to manually
cdinto the repo - All relative paths in Dex commands are relative to the repo root
Related commands
dex deploy
Deploy changes from configured workspace
Workspace Concepts
Learn about workspace configuration