Skip to main content
Version: Next

@backstage/cli-common

Home > @backstage/cli-common

Common functionality used by cli, backend, and create-app

Classes

Class

Description

ExitCodeError

Error thrown when a child process exits with a non-zero code.

Functions

Function

Description

bootstrapEnvProxyAgents()

This function can be called to setup undici and node-fetch Proxy agents.

You can set GLOBAL_AGENT_HTTP(S)_PROXY to configure a proxy to be used in the CLIs.

You can also configure a custom namespace by setting GLOBAL_AGENT_ENVIRONMENT_VARIABLE_NAMESPACE which will replace the default "GLOBAL_AGENT_" env-var prefix.

Make sure to call this function before any other imports.

findPaths(searchDir)

Find paths related to a package and its execution context.

isChildPath(base, path)

Checks if path is the same as or a child path of base.

run(args, options)

Runs a command and returns a child process handle.

runCheck(args)

Runs a command and returns true if it exits with code 0, false otherwise.

runOutput(args, options)

Runs a command and returns the stdout.

Interfaces

Interface

Description

RunChildProcess

Child process handle returned by run().

Variables

Variable

Description

BACKSTAGE_JSON

The name of the backstage's config file

Type Aliases

Type Alias

Description

Paths

Common paths and resolve functions used by the cli. Currently assumes it is being executed within a monorepo.

ResolveFunc

A function that takes a set of path fragments and resolves them into a single complete path, relative to some root.

RunOnOutput

Callback function that can be used to receive stdout or stderr data from a child process.

RunOptions

Options for running a child process with run() or related functions.