Zongsoft.Commands
7.14.0
dotnet add package Zongsoft.Commands --version 7.14.0
NuGet\Install-Package Zongsoft.Commands -Version 7.14.0
<PackageReference Include="Zongsoft.Commands" Version="7.14.0" />
<PackageVersion Include="Zongsoft.Commands" Version="7.14.0" />
<PackageReference Include="Zongsoft.Commands" />
paket add Zongsoft.Commands --version 7.14.0
#r "nuget: Zongsoft.Commands, 7.14.0"
#:package Zongsoft.Commands@7.14.0
#addin nuget:?package=Zongsoft.Commands&version=7.14.0
#tool nuget:?package=Zongsoft.Commands&version=7.14.0
Zongsoft.Commands Command Plugin Library
Overview
Zongsoft.Commands packages commonly needed terminal commands for the Zongsoft command framework. It is useful for application diagnostics, maintenance scripts, interactive administration, and testing framework services without writing a dedicated user interface.
The package contributes commands through Zongsoft.Commands.plugin. After the plugin is loaded, they appear below /Workbench/Executor/Commands and can be invoked from a Zongsoft terminal host or through CommandExecutor.
Command Model
A command receives a parsed expression through a command context and returns a value asynchronously. The framework separates four concerns:
- Command tree: hierarchical names such as
File InfoorMessaging Queue Produceselect a command node. - Arguments and options: positional arguments carry input values; named options use forms such as
--algorithm:SHA256. - Pipeline value: the result of one command can become the input value of another command.
- Output: commands may return an object and may also write formatted content through
ICommandOutlet.
See CommandExecutor, CommandContext, and CommandLine for the underlying public abstractions.
Installation and Deployment
dotnet add package Zongsoft.Commands
For a plugin application, deploy the package artifacts so that Zongsoft.Commands.plugin is placed in the host's plugins directory. The manifest depends on the framework's main plugin and registers the command tree automatically.
💡 The easiest interactive entry point is the Zongsoft terminal host. Use
helpafter startup to inspect the commands actually loaded by the current application.
Quick Start
help
range --type:int --min:1 --max:5
checksum --algorithm:SHA256 "hello"
file.info ./appsettings.json
directory.list ./plugins
Application code can invoke the same tree after plugin initialization:
using Zongsoft.Components;
using var cancellation = new CancellationTokenSource(TimeSpan.FromSeconds(5));
var checksum = await CommandExecutor.Default.ExecuteAsync(
"checksum --algorithm:SHA256 hello",
cancellation: cancellation.Token);
🚨
CommandExecutor.Defaultonly contains nodes registered by the current host. A successful package reference does not loadZongsoft.Commands.plugin; verify deployment when a command cannot be found.
Included Commands
| Group | Commands | Purpose |
|---|---|---|
| General | Help, Echo, Cast, Dump, Json, Range, Random, Shuffle |
Inspect, convert, format, and generate values. |
| Runtime | Assembly, Checksum |
Inspect assemblies and compute checksums. |
| File system | File Open/Save/Copy/Move/Info/Exists/Delete, Directory List/Move/Info/Exists/Delete |
Work with the framework file-system abstraction. |
| Security | RSA Export/Import, Secret Generate/Verify, Password Generate/Parse |
Manage keys, secrets, and password representations. |
| Scheduling | Scheduler, Schedule, Reschedule, Unschedule |
Inspect and change registered schedules. |
| Sequence | Sequence Info/Reset/Increase/Decrease |
Operate on the configured sequence provider. |
| Configuration | Configuration Get |
Read the effective application configuration. |
| Messaging | Messaging Queue Produce/Subscribe |
Publish and observe messages through a configured queue provider. |
Some commands require services supplied by other plugins. Scheduling, sequence, messaging, and virtual file-system commands resolve their providers from the running application.
Extending the Tree
Custom commands normally derive from CommandBase<CommandContext>, declare options with CommandOptionAttribute, and are mounted by a plugin manifest. Keep command bodies thin: validate terminal input, call an application service, and return a useful result rather than duplicating domain logic.
💡 Use a parent command node to group related operations. This keeps completion and
helpoutput discoverable while avoiding long flat command names.
Errors and Safety
- Invalid or missing options are reported as command option exceptions; do not silently substitute security-sensitive values.
- File deletion, key export, scheduling changes, and message publication can alter external state. Confirm the active host, environment, and provider before invoking them.
- Cancellation is propagated to asynchronous commands, but an external provider may already have accepted an operation.
- Avoid passing credentials directly in expressions because terminal history and diagnostic output may retain them.
Related Resources
Plugin-Based Integration
Compose this feature through the host; a package reference supplies compile-time APIs, while plugin loading also requires deployed manifests and runtime assets. See the complete plugin workflow.
The manifest mounts the command set at /Workbench/Executor/Commands. In a terminal host, verify help and echo hello; provider-dependent commands still require their corresponding plugins.
| Runtime artifact | Source of truth |
|---|---|
Zongsoft.Commands |
Zongsoft.Commands.plugin |
| File copying and dependencies | Zongsoft.Commands.deploy |
Add this fragment to an existing host .deploy (retain Main and the host’s other base manifests; do not replace the whole file):
[plugins zongsoft commands]
nuget:Zongsoft.Commands
Run dotnet deploy against a test deployment as explained in the workflow, with the host's framework, platform, architecture and, where needed, site. Pin compatible versions in real deployments; application dependencies such as databases, caches or commercial runtimes are still separate prerequisites.
Additional artifacts listed by the deployment manifest include Zongsoft.Commands.plugin. Retain assemblies, dependencies and satellite resource directories as well. Restart the host after deployment, check plugin loading and service/driver registration, then verify the workflow above; copied files alone do not prove that the feature is active.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.0)
- Zongsoft.Core (>= 7.63.0)
-
net8.0
- Microsoft.Extensions.Configuration.Abstractions (>= 8.0.0)
- Zongsoft.Core (>= 7.63.0)
-
net9.0
- Microsoft.Extensions.Configuration.Abstractions (>= 9.0.2)
- Zongsoft.Core (>= 7.63.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 7.14.0 | 43 | 10/10/2026 |
| 7.13.0 | 124 | 8/11/2026 |
| 7.12.1 | 152 | 4/6/2026 |
| 7.12.0 | 144 | 4/5/2026 |
| 7.11.0 | 149 | 3/3/2026 |
| 7.10.0 | 174 | 1/8/2026 |
| 7.9.0 | 173 | 12/31/2025 |
| 7.8.0 | 249 | 12/25/2025 |
| 7.7.0 | 247 | 10/10/2025 |
| 7.6.0 | 343 | 8/28/2025 |
| 7.5.0 | 472 | 7/21/2025 |
| 7.4.0 | 474 | 6/11/2025 |
| 7.3.0 | 283 | 5/30/2025 |
| 7.2.0 | 311 | 5/19/2025 |
| 7.1.0 | 311 | 5/6/2025 |
| 7.0.0 | 278 | 2/24/2025 |