← All procedures

lib.rename

Rename a package across the ecosystem

MCPCLI
Package
@procedures/lib · README
Path
["lib","rename"]
CLI
mark lib rename --oldName <string> --newName <string>
MCP tool
lib.rename on the dev-tools server
As data
{"$proc":["lib","rename"],"input":{}}

Use it

In TypeScript

import { Client, LocalTransport, PROCEDURE_REGISTRY } from "@procedures/client";
import "@procedures/lib"; // registers its procedures

const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["lib","rename"], { oldName: "<oldName>", newName: "<newName>" });
console.log(JSON.stringify(result));

From the command line

$ mark lib rename --oldName <string> --newName <string>

As data, in a program

{
  "$proc": ["lib", "rename"],
  "input": { "oldName": "<oldName>", "newName": "<newName>" }
}

Input

FieldTypeRequiredDefaultDescription
oldNamestringyesCurrent package name to rename from
newNamestringyesNew package name to rename to
rootPathstringnoWorkspace root (defaults to the pnpm workspace that contains client-lib)
dryRunbooleannofalsePreview changes without applying (default: false)

Output

FieldTypeRequiredDefaultDescription
successbooleanyesTrue when every change succeeded
changesobject[]yesThe changes that the call made, or would make with dryRun
errorsstring[]yesThe errors
summaryobjectyesThe counts
JSON Schemas
{
  "input": {
    "type": "object",
    "properties": {
      "oldName": {
        "type": "string",
        "description": "Current package name to rename from"
      },
      "newName": {
        "type": "string",
        "description": "New package name to rename to"
      },
      "rootPath": {
        "description": "Workspace root (defaults to the pnpm workspace that contains client-lib)",
        "type": "string"
      },
      "dryRun": {
        "default": false,
        "description": "Preview changes without applying (default: false)",
        "type": "boolean"
      }
    },
    "required": [
      "oldName",
      "newName"
    ]
  },
  "output": {
    "type": "object",
    "properties": {
      "success": {
        "type": "boolean",
        "description": "True when every change succeeded"
      },
      "changes": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "enum": [
                "package-name",
                "dependency",
                "import",
                "dynamic-import"
              ],
              "description": "The kind of change"
            },
            "file": {
              "type": "string",
              "description": "The file that changes"
            },
            "field": {
              "description": "The dependency field, for a dependency change",
              "type": "string"
            },
            "line": {
              "description": "The line, for an import change",
              "type": "number"
            },
            "oldValue": {
              "type": "string",
              "description": "The old text"
            },
            "newValue": {
              "type": "string",
              "description": "The new text"
            }
          },
          "required": [
            "type",
            "file",
            "oldValue",
            "newValue"
          ],
          "additionalProperties": {}
        },
        "description": "The changes that the call made, or would make with dryRun"
      },
      "errors": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "The errors"
      },
      "summary": {
        "type": "object",
        "properties": {
          "packageNames": {
            "type": "number",
            "description": "The number of package name changes"
          },
          "dependencies": {
            "type": "number",
            "description": "The number of dependency changes"
          },
          "imports": {
            "type": "number",
            "description": "The number of import changes"
          },
          "total": {
            "type": "number",
            "description": "The number of changes"
          }
        },
        "required": [
          "packageNames",
          "dependencies",
          "imports",
          "total"
        ],
        "additionalProperties": {},
        "description": "The counts"
      }
    },
    "required": [
      "success",
      "changes",
      "errors",
      "summary"
    ],
    "additionalProperties": {}
  }
}