MCPcopy Index your code
hub / github.com/callstack/agent-device / renderUsageText

Function renderUsageText

src/cli/parser/cli-help.ts:953–995  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

951}
952
953function renderUsageText(): string {
954 const header = `agent-device <command> [args] [--json]
955
956CLI to automate supported app, device, desktop, and web targets for AI agents.
957`;
958
959 const commands = listCliCommandNames().map((name) => {
960 const schema = getCliCommandSchema(name);
961 return {
962 name,
963 schema,
964 usage: buildCommandListUsage(name, schema),
965 };
966 });
967 const commandLines = renderCommandSection(commands);
968
969 const helpFlags = listHelpFlags(GLOBAL_FLAG_KEYS);
970 const flagsSection = renderFlagSection('Global Flags:', helpFlags);
971 const startSection = renderTextSection('Agent Starting Point:', AGENT_START_LINES);
972 const quickstartSection = renderTextSection('Agent Quickstart:', AGENT_QUICKSTART_LINES);
973 const workflowsSection = renderAlignedSection('Agent Workflows:', AGENT_WORKFLOWS);
974 const configSection = renderTextSection('Configuration:', CONFIGURATION_LINES);
975 const environmentSection = renderAlignedSection('Environment:', ENVIRONMENT_LINES);
976 const examplesSection = renderTextSection('Examples:', EXAMPLE_LINES);
977
978 return `${header}
979${startSection}
980
981${workflowsSection}
982
983${commandLines}
984
985${flagsSection}
986
987${quickstartSection}
988
989${configSection}
990
991${environmentSection}
992
993${examplesSection}
994`;
995}
996
997export function buildUsageText(): string {
998 return renderUsageText();

Callers 1

buildUsageTextFunction · 0.85

Calls 8

listCliCommandNamesFunction · 0.90
getCliCommandSchemaFunction · 0.90
buildCommandListUsageFunction · 0.85
renderCommandSectionFunction · 0.85
listHelpFlagsFunction · 0.85
renderFlagSectionFunction · 0.85
renderTextSectionFunction · 0.85
renderAlignedSectionFunction · 0.85

Tested by

no test coverage detected