Install on Windows
Install the PanDev Metrics CLI plugin on Windows in about 3 minutes. After this guide your terminal activity (base command + timestamp) shows up in PanDev Metrics dashboards.
Before you begin
- Windows 10 or 11 with PowerShell (5.1 or newer, preinstalled)
- A PanDev Metrics account
- Your API token — open the PanDev Metrics web app, go to Settings → Plugins → CLI, and copy the value from the Enter your token step. Tokens start with
pandev_. The token already carries your workspace and server, so there is nothing else to configure.
Step 1 — Install the plugin
Open PowerShell as Administrator (right-click PowerShell → Run as administrator) and run:
iwr -useb https://raw.githubusercontent.com/pandev-metriks/pandev-cli/main/install.ps1 | iex
The install script must run from an elevated (Administrator) PowerShell — it registers the background daemon at the system level.
The script downloads the CLI binary, puts it on your PATH, and registers the background daemon so it starts with your session.
PowerShell may block remote scripts depending on your execution policy. Allow it for the current session and run the command again:
Set-ExecutionPolicy -Scope Process -ExecutionPolicy RemoteSigned
This affects only the current PowerShell window — it does not change your machine-wide policy.
Step 2 — Authenticate
Sign in with your API token:
pandev login -t <YOUR_TOKEN_HERE>
Replace <YOUR_TOKEN_HERE> with the token you copied from the web app. The token is stored locally so the daemon reconnects automatically after restarts.
Step 3 — Verify
Confirm that the daemon is running and authenticated:
pandev status
Check that heartbeats are accumulating:
pandev time
You can also open Settings → Plugin → CLI plugin in the PanDev Metrics UI — your machine should appear with a recent heartbeat timestamp.
Useful commands
pandev --help # List every command the plugin exposes
pandev status # Daemon health and auth state
pandev time # CLI activity captured today
pandev login -t <TOKEN> # Re-authenticate with a new token
Update
Re-run the install script from an Administrator PowerShell to pull the latest version:
iwr -useb https://raw.githubusercontent.com/pandev-metriks/pandev-cli/main/install.ps1 | iex
Uninstall
Uninstalling takes two actions and a check. The order matters: the first action is done by the pandev command itself, and after the second one the command is gone.
1. Remove the shell hooks
pandev uninstall-hooks
This strips the PanDev blocks from your PowerShell profile ($PROFILE) and from Git Bash's ~/.bashrc. Windows does not let a package run its own code while it is being removed, so this has to happen first.
2. Remove the package
In a regular PowerShell window — no administrator rights needed:
Get-AppxPackage PandevInc.PandevCLIPlugin | Remove-AppxPackage
Or through the Windows UI: open Settings → Apps → Installed apps (Apps & features on Windows 10), find PanDev CLI Plugin, and select Uninstall.
Along with the package, Windows removes the pandev command, the background daemon together with its startup entry, and the plugin's local data: the stored token, logs, and the queue of events not yet sent.
3. Check the result
In the same PowerShell window:
if (Get-AppxPackage PandevInc.PandevCLIPlugin) { 'PanDev CLI is still installed' } else { 'PanDev CLI removed' }
PanDev CLI removed means the package is gone. The pandev command no longer resolves after that — this is expected.
Full cleanup: publisher certificate and PowerShell policy
After the package is removed, two settings made during installation stay on the machine. They do not affect the system, and removing them is optional.
Publisher certificate. Windows installs packages from outside the Microsoft Store only when the machine trusts their publisher, so the installer added the PanDev certificate to the local machine's Trusted People store. To remove it, open PowerShell as Administrator and run:
Get-ChildItem Cert:\LocalMachine\TrustedPeople | Where-Object Subject -like 'CN=PanDev*' | Remove-Item
Script execution policy. So that the hook in your PowerShell profile can load, the first pandev login set the RemoteSigned policy for your user. To go back to the default:
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Undefined
Skip this step if you set RemoteSigned yourself or other tools rely on it.
Troubleshooting
iwr ... | iex fails with a script execution error
Your PowerShell execution policy is blocking remote scripts. Allow them for the current session and re-run the install command:
Set-ExecutionPolicy -Scope Process -ExecutionPolicy RemoteSigned
pandev: command not found after installation
The installer adds the CLI to your PATH, but the current PowerShell window started before that change. Close and reopen PowerShell, then run pandev status again.
pandev status says "not authenticated"
Re-run pandev login -t <YOUR_TOKEN_HERE> with a fresh token from the web app. Make sure you copied the full token with no leading or trailing spaces.
pandev status shows the daemon as not running
Re-run the install script (Step 1) to re-register the daemon, then check pandev status again.
Self-signed certificate on on-prem server
The plugin honours the Windows certificate store. Import your organisation's root CA into Trusted Root Certification Authorities (run certmgr.msc → Trusted Root Certification Authorities → Certificates → Import).
No data in the dashboard after 30 minutes
Confirm three things:
pandev statusreports authenticated and runningpandev timeshows a non-zero value- The token belongs to the same account you are viewing in the PanDev Metrics UI
After uninstalling, Git Bash prints command_queue.jsonl: No such file or directory after every command
The package was removed without running pandev uninstall-hooks first: the hook is still in ~/.bashrc and tries to write into the plugin's folder, which no longer exists. Open the file in Git Bash:
nano ~/.bashrc
In nano, delete the whole hook block:
- Ctrl+W, type
HOOK START, Enter — the cursor jumps to the first line of the block:# --- PANDEV GIT BASH HOOK START ---. - Home, then Alt+A — starts the selection;
Mark Setappears at the bottom. - Hold ↓ to extend the selection until it fully covers the line
# --- PANDEV GIT BASH HOOK END ---. - Ctrl+K — delete the selection.
- Ctrl+O, then Enter — save the file.
- Ctrl+X — exit nano.
Selecting with the mouse does not work: nano does not see that selection, and Ctrl+K would delete a single line instead of the block. Then open a new Git Bash window — the message is gone.
The matching block in your PowerShell profile (from # --- PANDEV POWERSHELL HOOK START --- through # --- PANDEV POWERSHELL HOOK END ---) does nothing once the package is gone and produces no errors. You can remove it the same way: notepad $PROFILE.
FAQ
Where do I get the token?
Open the PanDev Metrics web app, go to Settings → Plugins, click CLI, and copy the value from the Enter your token step. The same step has Rotate token and Revoke token.
The token is issued for the workspace you are currently signed into, and one token is active per workspace — the same one works for the IDE plugins and the browser extensions.
Which terminals are supported?
The plugin hooks into the shell, so PowerShell and Windows Terminal both produce heartbeats. Commands run inside WSL are captured by the Linux build instead.
Do I need administrator rights?
Yes. Run the install script from a PowerShell window opened as Administrator — it registers the background daemon at the system level. After installation, day-to-day commands (pandev status, pandev time, pandev login) run in a normal, non-elevated window.
How do I switch accounts or servers?
Run pandev login -t <NEW_TOKEN> with a token from the target account. The new token replaces the old one.
Related
- CLI plugin overview — what's captured, privacy model
- Install on macOS
- Install on Linux
- Browser extensions overview