A comprehensive TypeScript CLI tool for Sui blockchain development, providing interactive consoles and utilities for Move package management, SuiNS domain operations, Walrus storage, and blockchain interactions.
npm install -g blue-cli
# or
git clone <repository>
cd blue
npm install
npm run build
npm linkBlue CLI uses YAML configuration files. Create a config file with the following structure:
chain:
network: "testnet" # mainnet, testnet, devnet, localnet
url: "" # optional custom RPC URL
auth:
sender: "0x..." # your wallet address
threshold: 1 # keystore threshold
keystore: "path/to/keystore"
password: "optional_password"
db: # optional database configuration
type: "postgresql" # postgresql, mysql, sqlite
host: "localhost"
port: 5432
user: "username"
password: "password"
name: "database_name"
# SSH tunnel support
sshHost: "remote.server.com"
sshUser: "user"
sshKey: "path/to/ssh/key"
log:
logLevel: "info" # silly, debug, info, warn, error
logToFile: false
outputDir: "./output"Environment variables are also supported (.env.{network}.{dbtype} files):
DB_HOST=localhost
DB_PORT=5432
DB_USER=username
DB_PASSWORD=password
DB_NAME=database_name
SSH_HOST=remote.server.com
SSH_USER=user
SSH_KEY=/path/to/ssh/keyGenerate a new keystore with specified cryptographic scheme.
blue gen-key --scheme <scheme>Options:
-s, --scheme <scheme>: Keypair scheme (required)ed25519: EdDSA signature scheme (default)secp256k1: ECDSA with secp256k1 curvesecp256r1: ECDSA with secp256r1 curve
Example:
blue gen-key --scheme ed25519Import a private key into keystore format.
blue import-key --scheme <scheme> --threshold <threshold>Options:
-s, --scheme <scheme>: Keypair scheme (required)ed25519: EdDSA signature schemesecp256k1: ECDSA with secp256k1 curvesecp256r1: ECDSA with secp256r1 curve
-t, --threshold <threshold>: Keystore threshold (default: 1)
Check and verify a private key with the specified address and threshold.
blue check-key --address <address> --threshold <threshold>Options:
-a, --address <address>: The address of the key to check (required)-t, --threshold <threshold>: The threshold of the key to check (default: 1)
Export keystore to private key format.
blue export-key [--address <address>] [--threshold <threshold>]Options:
--address <address>: Address of the key to export--threshold <threshold>: Threshold of the key to export
Encrypt keystore using Shamir's Secret Sharing (SSS).
blue encrypt-sss [--address <address>] [--threshold <threshold>]Generate a new Move package template.
blue gen-pkg --name <name> [--author <author>]Options:
-n, --name <name>: Package name (required)-a, --author <author>: Package author (default: "blue")
Publish a Move package to the blockchain.
blue publish [--config <config>] [--path <path>]Options:
--config <config>: Configuration file path--path <path>: Path to Move package directory
Upgrade an existing Move package.
blue upgrade [--config <config>] [--path <path>] [--package-id <id>] [--upgrade-cap-id <id>] [--upgrade-policy <policy>]Options:
--config <config>: Configuration file path--path <path>: Path to Move package directory--package-id <id>: ID of package to upgrade--upgrade-cap-id <id>: Upgrade capability object ID--upgrade-policy <policy>: Upgrade policy (default: "COMPATIBLE")
The following commands are available in all console modes:
help,h: Display available commandsquit,q,exit: Exit the consoleclear,c: Clear screen and show welcome messageactive: Activate keystore for transaction signing
Query blockchain objects by their IDs.
obj 0x123abc... 0x456def...List objects owned by an address, optionally filtered by type.
owned-obj # your objects
owned-obj 0x123abc... # specific address objects
owned-obj 0x123abc... "0x2::coin::Coin<0x2::sui::SUI>" # filtered by typeQuery transaction details by digest.
tx 0x789ghi...Check coin balance for an address.
balance # your SUI balance
balance 0x123abc... # specific address SUI balance
balance SUI # your SUI balance (alternative)
balance 0x123abc... "0x2::sui::SUI" # specific address and coin typeList all coins owned by an address.
coins # your coins
coins 0x123abc... # specific address coinsInitialize a new transaction builder.
initDisplay current transaction commands.
commandsRemove a command from the transaction builder.
remove 1 # remove first commandAdd SUI transfer to transaction.
transfer 0x123abc... 1000000000 # transfer 1 SUI (in MIST)Add object transfer to transaction.
transfer-obj 0x123abc... 0x456def... 0x789ghi...Add coin merge operation to transaction.
merge 0x123abc... 0x456def... 0x789ghi...Merge all coins of a specific type into one coin.
merge-all 0x2::sui::SUI
merge-all "0x123abc...::my_coin::COIN"Add coin split operation to transaction.
split 0x123abc... 100000000 200000000 300000000Get package ID by name from database.
address my_packageDisplay function arguments with auto-resolution.
function-args my_package counter increment
function-args 0x123abc... counter incrementAdd Move function call to transaction.
movec my_package counter increment
movec 0x123abc... counter increment 42 "hello"Execute Move function in view mode (read-only).
movew my_package counter get_value
movew 0x123abc... counter get_value 0x456def...Build, sign, and optionally execute the current transaction.
writeSign a transaction from file.
sign
# prompts for file pathSend a signed transaction from file.
send
# prompts for file pathPublish a Move package from the specified path.
publish ./my_packageExecute system commands.
exec ls -la
exec sui client active-addressStart the SuiNS console for domain name operations:
blue ns-console [--config <config>] [--active]In addition to all base console commands, NS Console provides:
Query name record information.
record example.sui
record example # automatically adds .suiDisplay current registration prices.
priceDisplay renewal prices.
renewal-priceShow coin type discounts.
discountsGet price information for specific coin type.
price-info SUI
price-info USDCRegister a new domain name.
register example.sui 1 sui # 1 year, pay with SUI
register example 2 usdc # 2 years, pay with USDC
register example # 1 year, pay with SUI (defaults)Arguments:
name: Domain name (automatically adds .sui if not present)years: Registration period 1-5 years (default: 1)payType: Payment method -sui,mist, orusdc(default: sui)
Renew an existing domain.
renew 0x123abc... 1 sui
renew 123abc 2 usdc # 0x prefix optionalArguments:
nftId: Domain NFT object IDyears: Renewal period 1-5 yearspayType: Payment method -sui,mist, orusdc(default: sui)
Set target address for a domain.
set-target 0x123abc... 0x456def...
set-target 123abc 456def # 0x prefix optionalSet default domain for your address.
set-default example.sui
set-default example # automatically adds .suiCreate a new subdomain.
create-subname 0x123abc... sub 1735689600000 true trueArguments:
parentNftId: Parent domain NFT IDsubname: Subdomain nameexpirationMs: Expiration timestamp in millisecondsallowChild: Allow child creation (default: true)allowExtension: Allow time extension (default: true)
Edit subdomain settings.
edit-subname sub.example.sui 0x123abc... true falseExtend subdomain expiration.
extend-subname 0x123abc... 1735689600000Create a leaf subdomain (no NFT, direct mapping).
create-leaf 0x123abc... leaf 0x456def...Remove a leaf subdomain.
remove-leaf 0x123abc... leafSet metadata for a domain.
set-data 0x123abc... avatar "https://example.com/avatar.png" false
set-data 0x123abc... description "My domain" trueArguments:
nftId: Domain NFT object IDkey: Metadata keyvalue: Metadata valueisSubname: Whether this is a subdomain (default: false)
Burn an expired domain to reclaim storage.
burn-expired 0x123abc... false
burn-expired 0x123abc... true # for subdomainStart the Walrus console for decentralized storage operations:
blue walrus-console [--config <config>] [--active]In addition to all base console commands, Walrus Console provides:
Calculate storage cost for a file.
cost ./document.pdf 10
cost /path/to/image.jpg 5Arguments:
filePath: Path to the file to calculate cost forepochs: Number of epochs to store (storage duration)
Output:
- File size and cost breakdown
- Storage cost in MIST and WAL
- Write cost in MIST and WAL
- Total cost calculation
Upload a file to Walrus storage.
upload ./document.pdf 10
upload /path/to/image.jpg 5Arguments:
filePath: Path to the file to uploadepochs: Number of epochs to store
Interactive Prompts:
- Confirms storage cost and asks for approval
- Asks whether to make the blob deletable
- Requires active keystore for signing
Output:
- Blob ID for accessing the stored file
- Object ID on Sui blockchain
- Access URL for retrieving the file
- Storage metadata (epochs, encoding, etc.)
Start the DeepBook console for DEX operations:
blue db-console [--config <config>] [--active]In addition to all base console commands, DB Console provides:
Create a new trading pool on DeepBook.
create-pool SUI USDC 1000000 1000000 1000000Arguments:
baseCoinKey: Base coin identifier (e.g., "SUI")quoteCoinKey: Quote coin identifier (e.g., "USDC")tickSize: Minimum price incrementlotSize: Minimum quantity incrementminSize: Minimum order size
Blue CLI supports multiple database backends for storing package and module information:
- PostgreSQL: Full-featured with SSH tunnel support
- MySQL: Complete functionality with connection pooling
- SQLite: Lightweight, file-based option
The database automatically creates tables for:
- packages: Published Move packages
- modules: Module definitions and ABIs
- function_call: Function call metadata
- function_object_arg: Function parameter information
- indexer_objects: Object indexing for parameter resolution
For remote database connections, Blue CLI supports SSH tunneling:
db:
type: "postgresql"
host: "localhost"
port: 5432
sshHost: "remote.server.com"
sshUser: "username"
sshKey: "/path/to/ssh/private/key"# Generate a new keystore
blue gen-key --scheme ed25519
# Import existing private key (alternative)
blue import-key --scheme ed25519 --threshold 1
# Check keystore integrity
blue check-key --address 0x123abc... --threshold 1
# Generate a new package
blue gen-pkg --name my_counter --author developer
# Start console and publish
blue console --config config.yaml --active
> publish ./my_counter
> movec my_counter counter increment
> write# Start NS console
blue ns-console --config config.yaml --active
# Check prices and register domain
> price
> register mydomain.sui 2 sui
> set-target <nft-id> 0x123abc...
> create-subname <nft-id> api 1735689600000# Start Walrus console
blue walrus-console --config config.yaml --active
# Upload file to decentralized storage
> cost ./document.pdf 10
> upload ./document.pdf 10blue console --config config.yaml
# Build complex transaction
> init
> transfer 0x123abc... 1000000000
> movec package_name module_name function_name arg1 arg2
> split 0x456def... 500000000 300000000
> commands
> write# Install dependencies
npm install
# Build the project
npm run build
# Link for development
npm link
# Run tests
npm testThis project is licensed under the MIT License - see the LICENSE file for details.
We welcome contributions! Please see our Contributing Guide for details on:
- 🐛 Reporting bugs
- 💡 Suggesting enhancements
- 🔧 Submitting pull requests
- 📝 Improving documentation
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes and add tests
- Run tests:
npm test - Commit using conventional commits:
git commit -m "feat: add amazing feature" - Push to your fork:
git push origin feature/amazing-feature - Open a Pull Request
If you discover a security vulnerability, please follow our Security Policy for responsible disclosure.
Blue CLI는 Sui 블록체인 개발을 위한 종합 TypeScript CLI 도구로, Move 패키지 관리, SuiNS 도메인, Walrus 스토리지, 블록체인 상호작용을 위한 다양한 콘솔과 유틸리티를 제공합니다.
npm install -g blue-cli
# 또는
git clone <repository>
cd blue
npm install
npm run build
npm linkBlue CLI는 YAML 설정 파일을 사용합니다. 다음과 같은 구조로 config 파일을 만드세요:
chain:
network: "testnet" # mainnet, testnet, devnet, localnet
url: "" # (선택) 커스텀 RPC URL
auth:
sender: "0x..." # 지갑 주소
threshold: 1 # 키스토어 threshold
keystore: "path/to/keystore"
password: "optional_password"
db: # (선택) 데이터베이스 설정
type: "postgresql" # postgresql, mysql, sqlite
host: "localhost"
port: 5432
user: "username"
password: "password"
name: "database_name"
# SSH 터널 지원
sshHost: "remote.server.com"
sshUser: "user"
sshKey: "path/to/ssh/key"
log:
logLevel: "info" # silly, debug, info, warn, error
logToFile: false
outputDir: "./output"환경 변수도 지원합니다(.env.{network}.{dbtype} 파일):
DB_HOST=localhost
DB_PORT=5432
DB_USER=username
DB_PASSWORD=password
DB_NAME=database_name
SSH_HOST=remote.server.com
SSH_USER=user
SSH_KEY=/path/to/ssh/key지정한 암호화 방식으로 새 키스토어를 생성합니다.
blue gen-key --scheme <scheme>옵션:
-s, --scheme <scheme>: 키페어 방식 (필수)ed25519: EdDSA (기본값)secp256k1: secp256k1 곡선 ECDSAsecp256r1: secp256r1 곡선 ECDSA
개인키를 키스토어 형식으로 가져옵니다.
blue import-key --scheme <scheme> --threshold <threshold>옵션:
-s, --scheme <scheme>: 키페어 방식 (필수)-t, --threshold <threshold>: 키스토어 threshold (기본값: 1)
지정한 주소와 threshold로 개인키를 검증합니다.
blue check-key --address <address> --threshold <threshold>옵션:
-a, --address <address>: 확인할 키의 주소 (필수)-t, --threshold <threshold>: threshold (기본값: 1)
키스토어를 개인키 형식으로 내보냅니다.
blue export-key [--address <address>] [--threshold <threshold>]옵션:
--address <address>: 내보낼 키의 주소--threshold <threshold>: 내보낼 키의 threshold
Shamir's Secret Sharing(SSS) 방식으로 키스토어를 암호화합니다.
blue encrypt-sss [--address <address>] [--threshold <threshold>]새 Move 패키지 템플릿을 생성합니다.
blue gen-pkg --name <name> [--author <author>]옵션:
-n, --name <name>: 패키지 이름 (필수)-a, --author <author>: 패키지 작성자 (기본값: "blue")
Move 패키지를 블록체인에 배포합니다.
blue publish [--config <config>] [--path <path>]옵션:
--config <config>: 설정 파일 경로--path <path>: Move 패키지 디렉토리 경로
기존 Move 패키지를 업그레이드합니다.
blue upgrade [--config <config>] [--path <path>] [--package-id <id>] [--upgrade-cap-id <id>] [--upgrade-policy <policy>]옵션:
--config <config>: 설정 파일 경로--path <path>: Move 패키지 디렉토리 경로--package-id <id>: 업그레이드할 패키지 ID--upgrade-cap-id <id>: 업그레이드 권한 오브젝트 ID--upgrade-policy <policy>: 업그레이드 정책 (기본값: "COMPATIBLE")
모든 콘솔 모드에서 사용 가능한 명령어입니다:
help,h: 사용 가능한 명령어 표시quit,q,exit: 콘솔 종료clear,c: 화면 초기화 및 환영 메시지 표시active: 트랜잭션 서명을 위한 키스토어 활성화
오브젝트 ID로 블록체인 오브젝트 조회
obj 0x123abc... 0x456def...주소가 소유한 오브젝트를 조회, 타입으로 필터링 가능
owned-obj # 내 오브젝트
owned-obj 0x123abc... # 특정 주소 오브젝트
owned-obj 0x123abc... "0x2::coin::Coin<0x2::sui::SUI>" # 타입 필터링트랜잭션 해시로 상세 정보 조회
tx 0x789ghi...주소의 코인 잔액 조회
balance # 내 SUI 잔액
balance 0x123abc... # 특정 주소 SUI 잔액
balance SUI # 내 SUI 잔액 (대체)
balance 0x123abc... "0x2::sui::SUI" # 특정 주소 및 코인 타입주소가 소유한 모든 코인 조회
coins # 내 코인
coins 0x123abc... # 특정 주소 코인새 트랜잭션 빌더 초기화
init현재 트랜잭션 명령어 표시
commands트랜잭션 빌더에서 명령어 제거
remove 1 # 첫 번째 명령어 제거SUI 전송 명령 추가
transfer 0x123abc... 1000000000 # 1 SUI 전송 (MIST 단위)오브젝트 전송 명령 추가
transfer-obj 0x123abc... 0x456def... 0x789ghi...코인 병합 명령 추가
merge 0x123abc... 0x456def... 0x789ghi...특정 코인 타입의 모든 코인을 하나로 병합
merge-all 0x2::sui::SUI
merge-all "0x123abc...::my_coin::COIN"코인 분할 명령 추가
split 0x123abc... 100000000 200000000 300000000DB에서 패키지 이름으로 패키지 ID 조회
address my_package함수 파라미터 자동 해석 및 표시
function-args my_package counter increment
function-args 0x123abc... counter incrementMove 함수 호출 명령 추가
movec my_package counter increment
movec 0x123abc... counter increment 42 "hello"Move 함수 view 모드 실행 (읽기 전용)
movew my_package counter get_value
movew 0x123abc... counter get_value 0x456def...트랜잭션 빌드, 서명, 실행
write파일에서 트랜잭션 서명
sign
# 파일 경로 입력 프롬프트파일에서 서명된 트랜잭션 전송
send
# 파일 경로 입력 프롬프트지정 경로의 Move 패키지 배포
publish ./my_package시스템 명령어 실행
exec ls -la
exec sui client active-address도메인 네임 관리용 SuiNS 콘솔 실행:
blue ns-console [--config <config>] [--active]기본 콘솔 명령어 외에, NS 콘솔은 다음을 지원합니다:
네임 레코드 정보 조회
record example.sui
record example # .sui 자동 추가등록 가격 조회
price갱신 가격 조회
renewal-price코인 타입별 할인 정보
discounts특정 코인 타입 가격 정보
price-info SUI
price-info USDC도메인 등록
register example.sui 1 sui # 1년, SUI 결제
register example 2 usdc # 2년, USDC 결제
register example # 1년, SUI 결제(기본)인자:
name: 도메인 이름 (.sui 자동 추가)years: 등록 기간(1~5년, 기본: 1)payType: 결제 방식 -sui,mist,usdc(기본: sui)
도메인 갱신
renew 0x123abc... 1 sui
renew 123abc 2 usdc # 0x 생략 가능인자:
nftId: 도메인 NFT 오브젝트 IDyears: 갱신 기간(1~5년)payType: 결제 방식 -sui,mist,usdc(기본: sui)
도메인 대상 주소 설정
set-target 0x123abc... 0x456def...
set-target 123abc 456def # 0x 생략 가능기본 도메인 설정
set-default example.sui
set-default example # .sui 자동 추가서브도메인 생성
create-subname 0x123abc... sub 1735689600000 true true인자:
parentNftId: 상위 도메인 NFT IDsubname: 서브도메인 이름expirationMs: 만료 타임스탬프(ms)allowChild: 하위 생성 허용(기본: true)allowExtension: 기간 연장 허용(기본: true)
서브도메인 설정 변경
edit-subname sub.example.sui 0x123abc... true false서브도메인 만료 연장
extend-subname 0x123abc... 1735689600000리프 서브도메인 생성(별도 NFT 없음)
create-leaf 0x123abc... leaf 0x456def...리프 서브도메인 제거
remove-leaf 0x123abc... leaf도메인 메타데이터 설정
set-data 0x123abc... avatar "https://example.com/avatar.png" false
set-data 0x123abc... description "My domain" true인자:
nftId: 도메인 NFT 오브젝트 IDkey: 메타데이터 키value: 메타데이터 값isSubname: 서브도메인 여부(기본: false)
만료 도메인 소각
burn-expired 0x123abc... false
burn-expired 0x123abc... true # 서브도메인탈중앙화 스토리지 작업용 Walrus 콘솔 실행:
blue walrus-console [--config <config>] [--active]기본 콘솔 명령어 외에, Walrus 콘솔은 다음을 지원합니다:
파일 스토리지 비용 계산
cost ./document.pdf 10
cost /path/to/image.jpg 5인자:
filePath: 비용 계산할 파일 경로epochs: 저장 기간(epoch)
출력:
- 파일 크기 및 비용 내역
- MIST/WAL 기준 스토리지 비용
- MIST/WAL 기준 쓰기 비용
- 총 비용 계산
파일 업로드
upload ./document.pdf 10
upload /path/to/image.jpg 5인자:
filePath: 업로드할 파일 경로epochs: 저장 기간(epoch)
인터랙티브 프롬프트:
- 비용 확인 및 승인 요청
- 삭제 가능 여부 선택
- 서명을 위한 키스토어 필요
출력:
- Blob ID (파일 접근용)
- Sui 블록체인 오브젝트 ID
- 파일 접근 URL
- 스토리지 메타데이터(epochs, encoding 등)
DEX 작업용 DeepBook 콘솔 실행:
blue db-console [--config <config>] [--active]기본 콘솔 명령어 외에, DB 콘솔은 다음을 지원합니다:
새 거래 풀 생성
create-pool SUI USDC 1000000 1000000 1000000인자:
baseCoinKey: 기준 코인 식별자(예: "SUI")quoteCoinKey: 상대 코인 식별자(예: "USDC")tickSize: 최소 가격 단위lotSize: 최소 수량 단위minSize: 최소 주문 크기
Blue CLI는 패키지/모듈 정보를 저장하기 위해 다양한 데이터베이스 백엔드를 지원합니다:
- PostgreSQL: SSH 터널 지원, 완전한 기능
- MySQL: 커넥션 풀링 지원, 완전한 기능
- SQLite: 경량, 파일 기반
DB는 다음 테이블을 자동 생성합니다:
- packages: 배포된 Move 패키지
- modules: 모듈 정의 및 ABI
- function_call: 함수 호출 메타데이터
- function_object_arg: 함수 파라미터 정보
- indexer_objects: 파라미터 해석용 오브젝트 인덱싱
원격 DB 연결 시 SSH 터널링 지원:
db:
type: "postgresql"
host: "localhost"
port: 5432
sshHost: "remote.server.com"
sshUser: "username"
sshKey: "/path/to/ssh/private/key"# 새 키스토어 생성
blue gen-key --scheme ed25519
# 기존 개인키 import (대안)
blue import-key --scheme ed25519 --threshold 1
# 키스토어 무결성 확인
blue check-key --address 0x123abc... --threshold 1
# 새 패키지 생성
blue gen-pkg --name my_counter --author developer
# 콘솔 실행 및 배포
blue console --config config.yaml --active
> publish ./my_counter
> movec my_counter counter increment
> write# NS 콘솔 실행
blue ns-console --config config.yaml --active
# 가격 확인 및 도메인 등록
> price
> register mydomain.sui 2 sui
> set-target <nft-id> 0x123abc...
> create-subname <nft-id> api 1735689600000# Walrus 콘솔 실행
blue walrus-console --config config.yaml --active
# 파일 업로드
> cost ./document.pdf 10
> upload ./document.pdf 10blue console --config config.yaml
# 복합 트랜잭션 빌드
> init
> transfer 0x123abc... 1000000000
> movec package_name module_name function_name arg1 arg2
> split 0x456def... 500000000 300000000
> commands
> write# 의존성 설치
npm install
# 빌드
npm run build
# 개발용 링크
npm link
# 테스트 실행
npm test[라이선스 정보]
[기여 가이드라인]
Blue CLI - Sui 블록체인 개발을 위한 종합 툴킷
