| Crates.io | dfxmon-cli |
| lib.rs | dfxmon-cli |
| version | 0.1.4 |
| created_at | 2025-06-06 23:41:18.146014+00 |
| updated_at | 2025-06-07 00:57:29.020743+00 |
| description | CLI tool for interacting with dfxmon canister on the Internet Computer |
| homepage | https://github.com/dfxmon/dfxmon |
| repository | https://github.com/dfxmon/dfxmon |
| max_upload_size | |
| id | 1703579 |
| size | 108,607 |
Command-line interface for dfxmon - the universal file watcher and auto-deployment tool for Internet Computer (ICP) projects.
The dfxmon CLI is a client tool that communicates with the dfxmon canister deployed on the Internet Computer. It provides a seamless interface for managing file watching and automatic deployment of your ICP projects.
cargo install dfxmon-cli
Download the latest binary for your platform from the GitHub Releases page.
Assuming you have a typical ICP project structure:
my-dapp/
├── dfx.json
├── src/
│ ├── backend/
│ │ ├── main.mo # Motoko backend
│ │ └── types.mo
│ ├── frontend/
│ │ ├── src/
│ │ │ ├── App.tsx # React frontend
│ │ │ └── index.ts
│ │ └── package.json
│ └── shared/
│ └── types.did
└── canister_ids.json
Step 1: Register your project with dfxmon
cd my-dapp
dfxmon create my-dapp --dfx-json ./dfx.json --auto-deploy
Step 2: Start development with auto-deployment
dfxmon watch my-dapp
Now when you edit files, dfxmon automatically handles deployments:
src/backend/main.mo → Backend canister redeployssrc/frontend/src/App.tsx → Frontend assets redeploysrc/shared/types.did → Both canisters redeploydfxmon createCreate a new project in the dfxmon canister.
dfxmon create <PROJECT_NAME> [OPTIONS]
Options:
--dfx-json <PATH> Path to dfx.json file
--auto-deploy Enable automatic deployment
--debounce-ms <MS> Debounce delay in milliseconds [default: 1000]
dfxmon watchStart watching a project for file changes.
dfxmon watch <PROJECT_NAME> [OPTIONS]
Options:
--filter <FILTER> Filter files to watch (e.g., "*.rs,*.mo")
dfxmon deployManually trigger deployment of a project or specific canister.
dfxmon deploy <PROJECT_NAME> [OPTIONS]
Options:
--canister <NAME> Deploy specific canister only
--force Force deployment even if no changes detected
dfxmon statusGet the status of a project.
dfxmon status <PROJECT_NAME>
dfxmon listList all projects managed by the dfxmon canister.
dfxmon list
dfxmon historyView deployment history for a project.
dfxmon history <PROJECT_NAME> [OPTIONS]
Options:
--limit <N> Number of deployments to show [default: 10]
dfxmon settingsView or update global settings.
dfxmon settings [OPTIONS]
Options:
--get Show current settings
--max-deployments <N> Set max concurrent deployments
--debounce <MS> Set default debounce delay
--notifications Enable/disable notifications
--log-level <LEVEL> Set log level (debug, info, warn, error)
The CLI comes with embedded canister IDs for both local and mainnet networks:
uxrrr-q7777-77774-qaaaq-cai (automatically used with --network local)yvfam-kiaaa-aaaag-aucfa-cai (automatically used with --network mainnet)No configuration required! The CLI automatically selects the correct canister based on your network.
You can override the embedded IDs if needed:
Command line flag:
dfxmon --canister-id your-custom-canister-id create my-project
Environment variable:
export DFXMON_CANISTER_ID=your-custom-canister-id
dfxmon create my-project
Configuration file (.dfxmon.toml in current directory or home):
canister_id = "your-custom-canister-id"
network = "local"
The CLI supports convenient network shortcuts:
--network local → http://localhost:4943 (default)--network mainnet or --network ic → https://ic0.app--network https://your-custom-replica.comExamples:
# Local development (default)
dfxmon create my-project
# Mainnet
dfxmon --network mainnet create my-project
# Custom network
dfxmon --network https://testnet.dfinity.network create my-project
Or set the network in configuration:
network = "mainnet" # or "local", "ic", or custom URL
When you run dfxmon watch, the CLI starts a local file watcher that monitors your project directory for changes. When changes are detected, it notifies the dfxmon canister, which then triggers the appropriate deployment.
.mo files.rs files.js, .ts, .jsx, .tsx, .html, .css, .scss.json, .toml, .did.mdThe following files and directories are automatically ignored:
.dfx/ - DFX build artifactstarget/ - Rust build artifactsnode_modules/ - Node.js dependencies.git/ - Git repository filesdist/, build/ - Build output directories*.tmp, *.swp, *~)Working on a DeFi project with multiple Rust canisters:
# Project structure:
# defi-dapp/
# ├── src/
# │ ├── token/src/lib.rs # Token canister
# │ ├── exchange/src/lib.rs # Exchange canister
# │ ├── governance/src/lib.rs # Governance canister
# │ └── frontend/src/App.tsx # React frontend
# └── dfx.json
cd defi-dapp
dfxmon create defi-dapp --dfx-json ./dfx.json --auto-deploy
dfxmon watch defi-dapp
# Now edit src/token/src/lib.rs
# → Only the token canister rebuilds and redeploys
# → Other canisters remain untouched
Working on a social media dapp with frequent UI changes:
# Focus only on frontend changes
dfxmon watch social-dapp --filter "*.tsx,*.css,*.js"
# Edit src/frontend/components/Feed.tsx
# → Frontend assets rebuild and redeploy instantly
# → Backend canisters stay running without interruption
Typical full-stack development workflow:
# Project: chat-app
dfxmon create chat-app --dfx-json ./dfx.json --auto-deploy
dfxmon watch chat-app
# Terminal 1: dfxmon watching
# Terminal 2: Your editor
# Edit src/backend/main.mo (add new message type)
# → Backend redeploys, Candid interface updates
# → dfxmon detects interface change, triggers frontend rebuild
# Edit src/frontend/src/types.ts (update types)
# → Frontend rebuilds with new types
# → Hot reload in browser shows changes immediately
Using dfxmon to track deployments on mainnet:
# Connect to mainnet dfxmon canister
export DFXMON_CANISTER_ID="rdmx6-jaaaa-aaaaa-aaadq-cai"
dfxmon --network ic list
# Check production deployment history
dfxmon --network ic history my-production-app --limit 20
# Monitor deployment status
dfxmon --network ic status my-production-app
"Canister ID not provided"
--canister-id, environment variable, or config file"Failed to connect to replica"
dfx start)"Permission denied"
"File watching not working"
dfxmon list)Enable verbose logging for troubleshooting:
RUST_LOG=debug dfxmon watch my-project
Contributions are welcome! Please see the main repository for contribution guidelines.
This project is licensed under either of
at your option.
Created by Dedan Okware (softengdedan@gmail.com)