@pronative.ai/doctor
v1.0.50
Published
Official ProNative Doctor CLI — authenticates with Doctor API and installs the assigned toolchain
Readme
pronative.ai
Official Doctor CLI for the ProNative Doctor Platform (@pronative.ai/doctor).
Authenticates with Doctor API using your Student ID, loads your assigned profile (AS / AN / FDE), and installs the toolchain on macOS and Windows. After a successful install it starts the local agent (used by Playground / verify-lab and Copilot Verify).
You never choose a group — Doctor API assigns it. You never set an API URL — the CLI targets Production by default.
Current package version: 1.0.35
Quick start (students)
One short command
Windows (normal PowerShell — Admin optional):
irm https://api.doctor.pronative.ai/win | iexNo Administrator required for bootstrap. Node installs with winget --scope user when possible; Doctor runs via npx. Tool installs prefer non-admin paths; .NET / GitHub CLI use smart winget scope + script fallbacks. Some tools (e.g. Docker) may still need elevation.
Windows — start the local agent only (skip Student ID / tool install; use after Doctor has been installed once):
$env:PRONATIVE_MODE='agent'; irm https://api.doctor.pronative.ai/win | iexOr, if Doctor is already on PATH: pronativeai agent
macOS (Terminal):
curl -fsSL https://api.doctor.pronative.ai/mac | bashmacOS — agent only:
PRONATIVE_MODE=agent curl -fsSL https://api.doctor.pronative.ai/mac | bashThat command checks the machine automatically (installs or upgrades Node to v24+ if needed), then starts Doctor.
When prompted, enter your Student / Trainer ID only (PT-… for Event, ST-… for Training student, TR-… for Trainer).
npx "@pronative.ai/[email protected]"In PowerShell, keep the quotes: npx "@pronative.ai/[email protected]"
Student flow
Welcome to pronative.ai Environment Doctor
Enter Student ID:
✔ Authentication Successful
Loading profile...
Registering device...
Starting installation...
Completed.
Starting local agent… (http://127.0.0.1:4747)Use --no-agent if you want to skip starting the agent after install.
Commands
| Command | Description |
|---------|-------------|
| pronativeai / pronativeai doctor | Authenticate and install tools, then start the local agent |
| pronativeai verify | Check required tools for your profile (present / missing / outdated) |
| pronativeai doctor health | Check Doctor API health |
| pronativeai agent [--port=4747] | Start the local agent only (Admin optional on Windows) |
| pronativeai execute --command="..." | Run a one-shot command in ~/ProNative (or PRONATIVE_WORKSPACE) |
| pronativeai help | Show help |
| pronativeai version | Show CLI version |
pronativeai help
pronativeai verify
pronativeai doctor health
pronativeai agent
pronativeai execute --command="gh auth status" --workdir=.Useful flags
| Flag | Description |
|------|-------------|
| --no-agent | Skip starting the local agent after a successful doctor install |
| --port=4747 | Agent listen port (default 4747) |
| --command="..." | Command/script for execute (multiline supported) |
| --workdir=. | Relative workdir under the ProNative workspace |
| --json | JSON output for execute |
| --allow-non-admin | Deprecated no-op (agent runs without Admin by default) |
| --api-url=... | Maintainer override for Doctor API base URL |
Environment overrides (maintainers):
| Variable | Description |
|----------|-------------|
| PRONATIVE_API_BASE_URL / DOCTOR_API_BASE_URL | Doctor API base URL |
| PRONATIVE_ENV | Production (default), Local, or Development |
| PRONATIVE_STUDENT_TOKEN | Student JWT for agent activity / heartbeat reporting |
| PRONATIVE_WORKSPACE | Override workspace root (default ~/ProNative) |
Local agent
The agent is a small HTTP + WebSocket server on 127.0.0.1:4747 (loopback only). Ops UI Playground and Copilot Verify use it to run commands on the student machine.
# Windows: open PowerShell (Admin), then:
pronativeai agent
# macOS / Linux:
pronativeai agent| Endpoint | Description |
|----------|-------------|
| GET /health | Agent health (ok, version, agentToken) |
| POST /v1/execute | Run a command/script (JSON body: command, workdir, timeoutMs) |
| WS /v1/liveness | Persistent presence for Copilot (welcome JSON + 30s ping; no token on connect; closes when agent stops) |
| WS /v1/session | Live session with streamed stdout/stderr + stdin |
Notes:
- Windows: agent runs without Admin for most tools.
.NET SDK/GitHub CLIno longer force winget--scope user(that failed on machine-only packages); Doctor tries default/portable winget first, then a user-localdotnet-install.ps1fallback for .NET. Elevate only if a tool still needs machine install (e.g. Docker). If PowerShell scripts are blocked, useSet-ExecutionPolicy -Scope Process Bypassfor that session. - Multiline scripts are supported. On Windows they run via PowerShell
-EncodedCommand. - Optional
Authorization: Bearer <studentJwt>on execute/session (orPRONATIVE_STUDENT_TOKEN) reports activity and heartbeats to Doctor API so ops can see Agent Online on student lists. Reporting never blocks or fails local execute. WS /v1/livenessis for browser presence only (loopback Host + Origin allow-list). On connect it pushes{ type, ok, version, agentToken, workspaceRoot, platform, isAdmin }and keeps the socket open until the agent process exits — so Copilot can flip online/offline without pollingGET /health. Command execution still uses/v1/sessionorPOST /v1/executewith the token from the welcome payload.- After doctor install, the CLI starts the agent automatically unless
--no-agentis set.
Security
- JWT is held in memory for the process only (never written to disk)
- DeviceId is stored under AppData / Application Support
- Group (
AS/AN/FDE) comes from the API profile — never student-selected - Activity/heartbeat posts use the student JWT when present; failures are logged only and do not affect installs or local execute
Architecture
IDoctorApiService→HttpDoctorApiService- Profile strategy factory from API
groupCode(AS/AN/FDE) - Local agent:
src/agent/LocalAgentServer.ts+ActivityReporter - Existing brew / winget / vscode installers under
src/installer/
More docs: docs/IntegrationGuide.md, docs/CLI-API-Contract.md
Development
npm install
npm run build
npm test
npm startLicense
MIT
