run

Function run 

Source
pub async fn run() -> Result<()>
Expand description

Executes the SubX CLI application with parsed arguments.

This is the main entry point for CLI execution, routing parsed command-line arguments to their respective command handlers.

§Arguments Processing

The function takes ownership of parsed CLI arguments and dispatches them to the appropriate command implementation based on the selected subcommand.

§Error Handling

Returns a crate::Result<()> that wraps any errors encountered during command execution. Errors are propagated up to the main function for proper exit code handling.

§Examples

use subx_cli::cli::run;

// This would typically be called from main()
// run().await?;

§Async Context

This function is async because several subcommands perform I/O operations that benefit from async execution, particularly:

  • AI service API calls
  • Large file processing operations
  • Network-based configuration loading