Skip to content

diodechain/dcon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dcon — Diode Console CLI

Command-line client for the Diode Console JSON-RPC API.

Use dcon to manage fleets and members from scripts, CI, or your terminal without writing raw curl calls. API keys (dck_…) are created in Console Settings; see the API documentation for full method reference.

Install

Requires Go 1.22+.

git clone https://github.com/diodechain/dcon.git
cd dcon
go build -o dcon .

Or install into your PATH:

go install github.com/diodechain/dcon@latest

Authentication

Store an API key locally (written to ~/.config/dcon/config.json, mode 0600):

dcon auth
dcon auth --key dck_your_key_here

Alternatively, set the environment variable (takes precedence over the config file):

export DCON_API_KEY=dck_your_key_here

Usage

List supported methods

dcon methods

Fleet commands (recommended)

Typed subcommands with kebab-case flags:

# Create and inspect a fleet
dcon fleet create --name Production
dcon fleet info --fleet-id 550e8400-e29b-41d4-a716-446655440000

# Members
dcon fleet member list --fleet-id 550e8400-e29b-41d4-a716-446655440000 --limit 10 --offset 0
dcon fleet member add --fleet-id 550e8400-e29b-41d4-a716-446655440000 \
  --address 0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb --label "Device A"
dcon fleet member get --fleet-id 550e8400-e29b-41d4-a716-446655440000 --address 0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb

# Batch add (comma-separated addresses or JSON members)
dcon fleet member add-batch --fleet-id 550e8400-e29b-41d4-a716-446655440000 \
  --addresses 0xabc...,0xdef...
dcon fleet member add-batch --fleet-id 550e8400-e29b-41d4-a716-446655440000 \
  --members-json '[{"address":"0x...","label":"A"}]'

# Rename or destroy
dcon fleet rename --fleet-id 550e8400-e29b-41d4-a716-446655440000 --name Staging
dcon fleet destroy --fleet-id 550e8400-e29b-41d4-a716-446655440000

Run dcon fleet --help and dcon fleet member --help for the full command tree.

Generic API calls

Call any JSON-RPC method with snake_case flags:

dcon api fleet.member.list \
  --fleet_id 550e8400-e29b-41d4-a716-446655440000 \
  --limit 10 --offset 0

For nested or array parameters, pass JSON:

dcon api fleet.member.add_batch \
  --fleet_id 550e8400-e29b-41d4-a716-446655440000 \
  --params-json '{"members":[{"address":"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb","label":"Device A"}]}'

Output

Successful calls print pretty-printed JSON of the RPC result to stdout. Errors print the JSON-RPC error object to stderr and exit with code 1.

Custom endpoint

dcon fleet info --fleet-id <uuid> --url https://console.diode.io/api/v1/rpc

Supported API methods

Method dcon fleet shortcut
fleet.create fleet create
fleet.rename fleet rename
fleet.info fleet info
fleet.destroy fleet destroy
fleet.member.add fleet member add
fleet.member.add_batch fleet member add-batch
fleet.member.list fleet member list
fleet.member.get fleet member get
fleet.member.remove fleet member remove
fleet.member.remove_batch fleet member remove-batch

New upstream methods can be used immediately via dcon api <method> … before a typed subcommand is added.

Development

go test ./...
go build -o dcon .
Document Description
AGENTS.md Guide for AI coding agents
docs/ Architecture, development, API sync checklist
docs/api-sync.md How to update dcon when the Console API changes

Links

About

Diode Console CLI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages