Home / Function/ getInvoker() — ui Function Reference

getInvoker() — ui Function Reference

Architecture documentation for the getInvoker() function in index.ts from the ui codebase.

Entity Profile

Dependency Diagram

graph TD
  28cbf717_ece8_4d0e_8139_2a282be1870c["getInvoker()"]
  27cad3c1_266e_e42e_f1a7_558516d0b4a2["index.ts"]
  28cbf717_ece8_4d0e_8139_2a282be1870c -->|defined in| 27cad3c1_266e_e42e_f1a7_558516d0b4a2
  8c01449e_e53e_16cf_b00b_e176d622258d["main()"]
  8c01449e_e53e_16cf_b00b_e176d622258d -->|calls| 28cbf717_ece8_4d0e_8139_2a282be1870c
  style 28cbf717_ece8_4d0e_8139_2a282be1870c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

deprecated/cli/src/index.ts lines 4–19

function getInvoker() {
  const args = process.argv.slice(2)
  const env = process.env
  const npmExecPath = env.npm_execpath || ""
  const packageName = "shadcn@latest"

  if (npmExecPath.includes("pnpm")) {
    return `pnpm dlx ${packageName}${args.length ? ` ${args.join(" ")}` : ""}`
  } else if (npmExecPath.includes("yarn")) {
    return `yarn dlx ${packageName}${args.length ? ` ${args.join(" ")}` : ""}`
  } else if (npmExecPath.includes("bun")) {
    return `bunx ${packageName}${args.length ? ` ${args.join(" ")}` : ""}`
  } else {
    return `npx ${packageName}${args.length ? ` ${args.join(" ")}` : ""}`
  }
}

Subdomains

Called By

Frequently Asked Questions

What does getInvoker() do?
getInvoker() is a function in the ui codebase, defined in deprecated/cli/src/index.ts.
Where is getInvoker() defined?
getInvoker() is defined in deprecated/cli/src/index.ts at line 4.
What calls getInvoker()?
getInvoker() is called by 1 function(s): main.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free