Skip to content

feat: implement CLI command structure, testing framework, and Stellar… - #774

Open
A-one-tech wants to merge 1 commit into
MDTechLabs:mainfrom
A-one-tech:feat/cli-bridgewise-command
Open

feat: implement CLI command structure, testing framework, and Stellar…#774
A-one-tech wants to merge 1 commit into
MDTechLabs:mainfrom
A-one-tech:feat/cli-bridgewise-command

Conversation

@A-one-tech

Copy link
Copy Markdown

#Closes
#727

Implementation Plan - BridgeWise CLI Commands Module (apps/cli/src/commands/)

Implement a multi-command CLI tool for BridgeWise in apps/cli/src/commands/ that supports checking bridge status, route compare, liquidity monitoring, transaction history, and Stellar congestion monitoring.

Proposed Changes

CLI Application Infrastructure (apps/cli/)

[NEW] package.json

  • Define @bridgewise/cli package with dependencies, build scripts, and executable bin mapping.

[NEW] tsconfig.json

  • TypeScript configuration for Node/NestJS CLI environment.

[NEW] jest.config.js

  • Jest configuration set to node test environment for unit tests.

Command Module & Handlers (apps/cli/src/commands/)

[NEW] types.ts

  • Command interfaces (CLICommand, CommandOption, CommandResult, CLIContext, CommandExecutionOptions).

[NEW] history.command.ts

  • HistoryCommand: Retrieves and formats Stellar and EVM bridge transaction history by account, status filter, and sort order.

[NEW] liquidity.command.ts

  • LiquidityCommand: Queries cross-bridge token liquidity and checks route viability between source and destination chains.

[NEW] congestion.command.ts

  • CongestionCommand: Monitors Stellar route latency, queue depth, throughput, failure rates, and status alerts using StellarCongestionMonitor.

[NEW] compare.command.ts

  • CompareCommand: Compares bridge routes by cost, liquidity, and latency to surface recommended cross-chain paths.

[NEW] status.command.ts

  • StatusCommand: Queries bridge provider and chain status for target chain ID or route ID.

[NEW] help.command.ts

  • HelpCommand: Renders formatted usage instructions, available commands, and argument descriptions.

[NEW] command-runner.ts

  • Command dispatcher and runner for parsing command-line arguments, options, format parameters (json | text), and handling errors.

[NEW] commands.module.ts

  • NestJS module encapsulating all CLI command services and registry.

[NEW] index.ts

  • Public exports for the command system.

[NEW] main.ts

  • Executable entry point for CLI application.

Unit Tests (apps/cli/src/commands/__tests__/)

[NEW] command-runner.spec.ts

[NEW] history.command.spec.ts

[NEW] liquidity.command.spec.ts

[NEW] congestion.command.spec.ts

[NEW] compare.command.spec.ts

[NEW] status.command.spec.ts

Verification Plan

Automated Tests

  • Run npx jest --config apps/cli/jest.config.js to execute unit tests for all CLI commands.

Manual Verification

  • Test running CLI commands directly with node/ts-node, verifying --format json and standard text output formatting.

@drips-wave

drips-wave Bot commented Jul 27, 2026

Copy link
Copy Markdown

@A-one-tech Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@mijinummi

Copy link
Copy Markdown
Collaborator

Hi @A-one-tech , please kindly run npm build and push back

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants