# DXOS Shell Tools

```
______/\/\____/\/\______
________/\/\/\/\________
__________/\/\__________
________/\/\/\/\________
______/\/\____/\/\______ DXOS Engineering tools.
```

## Installation

First install the Github CLI:

```bash
brew install gh
```

To install the `dxtools` binary:

`npm install -g @dxos/x`

To install the custom plugin for [Oh My Zsh](https://github.com/ohmyzsh/ohmyzsh/wiki/Customization#overriding-and-adding-plugins),
which sets the `x` alias, run:

`dxtools install`

Then add the following to your `.zshrc` config:

```bash
plugins=(
  dxos
  ...
)
```

The install script creates the `x` alias to invoke the `dxtools` command, which may source the output into the current shell (e.g., to change directory).


## Usage

To list PRs for all local repos:

`x repo list --pr`

To change the directory to the repo that first matches `protocols`:

`x repo cd protocols`

To change the directory to the package that first matches `react`:

`x rush cd react`

To list Github jobs for the current repo:

`x workflow list`

## Development

To build:

`yarn build:watch`

To run locally:

`./bin/dxtools.js`

To override the global binary called by the `x` alias: 

```bash
eval $(./scripts/debug.sh)
```

Alternatively, change the npm link directly (and `unlink` afterwards).

```bash
npm link .
yarn && yarn build
```

Run the following command to get debug information.

```bash
x debug
```

## Publishing

```bash
yarn release
```

To upgrade (remember to unset `DXTOOLS_COMMAND`):

```bash
yarn global upgrade @dxos/x@latest
```
