handlers

tcmts.cli.run.handlers · #67xb6xmh · term · runs on the server

uses tcmts.cli.run.runInit, which uses node:path

Every command's handler, by name (but tcm mcp, which dispatch runs itself). Each is its own definition, and a run of tcm calls one: a suite counts the handlers it ran, so a change to one command's runs again only the suites that ran it. (A function making the table, as routes is: a table of functions written out would count every function in it.) Its type is every command's name: a command without a handler, or a handler without a command, doesn't typecheck.

import type { routes } from "#codebase/tcmts/cli/commands";
import {
  runAddUpdate, runAlias, runApps, runAt, runBranch, runBuild, runBuilds, runChangelog, runCheck, runComplete,
  runContribute, runContribution, runData, runDepsDependentsDocs, runDescribe, runDev, runDiff, runEdit, runExport,
  runFind, runFmt, runHistory, runImport, runInit, runJobs, runLib, runLint, runLs, runLsp, runMergeSwitch,
  runMigrate, runMirror, runMv, runPack, runPackages, runPatch, runPull, runPush, runRegistry, runRelease,
  runReleases, runRemote, runReset, runResolve, runRevert, runRm, runRun, runSearch, runServe, runStart, runStatus,
  runTest, runTodo, runUpgrade, runUser, runVerify, runView, runWatch,
} from "#codebase/tcmts/cli/run";
import type { Handler } from "#codebase/tcmts/cli/run";

export const handlers = (): Record<Exclude<keyof ReturnType<typeof routes>, "mcp">, Handler> => ({
  init: { alone: runInit },
  watch: { run: runWatch },
  check: { run: runCheck },
  add: { run: runAddUpdate },
  update: { run: runAddUpdate },
  status: { run: runStatus },
  import: { run: runImport },
  mirror: { run: runMirror },
  edit: { run: runEdit },
  at: { run: runAt },
  patch: { run: runPatch },
  view: { run: runView },
  search: { run: runSearch },
  ls: { run: runLs },
  find: { run: runFind },
  deps: { run: runDepsDependentsDocs },
  dependents: { run: runDepsDependentsDocs },
  docs: { run: runDepsDependentsDocs },
  run: { run: runRun },
  export: { run: runExport },
  mv: { run: runMv },
  alias: { run: runAlias },
  rm: { run: runRm },
  todo: { run: runTodo },
  resolve: { run: runResolve },
  test: { run: runTest },
  lint: { run: runLint },
  fmt: { run: runFmt },
  migrate: { alone: runMigrate },
  verify: { run: runVerify },
  packages: { run: runPackages },
  upgrade: { run: runUpgrade },
  lib: { run: runLib },
  release: { run: runRelease },
  releases: { run: runReleases },
  changelog: { run: runChangelog },
  pack: { run: runPack },
  diff: { run: runDiff },
  history: { run: runHistory },
  describe: { run: runDescribe },
  reset: { run: runReset },
  branch: { run: runBranch },
  switch: { run: runMergeSwitch },
  merge: { run: runMergeSwitch },
  revert: { run: runRevert },
  dev: { run: runDev },
  build: { run: runBuild },
  start: { run: runStart },
  builds: { alone: runBuilds },
  apps: { run: runApps },
  data: { run: runData },
  jobs: { run: runJobs },
  remote: { run: runRemote },
  push: { run: runPush },
  pull: { run: runPull },
  contribute: { run: runContribute },
  contribution: { run: runContribution },
  serve: { run: runServe },
  registry: { alone: runRegistry },
  user: { run: runUser },
  lsp: { alone: runLsp },
  complete: { alone: runComplete },
})

uses

used by