VOOZH about

URL: https://deepwiki.com/hypervel/prompts/2.1-installation-and-dependencies

⇱ Installation and Dependencies | hypervel/prompts | DeepWiki


Loading...
Last indexed: 7 February 2026 (2e2181)
Menu

Installation and Dependencies

This document covers the installation process for the hypervel/prompts library, including required PHP version, runtime dependencies, and development dependencies. It provides step-by-step instructions for adding the library to your project and explains the purpose of each dependency.

For information about creating your first prompt after installation, see Quick Start - Your First Prompt. For details about the library architecture and component overview, see Overview.


Requirements Overview

The hypervel/prompts library requires a modern PHP environment with specific extensions and third-party packages. The following table summarizes all requirements:

RequirementVersion ConstraintTypePurpose
PHP^8.2RuntimeCore language runtime
ext-mbstring*RuntimeMultibyte string handling for Unicode support
composer-runtime-api^2.2RuntimeComposer plugin API compatibility
symfony/console^6.2|^7.0RuntimeCLI infrastructure and terminal I/O
nunomaduro/termwind^2.0RuntimeHTML-like terminal styling and output rendering
hyperf/collection~3.1.0DevelopmentCollection utilities for testing
mockery/mockery^1.5DevelopmentMock object framework for unit tests

Sources: composer.json21-30


Installation via Composer

Standard Installation

Install the library using Composer's require command:


This command adds hypervel/prompts to your project's composer.json and installs all runtime dependencies automatically.

Development Installation

If you are contributing to the library or need to run tests, install with development dependencies:


Alternatively, clone the repository and install dependencies:


Sources: composer.json1-39


Autoloading Configuration

The library uses PSR-4 autoloading with an additional helper file that is automatically loaded when the package is included:


Autoload Configuration Details

  • PSR-4 Namespace: Hypervel\Prompts\ maps to the src/ directory
  • Helper File: src/helpers.php is automatically included, providing global helper functions

Sources: composer.json13-19


Runtime Dependencies

PHP 8.2+

The library requires PHP version 8.2 or higher to leverage modern language features including:

  • Typed properties and parameters
  • Constructor property promotion
  • Match expressions
  • Enumerations
  • Readonly properties

Sources: composer.json22

ext-mbstring (Required Extension)

The mbstring PHP extension is mandatory for proper multibyte string handling. This extension enables the library to:

  • Calculate string widths correctly for Unicode characters
  • Handle text truncation for CJK (Chinese, Japanese, Korean) characters
  • Support international character sets in terminal output

Without mbstring, the library cannot accurately measure or manipulate strings containing multibyte characters, which would cause display alignment issues.

Sources: composer.json23

Symfony Console (^6.2|^7.0)

Symfony Console provides the CLI infrastructure layer that hypervel/prompts builds upon:


Key Features Used:

  • Terminal dimension detection (Terminal::getWidth(), Terminal::getHeight())
  • Input stream handling for keyboard events
  • Output formatting and stream control
  • ANSI escape sequence support

The flexible version constraint (^6.2|^7.0) ensures compatibility with both Symfony 6.x and 7.x major versions.

Sources: composer.json25

nunomaduro/termwind (^2.0)

Termwind enables HTML-like syntax for terminal output styling. The library uses Termwind through the rendering system to produce beautifully formatted CLI output:


Usage in Library:

  • Color and style application (bold, dim, italic, underline)
  • Layout formatting with HTML-like elements
  • Consistent visual presentation across prompts

Sources: composer.json26

composer-runtime-api (^2.2)

This meta-package ensures the project environment uses Composer 2.2 or higher, which provides:

  • Improved performance and dependency resolution
  • Plugin API v2 compatibility
  • Modern Composer features required by the library's build system

Sources: composer.json24


Development Dependencies

Development dependencies are only required when contributing to the library or running its test suite.

hyperf/collection (~3.1.0)

The Hyperf Collection package provides Laravel-like collection utilities used in test fixtures and examples:

  • Array manipulation helpers
  • Fluent collection interfaces
  • Data transformation utilities

This dependency is scoped to development and does not affect production installations.

Sources: composer.json29

mockery/mockery (^1.5)

Mockery is a mock object framework used for unit testing:

  • Mock creation for dependencies
  • Expectation assertions
  • Test isolation

Used to test prompt components without requiring actual terminal interaction.

Sources: composer.json30


Dependency Architecture

The following diagram shows how dependencies relate to library components:


Sources: composer.json21-30


Package Metadata

The library is published under the following configuration:

PropertyValue
Package Namehypervel/prompts
Typelibrary
LicenseMIT
Minimum Stabilitydev
Prefer Stabletrue
Branch Alias0.3-dev (dev-main)

Keywords: php, hyperf, prompts, swoole, hypervel

The minimum-stability: dev with prefer-stable: true configuration allows development versions while preferring stable releases when available.

Sources: composer.json1-38


Verifying Installation

After installation, verify the library is correctly installed by checking for the helper functions:


This command displays package information including installed version and dependencies.

To verify autoloading is working, create a test PHP file:


The helper functions should be immediately available without explicit imports due to the files autoload configuration in composer.json17-19

Sources: composer.json13-19


Next Steps

With the library installed, you can now create your first prompt. See Quick Start - Your First Prompt for a tutorial on using the helper functions.

For comprehensive information about all available helper functions, see Helper Functions - The Public API.

To understand how the library renders output and integrates with Termwind, see Theming and Rendering System.