# npm and Wrangler Command Reference

Run these commands in PowerShell from the `thelookingcrass-public` repository unless a full path is shown.

## Verify the tools

```powershell
node --version
npm --version
npx wrangler --version
npx wrangler whoami
```

`npx` uses the project-compatible Wrangler package without requiring a global installation. If `whoami` is not authenticated, run `npx wrangler login`.

## Install, preview, and deploy

```powershell
# Copy the maintained package into your local deployment checkout
& '.\install-site-update.ps1' -SitePath 'C:\Users\phoen\Downloads\thelookingcrass-public'

# Copy the package and publish it with Wrangler
& '.\install-site-update.ps1' -SitePath 'C:\Users\phoen\Downloads\thelookingcrass-public' -Deploy

# Preview directly from the deployment checkout
Set-Location 'C:\Users\phoen\Downloads\thelookingcrass-public'
npx wrangler dev

# Publish the current checkout directly
npx wrangler deploy

# Follow live Worker logs
npx wrangler tail
```

Leave off `-Deploy` to copy the files and review the changes before publishing.

## Inspect deployments and versions

```powershell
npx wrangler deployments list
npx wrangler versions list
```

## Secrets

Never place secret values in the repository or command history.

```powershell
npx wrangler secret put SECRET_NAME
npx wrangler secret list
npx wrangler secret delete SECRET_NAME
```

## npm maintenance

```powershell
npm install
npm outdated
npm audit
```

Only run `npm update` after reviewing the proposed package changes. This site currently relies on `npx wrangler`, so a local dependency install is not required merely to deploy.

## Review before deployment

```powershell
git status --short
git diff
```

The Worker configuration is in `wrangler.json`. Static files are served from the repository root, `/api/*` and `/health` run through the Worker first, and the monitoring schedule remains part of the existing Worker configuration.
