mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 16:30:57 +00:00
refactor: trim cli helper exports
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import path from "node:path";
|
||||
|
||||
export const DEFAULT_CLI_NAME = "openclaw";
|
||||
const DEFAULT_CLI_NAME = "openclaw";
|
||||
|
||||
const KNOWN_CLI_NAMES = new Set([DEFAULT_CLI_NAME]);
|
||||
const CLI_PREFIX_RE = /^(?:((?:pnpm|npm|bunx|npx)\s+))?(openclaw)\b/;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
export type ConfigSetMode = "value" | "json" | "ref_builder" | "provider_builder" | "batch";
|
||||
type ConfigSetMode = "value" | "json" | "ref_builder" | "provider_builder" | "batch";
|
||||
|
||||
export type ConfigSetModeResolution =
|
||||
type ConfigSetModeResolution =
|
||||
| {
|
||||
ok: true;
|
||||
mode: ConfigSetMode;
|
||||
|
||||
@@ -2,7 +2,7 @@ import { readSecretFromFile } from "../acp/secret-file.js";
|
||||
import { defaultRuntime } from "../runtime.js";
|
||||
import { normalizeOptionalString } from "../shared/string-coerce.js";
|
||||
|
||||
export function resolveGatewaySecretOption(params: {
|
||||
function resolveGatewaySecretOption(params: {
|
||||
direct?: unknown;
|
||||
file?: unknown;
|
||||
directFlag: string;
|
||||
@@ -20,7 +20,7 @@ export function resolveGatewaySecretOption(params: {
|
||||
return direct || undefined;
|
||||
}
|
||||
|
||||
export function warnGatewaySecretCliFlag(flag: "--token" | "--password"): void {
|
||||
function warnGatewaySecretCliFlag(flag: "--token" | "--password"): void {
|
||||
defaultRuntime.error(
|
||||
`Warning: ${flag} can be exposed via process listings. Prefer ${flag}-file or environment variables.`,
|
||||
);
|
||||
|
||||
@@ -2,11 +2,11 @@ import { theme } from "../terminal/theme.js";
|
||||
|
||||
export type HelpExample = readonly [command: string, description: string];
|
||||
|
||||
export function formatHelpExample(command: string, description: string): string {
|
||||
function formatHelpExample(command: string, description: string): string {
|
||||
return ` ${theme.command(command)}\n ${theme.muted(description)}`;
|
||||
}
|
||||
|
||||
export function formatHelpExampleLine(command: string, description: string): string {
|
||||
function formatHelpExampleLine(command: string, description: string): string {
|
||||
if (!description) {
|
||||
return ` ${theme.command(command)}`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user