thru-cli network command manages named network profiles, letting you configure and switch between different RPC endpoints without editing config files manually.
Prerequisites
Command Overview
Add
Create a new named network profile
Set Default
Choose which profile to use by default
Update
Modify an existing network profile
List
Show all configured profiles
Remove
Delete a network profile
Add Network
Create a new named network profile with an RPC endpoint URL and optional authorization token.Profile name (case-insensitive). Used to reference this network in other commands.
RPC endpoint URL for this network (e.g.,
http://localhost:8899 or https://rpc.thru.dev).Optional authorization token included with RPC requests to this endpoint.
Set Default
Set which network profile the CLI uses when no--network or --url flag is provided.
Name of an existing network profile to use as the default.
The default network is stored in your config file and persists across CLI sessions. You can always override it per-command with
--network <name> or --url <url>.Update Network
Update the URL or authorization token on an existing network profile.Name of the network profile to update.
New RPC endpoint URL.
New authorization token. Pass an empty string (
"") to clear the token.List Networks
Display all configured network profiles, including which one is set as the default.Remove Network
Delete a network profile from the configuration. If the removed profile was the default, the default is cleared.Name of the network profile to remove.