npm package: @staxjs/cli
Description: Stax CLI
Author: Philip Johnston
Latest version: 0.3.1
Deprecated: this package has been deprecated

# cli

Stax CLI

[![oclif](https://img.shields.io/badge/cli-oclif-brightgreen.svg)](https://oclif.io)
[![Version](https://img.shields.io/npm/v/cli.svg)](https://npmjs.org/package/cli)
[![Downloads/week](https://img.shields.io/npm/dw/cli.svg)](https://npmjs.org/package/cli)
[![License](https://img.shields.io/npm/l/cli.svg)](https://github.com/tundera/cli/blob/master/package.json)

<!-- toc -->
* [cli](#cli)
* [Usage](#usage)
* [Commands](#commands)
<!-- tocstop -->

# Usage

<!-- usage -->
```sh-session
$ npm install -g @staxjs/cli
$ stax COMMAND
running command...
$ stax (-v|--version|version)
@staxjs/cli/0.1.0 darwin-x64 node-v14.16.0
$ stax --help [COMMAND]
USAGE
  $ stax COMMAND
...
```
<!-- usagestop -->

# Commands

<!-- commands -->
- [cli](#cli)
- [Usage](#usage)
- [Commands](#commands)
  - [`stax add WORKSPACE MODULE`](#stax-add-workspace-module)
  - [`stax altgen TYPE MODEL`](#stax-altgen-type-model)
  - [`stax build [WORKSPACE]`](#stax-build-workspace)
  - [`stax completion`](#stax-completion)
  - [`stax completion:generate`](#stax-completiongenerate)
  - [`stax completion:generate:alias ALIAS`](#stax-completiongeneratealias-alias)
  - [`stax dev WORKSPACE`](#stax-dev-workspace)
  - [`stax generate RESOURCE [NAME]`](#stax-generate-resource-name)
  - [`stax hello [FILE]`](#stax-hello-file)
  - [`stax help [COMMAND]`](#stax-help-command)
  - [`stax install RECIPE [RECIPE-FLAGS]`](#stax-install-recipe-recipe-flags)
  - [`stax jest`](#stax-jest)
  - [`stax list [TYPE]`](#stax-list-type)
  - [`stax remove WORKSPACE MODULE`](#stax-remove-workspace-module)
  - [`stax run NAME`](#stax-run-name)
  - [`stax start WORKSPACES`](#stax-start-workspaces)
  - [`stax update [CHANNEL]`](#stax-update-channel)

## `stax add WORKSPACE MODULE`

Add dependency to project

```
USAGE
  $ stax add WORKSPACE MODULE

ARGUMENTS
  WORKSPACE  target workspace to install module
  MODULE     module name

OPTIONS
  -D, --dev    Install module as dev dependency
  -E, --exact  Install module with exact version
  -P, --peer   Install module as peer dependency
  -h, --help   show CLI help

ALIASES
  $ stax a
```

_See code: [src/commands/add.ts](https://github.com/tundera/stax/blob/v0.1.0/src/commands/add.ts)_

## `stax altgen TYPE MODEL`

Generate new files for your Stax project

```
USAGE
  $ stax altgen TYPE MODEL

ARGUMENTS
  TYPE   (all|crud|model|component|pages|queries|query|mutations|mutation|resource) What files to generate
  MODEL  The name of your model, like "user". Can be singular or plural - same result

OPTIONS
  -c, --context=context  Provide a context folder within which we'll place the generated files for better code
                         organization. You can also supply this in the name of the model to be generated (e.g. `stax
                         generate query admin/projects`). Combining the `--context` flags and supplying context via the
                         model name in the same command is not supported.

  -d, --dry-run          Show what files will be created without writing them to disk

  -h, --help             show CLI help

  -p, --parent=parent    Specify a parent model to be used for generating nested routes for dependent data when
                         generating pages, or to create hierarchical validation in queries and mutations. The code will
                         be generated with the nested data model in mind. Most often this should be used in conjunction
                         with 'stax generate all'

ALIASES
  $ stax g

EXAMPLES
  # The 'crud' type will generate all queries & mutations for a model
  > stax generate crud productVariant
    
  # The 'all' generator will scaffold out everything possible for a model
  > stax generate all products
    
  # The '--context' flag will allow you to generate files in a nested folder
  > stax generate pages projects --admin
    
  # Context can also be supplied in the model name directly
  > stax generate pages admin/projects
    
  # To generate nested routes for dependent models (e.g. Projects that contain
  # Tasks), specify a parent model. For example, this command generates pages under
  # app/tasks/pages/projects/[projectId]/tasks/
  > stax generate all tasks --parent=projects
    
  # Database models can also be generated directly from the CLI
  # Model fields can be specified with any generator that generates
  # a database model ("all", "model", "resource"). Both of the below
  # will generate the proper database model for a Task.
  > stax generate model task \
       name:string \
       completed:boolean:default=false \
       belongsTo:project?
  > stax generate all tasks \
       name:string \
       completed:boolean:default=false \
       belongsTo:project?
    
  # Sometimes you want just a single query with no generated
  # logic. Generating "query" instead of "queries" will give you a more
  # customizable template.
  > stax generate query getUserSession
```

_See code: [src/commands/altgen.ts](https://github.com/tundera/stax/blob/v0.1.0/src/commands/altgen.ts)_

## `stax build [WORKSPACE]`

Creates a production build

```
USAGE
  $ stax build [WORKSPACE]

ARGUMENTS
  WORKSPACE  (db|app|scripts|cli|codemod|components|config|display|functions|generator|installer|theme|transforms|graphq
             l) target workspace to build

OPTIONS
  -h, --help  show CLI help

ALIASES
  $ stax b
```

_See code: [src/commands/build.ts](https://github.com/tundera/stax/blob/v0.1.0/src/commands/build.ts)_

## `stax completion`

Generate shell completion script

```
USAGE
  $ stax completion

OPTIONS
  -s, --shell=bash|fish|zsh  (required) Name of shell

DESCRIPTION
  Run this command to see instructions for your shell.

EXAMPLE
  $ stax completion --shell zsh
```

_See code: [oclif-plugin-completion](https://github.com/MunifTanjim/oclif-plugin-completion/blob/0.6.0/src/commands/completion/index.ts)_

## `stax completion:generate`

Generates completion script

```
USAGE
  $ stax completion:generate

OPTIONS
  -s, --shell=bash|fish|zsh  (required) Name of shell

DESCRIPTION
  Run the "completion" command to see instructions about how to use the script generated by this command.

EXAMPLE
  $ stax completion:generate --shell zsh
```

_See code: [oclif-plugin-completion](https://github.com/MunifTanjim/oclif-plugin-completion/blob/0.6.0/src/commands/completion/generate/index.ts)_

## `stax completion:generate:alias ALIAS`

Generates completion script for alias

```
USAGE
  $ stax completion:generate:alias ALIAS

ARGUMENTS
  ALIAS  name of the alias

OPTIONS
  -s, --shell=bash|fish  (required) Name of shell

DESCRIPTION
  This needs the completion script for the main command to be present.

  Check the "completion:generate" command.
```

_See code: [oclif-plugin-completion](https://github.com/MunifTanjim/oclif-plugin-completion/blob/0.6.0/src/commands/completion/generate/alias.ts)_

## `stax dev WORKSPACE`

Start the production server

```
USAGE
  $ stax dev WORKSPACE

ARGUMENTS
  WORKSPACE  (db|app|scripts|cli|codemod|components|config|display|functions|generator|installer|theme|transforms|graphq
             l) target workspace in monorepo

OPTIONS
  -h, --help       show CLI help
  -p, --port=port  Set port number
  --inspect        Enable the Node.js inspector

ALIASES
  $ stax d
```

_See code: [src/commands/dev.ts](https://github.com/tundera/stax/blob/v0.1.0/src/commands/dev.ts)_

## `stax generate RESOURCE [NAME]`

Generate code from template

```
USAGE
  $ stax generate RESOURCE [NAME]

ARGUMENTS
  RESOURCE  (component|page|function|model) resource type to generate
  NAME      name of resource to generate

OPTIONS
  -h, --help                show CLI help
  Resource variant=variant

ALIASES
  $ stax g
```

_See code: [src/commands/generate.ts](https://github.com/tundera/stax/blob/v0.1.0/src/commands/generate.ts)_

## `stax hello [FILE]`

describe the command here

```
USAGE
  $ stax hello [FILE]

OPTIONS
  -f, --force
  -h, --help       show CLI help
  -n, --name=name  name to print

EXAMPLE
  $ stax hello
  hello world from ./src/hello.ts!
```

_See code: [src/commands/hello.ts](https://github.com/tundera/stax/blob/v0.1.0/src/commands/hello.ts)_

## `stax help [COMMAND]`

display help for stax

```
USAGE
  $ stax help [COMMAND]

ARGUMENTS
  COMMAND  command to show help for

OPTIONS
  --all  see all commands in CLI
```

_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v3.2.2/src/commands/help.ts)_

## `stax install RECIPE [RECIPE-FLAGS]`

Install a Recipe into your Stax app

```
USAGE
  $ stax install RECIPE [RECIPE-FLAGS]

ARGUMENTS
  RECIPE        Name of a Stax recipe from @staxjs/stax/recipes, or a file path to a local recipe definition
  RECIPE-FLAGS  A list of flags to pass to the recipe. Stax will only parse these in the form key=value

OPTIONS
  -h, --help  show CLI help

ALIASES
  $ stax i
```

_See code: [src/commands/install.ts](https://github.com/tundera/stax/blob/v0.1.0/src/commands/install.ts)_

## `stax jest`

Start the production server

```
USAGE
  $ stax jest

OPTIONS
  -h, --help  show CLI help
  --watch     Enable watch mode for tests

ALIASES
  $ stax j
```

_See code: [src/commands/jest.ts](https://github.com/tundera/stax/blob/v0.1.0/src/commands/jest.ts)_

## `stax list [TYPE]`

Add dependency to project

```
USAGE
  $ stax list [TYPE]

ARGUMENTS
  TYPE  type of workspaces to display

OPTIONS
  -D, --dev    Install module as dev dependency
  -E, --exact  Install module with exact version
  -P, --peer   Install module as peer dependency
  -h, --help   show CLI help

ALIASES
  $ stax a
```

_See code: [src/commands/list.ts](https://github.com/tundera/stax/blob/v0.1.0/src/commands/list.ts)_

## `stax remove WORKSPACE MODULE`

Add dependency to project

```
USAGE
  $ stax remove WORKSPACE MODULE

ARGUMENTS
  WORKSPACE  target workspace to install module
  MODULE     module name

OPTIONS
  -W, --root  Remove module from project root
  -h, --help  show CLI help

ALIASES
  $ stax a
```

_See code: [src/commands/remove.ts](https://github.com/tundera/stax/blob/v0.1.0/src/commands/remove.ts)_

## `stax run NAME`

Run script in `scripts` directory using ts-node

```
USAGE
  $ stax run NAME

ARGUMENTS
  NAME  Filename of script to run

OPTIONS
  -h, --help       show CLI help
  -p, --port=port  Set port number
  --inspect        Enable the Node.js inspector

ALIASES
  $ stax r
```

_See code: [src/commands/run.ts](https://github.com/tundera/stax/blob/v0.1.0/src/commands/run.ts)_

## `stax start WORKSPACES`

Start the production server

```
USAGE
  $ stax start WORKSPACES

ARGUMENTS
  WORKSPACES  (db|app|scripts|cli|codemod|components|config|display|functions|generator|installer|theme|transforms|graph
              ql) target workspacs to start in monorepo

OPTIONS
  -h, --help       show CLI help
  -p, --port=port  Set port number
  --inspect        Enable the Node.js inspector

ALIASES
  $ stax s
```

_See code: [src/commands/start.ts](https://github.com/tundera/stax/blob/v0.1.0/src/commands/start.ts)_

## `stax update [CHANNEL]`

update the stax CLI

```
USAGE
  $ stax update [CHANNEL]
```

_See code: [@oclif/plugin-update](https://github.com/oclif/plugin-update/blob/v1.3.10/src/commands/update.ts)_
<!-- commandsstop -->