Rename Ctl's usage of "control" to "ctl" (#1039)

Ctl ended up calling its main class for "Control" for historical
reasons, along with its config file and plugin entrypoint.

The plugin entrypoint was renamed to ctl in 808eda0513.  This
finishes that renaming by also renaming the main class, default config
file, config-control command, and main entrypoint.

The config-control command is renamed to config to be consistent with
the host and controller's config commands.

The term "control" is still kept in the config and message locations as
a common specifier for both ctl and web_ui.
This commit is contained in:
Hornwitser authored and GitHub committed 2026-09-14 20:18:41 +02:00
1 parent 1d1d9bb1c4
commit 5df5af7ca8
35 files changed
+383 -383

No files matched your search

+2 -2
View File
@@ -887,8 +887,8 @@ async function main() {
}
if (answers.mode === "ctl") {
await execCtl(["control-config", "set", "control.controller_url", answers.controllerUrl]);
await execCtl(["control-config", "set", "control.controller_token", answers.controllerToken]);
await execCtl(["config", "set", "ctl.controller_url", answers.controllerUrl]);
await execCtl(["config", "set", "ctl.controller_token", answers.controllerToken]);
}
/* eslint-disable no-console */
+2 -2
View File
@@ -11,8 +11,8 @@ pluginCommands.add(new Command({
definition: ["my-command <foo>", "My command description that I really should change", (yargs) => {
yargs.positional("foo", { describe: "foo is foo!", type: "string" });
}],
handler: async function(args, control) {
const response = await control.sendTo("controller", new PluginExampleRequest(args.foo, [1, 2, 3]));
handler: async function(args, ctl) {
const response = await ctl.sendTo("controller", new PluginExampleRequest(args.foo, [1, 2, 3]));
console.log(response);
console.log(args);
},
+3 -3
View File
@@ -62,9 +62,9 @@ export const plugin = {
ctlEntrypoint: "./dist/node/ctl.js",
//%endif
//%if ctl & config
controlConfigFields: {
"__plugin_name__.myControlField": {
title: "My Control Field",
ctlConfigFields: {
"__plugin_name__.myCtlField": {
title: "My Ctl Field",
description: "This should be removed from index.js",
type: "string",
initialValue: "Remove Me",
+3 -3
View File
@@ -1,4 +1,4 @@
import type { Control, CtlPluginContext } from "@clusterio/ctl";
import type { Ctl, CtlPluginContext } from "@clusterio/ctl";
import { CommandTree, Command } from "@clusterio/lib";
//%// We do not check for multi context here because it doesn't make sense to have a ctl without messages
import { PluginExampleEvent, PluginExampleRequest } from "./messages.js";
@@ -12,8 +12,8 @@ pluginCommands.add(new Command({
definition: ["my-command <foo>", "My command description that I really should change", (yargs) => {
yargs.positional("foo", { describe: "foo is foo!", type: "string" });
}],
handler: async function(args: { foo: string }, control: Control) {
const response = await control.sendTo("controller", new PluginExampleRequest(args.foo, [1, 2, 3]));
handler: async function(args: { foo: string }, ctl: Ctl) {
const response = await ctl.sendTo("controller", new PluginExampleRequest(args.foo, [1, 2, 3]));
console.log(response);
console.log(args);
},
+5 -5
View File
@@ -22,8 +22,8 @@ declare module "@clusterio/lib" {
}
//%endif
//%if ctl & config
export interface ControlConfigFields {
"__plugin_name__.myControlField": string;
export interface CtlConfigFields {
"__plugin_name__.myCtlField": string;
}
//%endif
//%if multi_context | web
@@ -106,9 +106,9 @@ export const plugin: lib.PluginDeclaration = {
ctlEntrypoint: "./dist/node/ctl.js",
//%endif
//%if ctl & config
controlConfigFields: {
"__plugin_name__.myControlField": {
title: "My Control Field",
ctlConfigFields: {
"__plugin_name__.myCtlField": {
title: "My Ctl Field",
description: "This should be removed from index.js",
type: "string",
initialValue: "Remove Me",