UNPKG

@xec-sh/cli

Version:

Xec: The Universal Shell for TypeScript

78 lines (77 loc) 3.29 kB
import os from 'os'; import path from 'path'; import chalk from 'chalk'; import which from 'which'; import fs from 'fs-extra'; import { glob } from 'glob'; import fetch from 'node-fetch'; import * as clack from '@clack/prompts'; export declare const $: import("@xec-sh/core").CallableExecutionEngine; export declare function cd(dir?: string): string; export declare function pwd(): string; export declare const echo: ((...args: any[]) => void) & { info: (message: string) => void; success: (message: string) => void; warning: (message: string) => void; error: (message: string) => void; debug: (message: string) => void; step: (message: string) => void; }; export declare function spinner(options?: string | { text?: string; color?: string; }): { start: (msg?: string) => void; stop: (msg?: string, code?: number) => void; message: (msg?: string) => void; }; export declare const question: (opts: clack.TextOptions) => Promise<string | symbol>; export declare const confirm: (opts: clack.ConfirmOptions) => Promise<boolean | symbol>; export declare const select: <Value>(opts: clack.SelectOptions<Value>) => Promise<symbol | Value>; export declare const multiselect: <Value>(opts: clack.MultiSelectOptions<Value>) => Promise<symbol | Value[]>; export declare const password: (opts: clack.PasswordOptions) => Promise<string | symbol>; export { os, path }; export { fs, glob }; export { fetch }; export declare function exit(code?: number): void; export declare function env(key: string, defaultValue?: string): string | undefined; export declare function setEnv(key: string, value: string): void; export declare function retry<T>(fn: () => Promise<T>, options?: { retries?: number; delay?: number; backoff?: number; onRetry?: (error: Error, attempt: number) => void; }): Promise<T>; export declare function sleep(ms: number): Promise<void>; export declare function template(strings: TemplateStringsArray, ...values: any[]): string; export { which }; export declare function quote(arg: string): string; export declare function tmpdir(): string; export declare function tmpfile(prefix?: string, suffix?: string): string; export declare function yaml(): Promise<{ parse: typeof import("js-yaml").load; stringify: typeof import("js-yaml").dump; }>; export declare function csv(): Promise<{ parse: typeof import("csv-parse/sync").parse; stringify: typeof import("csv-stringify/sync").stringify; }>; export declare function diff(a: string, b: string, options?: any): Promise<undefined>; export declare function parseArgs(args: string[]): Promise<import("minimist").ParsedArgs>; export declare function loadEnv(envPath?: string): Promise<import("dotenv").DotenvConfigOutput>; export declare function kill(pid: number, signal?: string): void; export declare function ps(): Promise<any[]>; export declare function within<T>(options: { cwd?: string; env?: Record<string, string>; }, fn: () => Promise<T>): Promise<T>; export declare const log: { info: (message: string) => void; success: (message: string) => void; warning: (message: string) => void; error: (message: string) => void; step: (message: string) => void; }; export { chalk }; declare const scriptUtils: any; export default scriptUtils;