# CLI

Pode has some commands that you can utilise from the CLI - when your in a PowerShell terminal, or `pwsh` session. These commands help you to intialise, start, test, build, or install any packages for your repo/server.

All of these commands are centered around the `package.json` format - similar to that of Node.js and Yarn.

> At the moment, Pode only uses the `start`, `test`, `build` and `install` properties of the `scripts` section in your `package.json`. You can still have others, like `dependencies` for Yarn

## Commands

### Build

The `build` command will run the script found in the `package.json` file, at the `scripts/build` value:

```
pode builid
```

### Init

The `init` command will help you create a new `package.json` file from scratch. It will ask a few questions, such as author/name/etc, and then create the file for you:

```
pode init
```

> By default, Pode will pre-populate the `test`, `build` and `install` values using `yarn`, `psake` and `pester` respectively

### Install

The `install` command will run the script found in the `package.json` file, at the `scripts/install` value:

```
pode install
```

### Start

The `start` command will run the script found in the `package.json` file, at the `scripts/start` value. If this value is not set, then this command will instead run the value under `main`:

```
pode start
```

### Test

The `test` command will run the script found in the `package.json` file, at the `scripts/test` value:

```
pode test
```

## Package File

The following is an example of a `package.json` file:

```javascript
{
    "name":  "example",
    "description":  "",
    "version":  "1.0.0",
    "main":  "./server.ps1",
    "scripts":  {
        "start":  "./server.ps1",
        "test":  "invoke-pester ./tests/*.ps1",
        "install":  "yarn install --force --ignore-scripts --modules-folder pode_modules",
        "build": "psake"
    },
    "author":  "Rick Sanchez",
    "license":  "MIT"
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://pode.gitbook.io/docs/getting-started/cli.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
