Skip to content

kunal649/adjust

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

project status language Node.js

Adjust CLI

Architecture

Manage isolated Python & Node.js runtimes. Download and execute scripts without polluting your system environment.

Usage

npm install -g adjust

# Install runtime (downloads on first use)
adjust install python
adjust install node

# Run a script
adjust run script.py
adjust run app.js

# Check status
adjust list

How It Works

  1. Runtime Download - Downloads Python 3.11 or Node 20 (platform-specific binaries) via native fetch API
  2. Smart Dependency Caching - Fingerprint-based caching prevents redundant pip install / npm install operations
  3. Isolated Execution - Spawns child processes with isolated runtimes, streams output to terminal
  4. Cross-Platform Support - Windows/Linux/macOS with automatic platform detection and bin folder recursive search
  5. Robust Error Handling - Comprehensive error recovery with cleanup on failed extractions

Architecture

  • server.js - CLI entry point (Commander.js) with install/run/list commands
  • lib/config.js - Persistent config management in ~/.adjust/config.json
  • lib/downloader.js - Stream-based runtime download & extraction with progress tracking
  • lib/runtimeHandler.js - Process spawning & execution with dependency installation
  • lib/dependencyHandler.js - Unified dependency manager (pip/npm) with cross-platform support

Key Features

  • Native Fetch API - Replaced HTTP redirect handling with built-in Node.js fetch
  • Smart Runtime Detection - Automatically determines language from file extension (.py/.js)
  • Recursive Executable Search - Finds executables in nested bin directories
  • Environment Isolation - Modifies PATH to use isolated runtimes without affecting system
  • Progress Tracking - Visual progress bar for runtime downloads
  • Dependency Verification - Checks for requirements.txt / package.json before installation

Setup & Development

npm install
npm link          # Make CLI available globally
npm run dev       # Watch mode for development

Testing

npm run watch     # Run test suite in watch mode

Recent Improvements

  • Fixed Node.js dependency handler (npm command path on Windows & Unix)
  • Replaced custom network handler with native Node.js fetch
  • Removed SHA256 logic, using fingerprint-based caching instead
  • Added recursive bin folder search for nested executables
  • Enhanced error handling with proper cleanup on extraction failures
  • Improved logging and user feedback

Supported Runtimes

Runtime Version Support
Python 3.11.7 Windows, Linux, macOS
Node.js 20.11.0 Windows, Linux, macOS

Platform Support

  • Windows - Uses .exe binaries and .zip archives
  • Linux - Uses .tar.xz archives
  • macOS - Uses .tgz archives

About

No description, website, or topics provided.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors