# Day Shift 0.1.20 Installation

This guide assumes you are reading it from an extracted Day Shift 0.1.20 archive root. It installs the `day-shift` command using system Node.js >=20.0.0 and does not require public npm publication.

## Extracted Archive

- POSIX archive for darwin and linux on x64 or arm64: `day-shift-0.1.20-macos-linux-system-node.tar.gz` (release/0.1.20/download-bundle/day-shift-0.1.20-macos-linux-system-node.tar.gz)
- Windows archive for win32 on x64 or arm64: `day-shift-0.1.20-windows-system-node.zip` (release/0.1.20/download-bundle/day-shift-0.1.20-windows-system-node.zip)
- Launchers: `bin/`
- Release notes: `release-notes.md`

## Prerequisites

- Install system Node.js >=20.0.0 before changing an existing installation.
- Run commands from the extracted archive root.
- Use a user-owned install directory.

First-run validation from the extracted archive root:

```sh
./bin/day-shift --version
./bin/day-shift about
```

## POSIX Shell

Default install directory: `$HOME/.local/day-shift`
Default PATH directory: `$HOME/.local/bin`

```sh
INSTALL_DIR="$HOME/.local/day-shift"
BIN_DIR="$HOME/.local/bin"
STAGE_DIR="$INSTALL_DIR/.install-stage"
mkdir -p "$INSTALL_DIR" "$BIN_DIR"
rm -rf "$STAGE_DIR"
mkdir -p "$STAGE_DIR"
cp -R . "$STAGE_DIR"
rm -rf "$INSTALL_DIR/current"
mv "$STAGE_DIR" "$INSTALL_DIR/current"
ln -sf "$INSTALL_DIR/current/bin/day-shift" "$BIN_DIR/day-shift"
"$BIN_DIR/day-shift" --version
"$BIN_DIR/day-shift" about
```

Direct execution before PATH setup:

```sh
./bin/day-shift --version
./bin/day-shift about
```

Add `$HOME/.local/bin` to PATH if `day-shift` is not found after installation.

macOS usually uses `zsh` by default:

```sh
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
command -v day-shift
```

If you use `bash` instead:

```sh
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
command -v day-shift
```

If the current shell still does not resolve the command, open a new terminal or run it directly from the install path:

```sh
"$HOME/.local/day-shift/current/bin/day-shift" --version
"$HOME/.local/day-shift/current/bin/day-shift" about
```

## Windows PowerShell

Default install directory: `$HOME\AppData\Local\DayShift`
Default PATH directory: `$HOME\AppData\Local\Microsoft\WindowsApps`

```powershell
$InstallDir = (Join-Path $HOME 'AppData\Local\DayShift')
$BinDir = (Join-Path $HOME 'AppData\Local\Microsoft\WindowsApps')
$StageDir = Join-Path $InstallDir '.install-stage'
$CurrentDir = Join-Path $InstallDir 'current'
New-Item -ItemType Directory -Force -Path $InstallDir, $BinDir | Out-Null
if (Test-Path $StageDir) { Remove-Item -Recurse -Force $StageDir }
New-Item -ItemType Directory -Force -Path $StageDir | Out-Null
Get-ChildItem -Force -Path . | Copy-Item -Destination $StageDir -Recurse -Force
if (Test-Path $CurrentDir) { Remove-Item -Recurse -Force $CurrentDir }
Move-Item -Path $StageDir -Destination $CurrentDir
$Shim = Join-Path $CurrentDir 'bin\day-shift.cmd'
$Target = Join-Path $BinDir 'day-shift.cmd'
Copy-Item -Force -Path $Shim -Destination $Target
& $Target --version
& $Target about
```

Direct execution before PATH setup:

```powershell
$Direct = Join-Path (Join-Path (Get-Location) 'bin') 'day-shift.cmd'
& $Direct --version
& $Direct about
```

Add `$HOME\AppData\Local\Microsoft\WindowsApps` to PATH if `day-shift` is not found after installation. On Windows, open a new terminal after changing PATH.

## Beta and VIP signed license file

- Beta and VIP recipients receive a signed offline Day Shift license file as downloaded JSON from a trusted Day Shift website/server-side path.
- Install the downloaded file with day-shift license install <license-file>.
- Confirm local verification with day-shift license status --format json.
- This recipient path does not require checkout, SSO, online activation, recovery automation, short-code redemption, or public issuer access.

## Upgrade or Reinstall

Repeat the platform install steps from a newly extracted archive. The manual install flow stages files before switching `current`; if a command fails before the switch, the previous install remains in place.

## Uninstall

Remove the install directory and the command shim or symlink from the PATH directory.

```sh
rm -rf "$HOME/.local/day-shift" "$HOME/.local/bin/day-shift"
```

```powershell
Remove-Item -Recurse -Force (Join-Path $HOME 'AppData\Local\DayShift')
Remove-Item -Force (Join-Path $HOME 'AppData\Local\Microsoft\WindowsApps\day-shift.cmd')
```

## Troubleshooting

- Node.js prerequisite: run `node --version` and install Node.js >=20.0.0 if `day-shift` does not start.
- PATH setup: if `day-shift` is not found, run it directly from `./bin` or from the install path, add the PATH directory shown above, and reload your shell profile or open a new terminal.
- Archive choice: use the darwin/linux archive for POSIX shell systems and the win32 archive for Windows PowerShell.
- Replacement failure: retry after fixing permissions or locks; the staged install directory can be removed safely before retrying.

## Support handoff

When requesting support, include the release version `0.1.20`, the platform archive filename, the output from `./bin/day-shift --version`, the output from `./bin/day-shift about`, and any install error text.
