Skip to main content

Installation

Dex CLI is a Node.js-based tool that requires Node.js and npm to be installed on your system.

Prerequisites

Before installing Dex, ensure you have the following installed:

Node.js

Version 16.x or higher recommended

npm

Comes bundled with Node.js

Git

Required for repository operations

Terminal

Access to a command-line interface

Installation Steps

1

Clone the Repository

Clone the dex-cli repository to your local machine:
git clone https://github.com/dexdsl/dex-cli.git
cd dex-cli
2

Install Dependencies

Install all required npm packages:
npm install
This will install all dependencies defined in package.json, including:
  • prompts - Interactive command-line prompts
  • React and Ink for TUI rendering
  • Various utility libraries
3

Verify Installation

Test that Dex is working by running:
node scripts/dex.mjs --help
You should see the Dex help output with available commands.
4

Configure Workspace (Optional)

If you plan to use Dex with specific repositories, run the setup wizard:
node scripts/dex.mjs setup
This will guide you through configuring workspace roots for site and API repositories.

Running Dex

There are several ways to run Dex commands:
Run Dex directly using Node.js:
node scripts/dex.mjs [command]

Configuration

Workspace Configuration

Dex stores workspace configuration in:
~/.config/dexdsl/workspaces.json
This file maintains paths to your site and API repositories. You can configure it using:
node scripts/dex.mjs setup
The workspace configuration file has the following structure:
{
  "workspaces": {
    "site": "/path/to/site-repo",
    "api": "/path/to/api-repo"
  }
}
You can manually edit this file or use environment variables to override:
  • DEX_WORKSPACE_FILE - Custom config file path
  • DEX_CONFIG_DIR - Alternative config directory

Environment Variables

Dex supports several environment variables for configuration:
DEX_WORKSPACE_FILE
string
Explicit path to workspace configuration file
DEX_CONFIG_DIR
string
Alternative config home directory (defaults to ~/.config/dexdsl)
DEX_ASSETS_ADMIN_TOKEN_TEST
string
Admin token for test environment assets API
DEX_ASSETS_ADMIN_TOKEN_PROD
string
Admin token for production environment assets API
DEX_CATALOG_ADMIN_TOKEN_TEST
string
Admin token for test environment catalog API
DEX_CATALOG_ADMIN_TOKEN_PROD
string
Admin token for production environment catalog API

Verifying Installation

Test the Dashboard

Launch the interactive TUI dashboard to verify everything is working:
node scripts/dex.mjs
You should see the Dex dashboard interface with command groups.

Run a Simple Command

Test a non-interactive command:
node scripts/dex.mjs --help

Check Workspace Configuration

Verify your workspace setup:
node scripts/dex.mjs setup

Troubleshooting

If you get a “command not found” error, ensure you’re running Dex from the correct directory or have properly linked it globally using npm link.
If you see module import errors, ensure you’ve run npm install to install all dependencies. Try removing node_modules and running npm install again:
rm -rf node_modules
npm install
If you encounter permission errors, ensure the scripts have execute permissions:
chmod +x scripts/dex.mjs
If workspace configuration fails, try resetting it:
node scripts/dex.mjs setup --reset

Next Steps

Quickstart

Create your first entry and explore core features

Workspace Concepts

Learn about workspace configuration

TUI Dashboard

Explore the interactive dashboard

Command Reference

Browse all available commands

System Requirements

Minimum Requirements

  • Node.js: 16.x or higher
  • npm: 7.x or higher
  • Operating System: macOS, Linux, or Windows with WSL
  • Terminal: TTY-compatible terminal for interactive features
  • Disk Space: ~100MB for dependencies
  • Node.js: 18.x LTS or 20.x LTS
  • Terminal: Modern terminal with Unicode support (iTerm2, Hyper, Windows Terminal)
  • Screen Resolution: Minimum 80x24 for TUI features
Some interactive TUI features require a TTY-compatible terminal. Commands can still be run in non-interactive mode in CI/CD environments.

Build docs developers (and LLMs) love