Skip to content

Implement tool verification system (lib/platform/verify-tools.js) #2

@avifenesh

Description

@avifenesh

Overview

Create a tool availability checker that enables graceful degradation when optional tools are missing.

Objective

Implement lib/platform/verify-tools.js to check availability and versions of development tools.

Tools to Check

  • git
  • gh (GitHub CLI)
  • node
  • npm
  • pnpm
  • yarn
  • bun
  • python
  • pip
  • poetry
  • cargo
  • rustc
  • go
  • docker
  • railway (Railway CLI)
  • vercel (Vercel CLI)
  • netlify (Netlify CLI)

Implementation

Each check should:

  1. Try to run command --version (or appropriate version flag)
  2. Capture the version string
  3. Return { available: true, version: "x.y.z" } or { available: false, version: null }
  4. Handle errors gracefully (tool not found, not in PATH, etc.)

Output Format

{
  "git": { "available": true, "version": "2.43.0" },
  "gh": { "available": true, "version": "2.40.1" },
  "node": { "available": true, "version": "v20.10.0" },
  "railway": { "available": false, "version": null }
}

Usage in Commands

Commands can check tool availability before using features:

const tools = JSON.parse(execSync('node lib/platform/verify-tools.js').toString());

if (!tools.gh.available) {
  console.error('GitHub CLI required. Install: https://cli.github.com');
  process.exit(1);
}

if (tools.railway.available) {
  // Use Railway-specific features
} else {
  // Skip Railway deployment validation
}

Acceptance Criteria

  • Checks all listed tools
  • Returns structured JSON
  • Handles missing tools gracefully
  • Runs in <2 seconds
  • Works cross-platform

Priority

HIGH - Required for commands to gracefully degrade.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions