Config Commands
Configuration commands manage the Ika CLI config file (ika_sui_config.yaml), which maps Sui network environments to Ika contract addresses. They also manage corresponding Sui CLI environments (ika-mainnet, ika-testnet, ika-localnet).
ika config init
Fetch deployed contract addresses from GitHub, generate the Ika config file, and create Sui CLI environments for all networks.
This:
- Downloads current contract addresses for testnet and mainnet from the Ika GitHub repository
- Writes them to
~/.ika/ika_sui_config.yamlkeyed byika-{network}(e.g.,ika-testnet,ika-mainnet) - Creates Sui CLI environments (
ika-testnet,ika-mainnet,ika-localnet) pointing to the correct RPC URLs
| Flag | Required | Description |
|---|---|---|
--output <PATH> | No | Output path for Ika config file. Default: ~/.ika/ika_sui_config.yaml |
After initialization, switch to an Ika environment:
For localnet, add the contract addresses from a local config file (see add-env below).
Sui Environment Naming
ika config init creates Sui environments prefixed with ika- (e.g., ika-testnet, ika-mainnet). The active Sui environment alias must match the Ika config key for dWallet commands to work. Always use sui client switch --env ika-testnet (not --env testnet) when working with Ika.
ika config add-env
Add or update a network environment from a local ika_config.json file. Use this to configure localnet (or any custom network) from the config generated by ika system initialize or ika-swarm-config.
| Flag | Required | Description |
|---|---|---|
--network <NAME> | Yes | Network name (e.g., localnet, devnet). Stored as ika-{name} |
--from-file <PATH> | Yes | Path to the ika_config.json file containing contract addresses |
--rpc <URL> | No | Sui RPC URL for this environment. Default: auto-detected (http://127.0.0.1:9000 for localnet) |
--config <PATH> | No | Path to the Ika config file to update. Default: ~/.ika/ika_sui_config.yaml |
Typical localnet setup:
ika config sync
Re-fetch the latest deployed contract addresses from GitHub and update the existing Ika config file. Useful after contract upgrades.
| Flag | Required | Description |
|---|---|---|
--network <NET> | No | Networks to sync (comma-separated). Default: testnet,mainnet |
--config <PATH> | No | Path to the Ika config file to update. Default: ~/.ika/ika_sui_config.yaml |
Example: sync only testnet:
Existing entries for networks not listed in --network are preserved. Only the specified networks are re-fetched and updated.
ika config show
Display the current Ika CLI config file contents.
| Flag | Required | Description |
|---|---|---|
--config <PATH> | No | Path to config file. Default: ~/.ika/ika_sui_config.yaml |
If the config file doesn't exist, the command will suggest running ika config init first.