Skip to content

feat(init): add Claude Code installation and version checks #1

@divideby0

Description

@divideby0

Description

The ftk init command should verify that Claude Code is installed and up-to-date before proceeding with MCP server configuration.

Requirements

Installation Check

  • Check if Claude Code is installed (claude --version)
  • If not installed, prompt user: "Claude Code is not installed. Would you like to install it now?"
  • If yes, run npm i -g @anthropic-ai/claude-code
  • Verify successful installation

Version Check

  • If installed, check current version against latest available version
  • If outdated, prompt user: "Claude Code v{current} is installed. A newer version v{latest} is available. Would you like to upgrade?"
  • If yes, run npm i -g @anthropic-ai/claude-code@latest
  • Verify successful upgrade

Implementation Notes

  • Should happen early in ftk init flow, before MCP server selection
  • Use Deno.Command to check version: claude --version
  • Fetch latest version from npm registry: https://registry.npmjs.org/@anthropic-ai/claude-code/latest
  • Handle cases where npm is not installed
  • Provide clear error messages if installation/upgrade fails
  • Consider adding --skip-claude-check flag for CI/automated environments

Acceptance Criteria

  • ftk init checks for Claude Code before proceeding
  • User is prompted to install if missing
  • User is prompted to upgrade if outdated
  • Installation/upgrade process provides clear feedback
  • Command continues gracefully if user declines
  • Error handling for network issues, npm failures, etc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions