# Local dev loop

First things first make sure that you have proper node version and run `nvm use`, then proceed to installing dependencies by running `yarn install`.

## Run the app

```
yarn cli
```

## View all available CLI commands

```
yarn cli help
```

## Run a command

```
yarn cli <command>
```

Pro tip: if you want to run any commands that interacts with Compass make sure to set `compassSiteUrl` and `compassUserEmail` in `compass-scaffolder.config.ts` and set `USER_API_TOKEN` environment variable
(see [docs](https://support.atlassian.com/atlassian-account/docs/manage-api-tokens-for-your-atlassian-account/) to learn how to generate one).

## Test

```
yarn test
```

## Typecheck

```
yarn typecheck
```

## Lint

```
yarn lint
```

## Test

```
yarn test
```

## Debug with VS Code

Create `.vscode/launch.json` file with content like:

```
{
	"version": "0.2.0",
	"configurations": [
		{
			"name": "Debug CLI",
			"runtimeVersion": "20.18.0", // should mach version defined in .nvmrc
			"program": "${workspaceFolder}/src/cli/index.ts",
			"request": "launch",
			"skipFiles": ["<node_internals>/**"],
			"type": "node",
			"args": ["push"], // specify CLI command you want to debug
			"env": {
				"NODE_OPTIONS": "--no-node-snapshot",
				"USER_EMAIL": "<YOUR_EMAIL>",
				"USER_API_TOKEN": "<YOUR_API_TOKEN>"
			}
		}
	]
}
```
