@twelvehart/envctl
Version:
Environment variable context manager for development workflows
72 lines • 2.18 kB
TypeScript
import { Profile } from './types';
import os from 'os';
import path from 'path';
import fs from 'fs-extra';
interface Dependencies {
os: typeof os;
path: typeof path;
fs: typeof fs;
}
export declare class EnvManager {
private storage;
private deps;
constructor(deps?: Partial<Dependencies>);
private getShellRcFile;
createProfile: (name: string) => Promise<void>;
addVariable: (profileName: string, key: string, value: string) => Promise<void>;
addVariablesFromFile: (profileName: string, filePath: string) => Promise<number>;
removeVariable: (profileName: string, key: string) => Promise<void>;
loadProfile: (profileName: string) => Promise<string>;
private reloadCurrentProfile;
private getSessionBackupPath;
private generateLoadCommands;
unloadProfile: () => Promise<{
commands: string;
profileName: string;
}>;
switchProfile: (profileName: string) => Promise<{
commands: string;
from?: string;
to: string;
}>;
getStatus: () => Promise<{
currentSession: {
sessionId: string;
profileName?: string;
variableCount?: number;
};
otherSessions: Array<{
sessionId: string;
profileName: string;
}>;
totalSessions: number;
}>;
private getSessionId;
getSessions: () => Promise<Array<{
sessionId: string;
profileName: string;
}>>;
listProfiles: () => Promise<Array<{
name: string;
isLoaded: boolean;
variableCount: number;
loadedInSessions?: string[];
}>>;
getProfile: (name: string) => Promise<Profile | null>;
deleteProfile: (name: string) => Promise<void>;
exportProfile: (name: string) => Promise<string>;
setupShellIntegration: () => Promise<{
rcFile: string;
integrationFile: string;
}>;
unsetupShellIntegration: () => Promise<{
rcFile: string;
integrationFile: string;
removed: string[];
}>;
cleanupAllData: () => Promise<{
removed: string[];
}>;
}
export {};
//# sourceMappingURL=env-manager.d.ts.map