![]() |
dfx 0.1.0
Linux-based dynamic dataflow executor
|
dfx-ctl is the command-line control tool of the dfx project.
It is used to interact with running dfx components, both at the instance level and at the daemon level, and acts as the primary human and script-facing control plane for dfx.
Conceptually, dfx-ctl plays a role similar to tools such as docker or kubectl: it is an imperative, stateless CLI that connects to a target, performs an operation, prints the result, and exits.
dfx-ctl serves two complementary roles:
These roles are intentionally combined in a single tool.
dfx-ctl communicates over Unix domain sockets with:
Depending on the invoked subcommand, dfx-ctl may target either a specific instance or the daemon itself.
dfx is designed around the idea of runtime graph mutability.
Through dfx-ctl, it is possible to:
at any point during execution, while the instance is running.
These operations are expected to be safe and supported by the runtime. dfx-ctl does not treat the graph as immutable once started.
dfx-ctl is a strictly stateless program:
Each invocation:
Any persistence (for example, storing exported graphs) is the responsibility of the caller.
Commands exposed by dfx-ctl are intentionally high-level and semantic.
They are grouped by domain (node, channel, graph, config, …) and reflect what the user wants to do, not the details of the underlying protocol.
The CLI does not aim to be a thin one-to-one mapping of protocol messages.
The raw command provides a low-level escape hatch.
It allows sending arbitrary commands and parameters directly to a dfx or dfxd control socket, bypassing the structured CLI interface.
This command exists primarily to:
raw should be considered a backdoor rather than a stable, user-friendly interface.
Command sets and JSON schemas are versioned and documented.
However, as dfx is a personal project, dfx-ctl follows a best-effort compatibility model:
Users relying on dfx-ctl for automation should be prepared to adapt scripts accordingly.
Common use cases include:
The following examples illustrate typical interactions with dfx-ctl. They are intentionally concise and focus on intent rather than exhaustive option coverage.
List all nodes currently present in a running graph:
Retrieve detailed information about a specific node:
Add a new node while the instance is running:
Connect two existing nodes:
Remove a node from the graph:
Export the current runtime graph to a file:
Validate a graph definition before importing it:
dfx-ctl is not: