Skip to content

feat: Refactor CLI commands to support JSON output and improve reporting#653

Merged
kpob merged 4 commits into
release/2.8.2from
feature/cli-json-output
Jun 25, 2026
Merged

feat: Refactor CLI commands to support JSON output and improve reporting#653
kpob merged 4 commits into
release/2.8.2from
feature/cli-json-output

Conversation

@kpob

@kpob kpob commented Jun 19, 2026

Copy link
Copy Markdown
Contributor
  • Introduced CmdOutput trait for consistent output formatting across commands.
  • Added OutputFormat enum to handle human-readable and JSON output.
  • Updated ConfigCmd, ContractsCmd, CallCmd, PrintEventsCmd, InspectCmd, StatusCmd, TransferCmd, and WhoamiCmd to implement CmdOutput and return structured reports.
  • Enhanced StatusCmd to report on registered and unregistered contracts.
  • Refactored event logging in CallCmd to collect events for JSON output.
  • Created TransferReport, WhoamiReport, EventsReport, and ContractsSchemaReport for structured command outputs.
  • Added JSON serialization for command outputs using serde.
  • Updated command execution methods to return structured output instead of void.

kpob added 3 commits June 19, 2026 07:35
- Introduced `CmdOutput` trait for consistent output formatting across commands.
- Added `OutputFormat` enum to handle human-readable and JSON output.
- Updated `ConfigCmd`, `ContractsCmd`, `CallCmd`, `PrintEventsCmd`, `InspectCmd`, `StatusCmd`, `TransferCmd`, and `WhoamiCmd` to implement `CmdOutput` and return structured reports.
- Enhanced `StatusCmd` to report on registered and unregistered contracts.
- Refactored event logging in `CallCmd` to collect events for JSON output.
- Created `TransferReport`, `WhoamiReport`, `EventsReport`, and `ContractsSchemaReport` for structured command outputs.
- Added JSON serialization for command outputs using `serde`.
- Updated command execution methods to return structured output instead of void.
…ract storage handling

feat(status): enhance status reporting with file existence and entry count
feat(repl): add dynamic status line to REPL prompt reflecting current session state
)

* Refactor CasperClient to use Tokio runtime for synchronous methods

- Added `reqwest-eventsource` dependency to support event streaming.
- Removed unnecessary Tokio runtime instances from `LivenetContractEnv` and `LivenetHost`.
- Updated `CasperClient` to manage a single Tokio runtime, allowing synchronous methods to block on async calls.
- Refactored transaction watching and event handling to improve performance and readability.
- Simplified event matching logic by removing the SSE parser and directly processing events.
- Adjusted various methods in `CasperClient` and `TransactionWatcher` to utilize the new runtime structure.
- Ensured all async methods are now properly awaited in their synchronous counterparts.

* fmt
@github-actions

Copy link
Copy Markdown

Benchmark report

Action Details Gas diff
Wasm Deploy Filename: Benchmark.wasm 🔴 +0.012293457 CSPR (0.00%)

Base automatically changed from feature/repl to release/2.8.2 June 25, 2026 15:51
@kpob
kpob merged commit f49d770 into release/2.8.2 Jun 25, 2026
4 checks passed
@kpob
kpob deleted the feature/cli-json-output branch June 25, 2026 23:57
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.

2 participants