# Class BSV::Wallet::CLI::Commands::Consolidate <a id="class-BSV-Wallet-CLI-Commands-Consolidate"></a>

**Inherits:** `BSV::Wallet::CLI::Commands::Base`

+bin/wallet consolidate [--target-inputs=N]+ — merge the N smallest spendable
outputs into one larger output.

Reduces wallet UTXO count without changing total balance. Useful before
high-throughput operations (e.g. before a fragmentation run, or to clean up
after one). Stays in the wallet's spendable pool — different from `sweep`,
which exits funds to a recipient key.

Engine picks `N` smallest + 1 largest (dedupe-aware) as inputs, produces 1
change output. Minimum `N` is 2 (need at least two outputs to consolidate);
default 20.

Returns `nil` from engine when the pool has fewer than `N` spendable outputs —
reported here as "pool too small" without an error, since wanting to
consolidate an under-sized pool isn't a failure, just a no-op.

## Constants
### `DEFAULT_TARGET_INPUTS` <a id="constant-DEFAULT_TARGET_INPUTS"></a> <a id="DEFAULT_TARGET_INPUTS-constant"></a>
Not documented.

### `MIN_TARGET_INPUTS` <a id="constant-MIN_TARGET_INPUTS"></a> <a id="MIN_TARGET_INPUTS-constant"></a>
Not documented.

## Public Instance Methods
### `build_parser()` <a id="method-i-build_parser"></a> <a id="build_parser-instance_method"></a>
Not documented.

### `call(args)` <a id="method-i-call"></a> <a id="call-instance_method"></a>
- **@raise** [UsageError]

### `name()` <a id="method-i-name"></a> <a id="name-instance_method"></a>
Not documented.
