Installation & Configuration

Installation

Install globally via npm:

Code
npm install -g deepbook-cli

Check the installed binary:

Code
deepbook --version deepbook --help

The package exposes both binaries: deepbook and its shorthand db. The npm postinstall step downloads the matching native DeepBook Terminal binary when one is available. Launch it with:

Code
deepbook ui

Configuration

The CLI stores global config in ~/.deepbook/config.json. It is created on first run and is shared by both deepbook and db aliases.

Setup Core Infrastructure

Initialize the CLI with your provider and RPC settings:

Code
deepbook config show deepbook config set-network mainnet deepbook config set-provider surflux deepbook config set-rpc-url mainnet https://fullnode.mainnet.sui.io:443

Import Accounts

Import your trading keypairs and manage aliases:

Code
deepbook account import default deepbook account details # Provide the secret key interactively or via stdin deepbook account import trader --stdin deepbook account use trader

Set Provider Variables

If you have specific API endpoints, set them globally:

Code
deepbook config set-provider-base-url mainnet <restUrl> deepbook config set-provider-stream-base-url mainnet <streamUrl> deepbook config set-read-key <your-api-key> deepbook config set-stream-key SUI_USDC

Execution Overrides

Global flags can override your config temporarily for a single command execution:

Code
deepbook --json pools deepbook --network testnet pools deepbook --rpc-url <suiRpcUrl> account balance deepbook --private-key <suiprivkey...> --address <address> manager ls

Safety Notes

  • Prefer --dry-run before any state-changing commands.
  • Never paste private keys into logs, shell history, or shared transcripts.
  • Confirm --network, --rpc-url, pool key, manager ID, and coin key before broadcasting.
  • SUI deposit paths split gas from deposit/collateral automatically where needed.