@bigbyte/cli
v0.8.2
Published
<div align="center">
Readme
🔄️ @bigbyte/cli - BigByte Command Line Interface
Modular CLI to run, analyze, diagnose and package TypeScript applications inside the BigByte ecosystem.
📋 Table of Contents
✨ Features
- Typed execution of TypeScript applications (
run) - Automatic pre-compilation (leverages
tsc+ project configuration) - Controlled environment injection with defaults (
NODE_ENV=development) - Watch mode with incremental reload (
--watch) - Live diagnostic doctor mode (
--doctor) Upcoming releases - Dynamic informational banner with app metadata (
--banner) - Debug mode with extended logging (
--debug) - Custom
.envfile loading (--env=<path>) - Structural code analysis and classpath model generation (
scan) - Packaging with optional minification (
package --minify) - Version flags (
--version,-v) and contextual help (help) - Integration with other BigByte libraries:
@bigbyte/utils,@bigbyte/integration,@bigbyte/classpath - Extensible architecture driven by declarative command configuration
🚀 Installation
npm install @bigbyte/cli --save-devExecutable available as bbyte binary.
🖥️ Commands
Below is the set of commands and flags discovered from the internal configuration (src/integration/configuration.ts).
run
Executes the main application by compiling and launching the provided entrypoint.
Flags:
--doctorEnables diagnostic mode (env:DOCTOR_MODE) Upcoming releases.--watchEnables change detection (env:WATCH_MODE).--debugEnables debug mode (env:DEBUG_MODE).--env=<file>Sets an alternative environment file.--bannerEnables (default) banner output (env:BANNER).
package
Generates a distributable package of the application.
Flags:
--minifyEnables output minification.
scan
Analyzes TypeScript structure and generates a structural model (classes, interfaces, enums, types, functions). No additional flags.
help
Shows contextual help. Supports granular queries: help, help run, help run --watch, help --doctor.
--version / -v
Prints the current CLI version.
🔧 Basic Usage
Run an application (main entrypoint):
bbyte run ./src/index.tsDevelopment with live reload & diagnostics:
bbyte --watch --doctor --debug run ./src/index.tsUse a specific environment file:
bbyte run --env=.env.local ./src/index.tsShow CLI version:
bbyte --version
# or
bbyte -vAnalyze project structure: Used to develop
bbyte scanPackage with minification:
bbyte package --minifyShow help for a specific flag:
bbyte help run --watch🔍 Detailed API
Command Model (run)
- Requires a main file (
mainFile). - Injects environment with default:
NODE_ENV=development. - Internal phases:
- Read
tsconfig. - TypeScript compilation (errors wrapped in
CompilationError). - Conditional activation: Watcher (
chokidar), Doctor, Banner, Debug logs. - Runtime launch.
- Compilation time metrics.
- Read
Run Command Flags
--doctor(switch) Enables diagnostic service/server. Default:falseUpcoming releases.--watch(switch) Watches for changes & recompiles. Default:false.--debug(switch) Enables extended logs. Default:false.--env=<file>(file) Specifies alternative.env. Falls back to project root if omitted.--banner(switch) Shows banner with metadata (App Name, Version, Cli Version). Default:true.
Related Environment Variables
NODE_ENVExecution environment (default:development).BANNERControls banner display (true/false).DOCTOR_MODEDoctor mode state (internal read-only after activation).WATCH_MODEWatch mode state (internal read-only after activation).DEBUG_MODEDebug mode state.
package Command
- Generates distributable artifact.
- Flag:
--minify(reduces size removing whitespace/comments).
scan Command
- Builds structural representation using
ts-morph. - Useful for tooling, metadata generation, static analysis.
help Command
- Contextual resolution of actions & flags.
- Supports combinations: action + flag.
Version Flags
--version/-vquick version query.
🔧 Advanced Examples
Silent run without banner:
# (If implementation supports disabling the banner via env var)
BANNER=false bbyte run ./src/index.tsFull development pipeline (watch + debug + doctor):
bbyte run ./src/index.ts --watch --debug --doctorGenerate optimized package:
bbyte package --minifyIntegrate with npm scripts:
"scripts": {
"start": "bbyte run ./src/index.ts --watch",
"analyze": "bbyte scan",
"build:pkg": "bbyte package --minify"
}Inspect help for a specific flag:
bbyte help run --env📄 License
This project is licensed under Apache-2.0. See the LICENSE file for details.
Built with ❤️ by Jose Eduardo Soria Garcia
Part of the BigByte ecosystem
