aliasmate 1.0.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +109 -0
- package/README.md +126 -2
- package/dist/cli.js +52 -15
- package/dist/cli.js.map +1 -1
- package/dist/commands/delete.d.ts +12 -0
- package/dist/commands/delete.d.ts.map +1 -1
- package/dist/commands/delete.js +29 -8
- package/dist/commands/delete.js.map +1 -1
- package/dist/commands/edit.d.ts +13 -0
- package/dist/commands/edit.d.ts.map +1 -1
- package/dist/commands/edit.js +50 -23
- package/dist/commands/edit.js.map +1 -1
- package/dist/commands/export.d.ts +17 -0
- package/dist/commands/export.d.ts.map +1 -1
- package/dist/commands/export.js +42 -7
- package/dist/commands/export.js.map +1 -1
- package/dist/commands/import.d.ts +21 -0
- package/dist/commands/import.d.ts.map +1 -1
- package/dist/commands/import.js +93 -48
- package/dist/commands/import.js.map +1 -1
- package/dist/commands/list.d.ts +20 -0
- package/dist/commands/list.d.ts.map +1 -1
- package/dist/commands/list.js +66 -5
- package/dist/commands/list.js.map +1 -1
- package/dist/commands/prev.d.ts +14 -1
- package/dist/commands/prev.d.ts.map +1 -1
- package/dist/commands/prev.js +41 -13
- package/dist/commands/prev.js.map +1 -1
- package/dist/commands/run.d.ts +16 -1
- package/dist/commands/run.d.ts.map +1 -1
- package/dist/commands/run.js +30 -10
- package/dist/commands/run.js.map +1 -1
- package/dist/commands/save.d.ts +15 -1
- package/dist/commands/save.d.ts.map +1 -1
- package/dist/commands/save.js +64 -33
- package/dist/commands/save.js.map +1 -1
- package/dist/commands/search.d.ts +19 -0
- package/dist/commands/search.d.ts.map +1 -0
- package/dist/commands/search.js +113 -0
- package/dist/commands/search.js.map +1 -0
- package/dist/storage/index.d.ts +34 -7
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +55 -11
- package/dist/storage/index.js.map +1 -1
- package/dist/utils/constants.d.ts +48 -0
- package/dist/utils/constants.d.ts.map +1 -0
- package/dist/utils/constants.js +51 -0
- package/dist/utils/constants.js.map +1 -0
- package/dist/utils/errors.d.ts +30 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/errors.js +62 -0
- package/dist/utils/errors.js.map +1 -0
- package/dist/utils/executor.d.ts +22 -1
- package/dist/utils/executor.d.ts.map +1 -1
- package/dist/utils/executor.js +36 -11
- package/dist/utils/executor.js.map +1 -1
- package/dist/utils/history.d.ts +21 -3
- package/dist/utils/history.d.ts.map +1 -1
- package/dist/utils/history.js +28 -14
- package/dist/utils/history.js.map +1 -1
- package/dist/utils/llm-generator.d.ts +21 -0
- package/dist/utils/llm-generator.d.ts.map +1 -0
- package/dist/utils/llm-generator.js +337 -0
- package/dist/utils/llm-generator.js.map +1 -0
- package/dist/utils/onboarding.d.ts +10 -0
- package/dist/utils/onboarding.d.ts.map +1 -0
- package/dist/utils/onboarding.js +201 -0
- package/dist/utils/onboarding.js.map +1 -0
- package/dist/utils/paths.d.ts +39 -1
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/paths.js +56 -1
- package/dist/utils/paths.js.map +1 -1
- package/dist/utils/prompts.d.ts +56 -0
- package/dist/utils/prompts.d.ts.map +1 -0
- package/dist/utils/prompts.js +51 -0
- package/dist/utils/prompts.js.map +1 -0
- package/package.json +22 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,oCAUC;AAMD,sCAEC;AAMD,kCAcC;AAQD,kCAsBC;AAOD,4BAGC;AAUD,4BAyBC;AAOD,kCAOC;AAOD,kCAGC;AAtKD,uCAAyB;AACzB,2CAA6B;AAC7B,uCAAyB;AAuBzB;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CAAC,EAAE,CAAC;QAC9B,OAAO,CAAC,IAAI,CAAC,sCAAsC,SAAS,EAAE,CAAC,CAAC;IAClE,CAAC;IAED,MAAM,OAAO,GAAG,WAAW,EAAE,CAAC;IAC9B,OAAO,CAAC,IAAI,CAAC,GAAG;QACd,OAAO,EAAE,OAAO,CAAC,IAAI,EAAE;QACvB,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC;QAClC,SAAS,EAAE,OAAO,CAAC,IAAI,CAAC,EAAE,SAAS,IAAI,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QAC/D,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;KACpC,CAAC;IACF,OAAO,WAAW,CAAC,OAAO,CAAC,CAAC;AAC9B,CAAC;AAED;;;;GAIG;AACH,SAAgB,WAAW,CAAC,IAAY;IACtC,MAAM,OAAO,GAAG,WAAW,EAAE,CAAC;IAC9B,IAAI,CAAC,CAAC,IAAI,IAAI,OAAO,CAAC,EAAE,CAAC;QACvB,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC;IACrB,OAAO,WAAW,CAAC,OAAO,CAAC,CAAC;AAC9B,CAAC;AAED;;;;GAIG;AACH,SAAgB,WAAW,CAAC,IAAY;IACtC,MAAM,OAAO,GAAG,WAAW,EAAE,CAAC;IAC9B,OAAO,IAAI,IAAI,OAAO,CAAC;AACzB,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Application constants
|
|
3
|
+
*/
|
|
4
|
+
export declare const APP_NAME = "aliasmate";
|
|
5
|
+
export declare const APP_VERSION = "1.2.0";
|
|
6
|
+
export declare const CONFIG_DIR_NAME = ".config/aliasmate";
|
|
7
|
+
export declare const CONFIG_FILE_NAME = "config.json";
|
|
8
|
+
/**
|
|
9
|
+
* Help messages
|
|
10
|
+
*/
|
|
11
|
+
export declare const HELP_MESSAGES: {
|
|
12
|
+
readonly noCommands: "No saved commands found.";
|
|
13
|
+
readonly useSaveOrPrev: "Use \"aliasmate save\" or \"aliasmate prev <name>\" to save a command";
|
|
14
|
+
readonly useList: "Use \"aliasmate list\" to see all saved commands";
|
|
15
|
+
readonly invalidName: "Name cannot contain spaces";
|
|
16
|
+
readonly emptyValue: (field: string) => string;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Success messages
|
|
20
|
+
*/
|
|
21
|
+
export declare const SUCCESS_MESSAGES: {
|
|
22
|
+
readonly saved: (name: string) => string;
|
|
23
|
+
readonly deleted: (name: string) => string;
|
|
24
|
+
readonly updated: (name: string) => string;
|
|
25
|
+
readonly exported: (count: number, path: string) => string;
|
|
26
|
+
readonly importComplete: "Import complete";
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Error messages
|
|
30
|
+
*/
|
|
31
|
+
export declare const ERROR_MESSAGES: {
|
|
32
|
+
readonly commandNotFound: (name: string) => string;
|
|
33
|
+
readonly couldNotSave: "Could not save command";
|
|
34
|
+
readonly couldNotDelete: "Could not delete command";
|
|
35
|
+
readonly couldNotUpdate: "Could not update command";
|
|
36
|
+
readonly couldNotRead: "Could not read config file";
|
|
37
|
+
readonly couldNotWrite: "Could not write to file";
|
|
38
|
+
readonly fileNotFound: (path: string) => string;
|
|
39
|
+
readonly invalidJson: "Could not parse file. Make sure it is valid JSON.";
|
|
40
|
+
readonly invalidFormat: "Invalid file format. Expected an \"aliases\" object.";
|
|
41
|
+
readonly invalidAliasStructure: (name: string) => string;
|
|
42
|
+
readonly directoryNotFound: (path: string) => string;
|
|
43
|
+
readonly historyNotAvailable: "Could not retrieve previous command from history.";
|
|
44
|
+
readonly interactiveNotSupported: "Interactive prompt not supported in this environment";
|
|
45
|
+
readonly emptyInput: (field: string) => string;
|
|
46
|
+
readonly invalidCharacters: (field: string) => string;
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/utils/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,eAAO,MAAM,QAAQ,cAAc,CAAC;AACpC,eAAO,MAAM,WAAW,UAAU,CAAC;AACnC,eAAO,MAAM,eAAe,sBAAsB,CAAC;AACnD,eAAO,MAAM,gBAAgB,gBAAgB,CAAC;AAE9C;;GAEG;AACH,eAAO,MAAM,aAAa;;;;;iCAKJ,MAAM;CAClB,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,gBAAgB;2BACb,MAAM;6BACJ,MAAM;6BACN,MAAM;+BACJ,MAAM,QAAQ,MAAM;;CAE9B,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,cAAc;qCACD,MAAM;;;;;;kCAMT,MAAM;;;2CAGG,MAAM;uCAEV,MAAM;;;iCAGZ,MAAM;wCACC,MAAM;CACzB,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Application constants
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ERROR_MESSAGES = exports.SUCCESS_MESSAGES = exports.HELP_MESSAGES = exports.CONFIG_FILE_NAME = exports.CONFIG_DIR_NAME = exports.APP_VERSION = exports.APP_NAME = void 0;
|
|
7
|
+
exports.APP_NAME = 'aliasmate';
|
|
8
|
+
exports.APP_VERSION = '1.2.0';
|
|
9
|
+
exports.CONFIG_DIR_NAME = '.config/aliasmate';
|
|
10
|
+
exports.CONFIG_FILE_NAME = 'config.json';
|
|
11
|
+
/**
|
|
12
|
+
* Help messages
|
|
13
|
+
*/
|
|
14
|
+
exports.HELP_MESSAGES = {
|
|
15
|
+
noCommands: 'No saved commands found.',
|
|
16
|
+
useSaveOrPrev: 'Use "aliasmate save" or "aliasmate prev <name>" to save a command',
|
|
17
|
+
useList: 'Use "aliasmate list" to see all saved commands',
|
|
18
|
+
invalidName: 'Name cannot contain spaces',
|
|
19
|
+
emptyValue: (field) => `${field} cannot be empty`,
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Success messages
|
|
23
|
+
*/
|
|
24
|
+
exports.SUCCESS_MESSAGES = {
|
|
25
|
+
saved: (name) => `Saved command as "${name}"`,
|
|
26
|
+
deleted: (name) => `Deleted command "${name}"`,
|
|
27
|
+
updated: (name) => `Updated command "${name}"`,
|
|
28
|
+
exported: (count, path) => `Exported ${count} command(s) to ${path}`,
|
|
29
|
+
importComplete: 'Import complete',
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Error messages
|
|
33
|
+
*/
|
|
34
|
+
exports.ERROR_MESSAGES = {
|
|
35
|
+
commandNotFound: (name) => `No saved command found with name "${name}"`,
|
|
36
|
+
couldNotSave: 'Could not save command',
|
|
37
|
+
couldNotDelete: 'Could not delete command',
|
|
38
|
+
couldNotUpdate: 'Could not update command',
|
|
39
|
+
couldNotRead: 'Could not read config file',
|
|
40
|
+
couldNotWrite: 'Could not write to file',
|
|
41
|
+
fileNotFound: (path) => `File not found: ${path}`,
|
|
42
|
+
invalidJson: 'Could not parse file. Make sure it is valid JSON.',
|
|
43
|
+
invalidFormat: 'Invalid file format. Expected an "aliases" object.',
|
|
44
|
+
invalidAliasStructure: (name) => `Invalid alias structure for "${name}". Missing required fields (command, directory).`,
|
|
45
|
+
directoryNotFound: (path) => `Directory does not exist: ${path}`,
|
|
46
|
+
historyNotAvailable: 'Could not retrieve previous command from history.',
|
|
47
|
+
interactiveNotSupported: 'Interactive prompt not supported in this environment',
|
|
48
|
+
emptyInput: (field) => `${field} cannot be empty`,
|
|
49
|
+
invalidCharacters: (field) => `${field} contains invalid characters`,
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/utils/constants.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAE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CAAC,6BAA6B,IAAI,EAAE;IACxE,mBAAmB,EAAE,mDAAmD;IACxE,uBAAuB,EAAE,sDAAsD;IAC/E,UAAU,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC,GAAG,KAAK,kBAAkB;IACzD,iBAAiB,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC,GAAG,KAAK,8BAA8B;CACpE,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom error class for AliasMate specific errors
|
|
3
|
+
*/
|
|
4
|
+
export declare class AliasMateError extends Error {
|
|
5
|
+
readonly code?: string | undefined;
|
|
6
|
+
constructor(message: string, code?: string | undefined);
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Exit codes for the CLI
|
|
10
|
+
*/
|
|
11
|
+
export declare enum ExitCode {
|
|
12
|
+
Success = 0,
|
|
13
|
+
GeneralError = 1,
|
|
14
|
+
InvalidInput = 2,
|
|
15
|
+
FileNotFound = 3,
|
|
16
|
+
PermissionDenied = 4
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Display an error message and exit with the appropriate code
|
|
20
|
+
*/
|
|
21
|
+
export declare function exitWithError(message: string, exitCode?: ExitCode): never;
|
|
22
|
+
/**
|
|
23
|
+
* Handle errors consistently across commands
|
|
24
|
+
*/
|
|
25
|
+
export declare function handleError(error: unknown, context?: string): never;
|
|
26
|
+
/**
|
|
27
|
+
* Check if error is an inquirer TTY error
|
|
28
|
+
*/
|
|
29
|
+
export declare function isInquirerTTYError(error: unknown): boolean;
|
|
30
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/utils/errors.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,qBAAa,cAAe,SAAQ,KAAK;aAGrB,IAAI,CAAC,EAAE,MAAM;gBAD7B,OAAO,EAAE,MAAM,EACC,IAAI,CAAC,EAAE,MAAM,YAAA;CAKhC;AAED;;GAEG;AACH,oBAAY,QAAQ;IAClB,OAAO,IAAI;IACX,YAAY,IAAI;IAChB,YAAY,IAAI;IAChB,YAAY,IAAI;IAChB,gBAAgB,IAAI;CACrB;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,GAAE,QAAgC,GAAG,KAAK,CAGhG;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,KAAK,CAWnE;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAO1D"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ExitCode = exports.AliasMateError = void 0;
|
|
7
|
+
exports.exitWithError = exitWithError;
|
|
8
|
+
exports.handleError = handleError;
|
|
9
|
+
exports.isInquirerTTYError = isInquirerTTYError;
|
|
10
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
11
|
+
/**
|
|
12
|
+
* Custom error class for AliasMate specific errors
|
|
13
|
+
*/
|
|
14
|
+
class AliasMateError extends Error {
|
|
15
|
+
constructor(message, code) {
|
|
16
|
+
super(message);
|
|
17
|
+
this.code = code;
|
|
18
|
+
this.name = 'AliasMateError';
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.AliasMateError = AliasMateError;
|
|
22
|
+
/**
|
|
23
|
+
* Exit codes for the CLI
|
|
24
|
+
*/
|
|
25
|
+
var ExitCode;
|
|
26
|
+
(function (ExitCode) {
|
|
27
|
+
ExitCode[ExitCode["Success"] = 0] = "Success";
|
|
28
|
+
ExitCode[ExitCode["GeneralError"] = 1] = "GeneralError";
|
|
29
|
+
ExitCode[ExitCode["InvalidInput"] = 2] = "InvalidInput";
|
|
30
|
+
ExitCode[ExitCode["FileNotFound"] = 3] = "FileNotFound";
|
|
31
|
+
ExitCode[ExitCode["PermissionDenied"] = 4] = "PermissionDenied";
|
|
32
|
+
})(ExitCode || (exports.ExitCode = ExitCode = {}));
|
|
33
|
+
/**
|
|
34
|
+
* Display an error message and exit with the appropriate code
|
|
35
|
+
*/
|
|
36
|
+
function exitWithError(message, exitCode = ExitCode.GeneralError) {
|
|
37
|
+
console.error(chalk_1.default.red('Error:'), message);
|
|
38
|
+
process.exit(exitCode);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Handle errors consistently across commands
|
|
42
|
+
*/
|
|
43
|
+
function handleError(error, context) {
|
|
44
|
+
if (error instanceof AliasMateError) {
|
|
45
|
+
exitWithError(error.message);
|
|
46
|
+
}
|
|
47
|
+
if (error instanceof Error) {
|
|
48
|
+
const message = context ? `${context}: ${error.message}` : error.message;
|
|
49
|
+
exitWithError(message);
|
|
50
|
+
}
|
|
51
|
+
exitWithError('An unknown error occurred');
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Check if error is an inquirer TTY error
|
|
55
|
+
*/
|
|
56
|
+
function isInquirerTTYError(error) {
|
|
57
|
+
return (typeof error === 'object' &&
|
|
58
|
+
error !== null &&
|
|
59
|
+
'isTtyError' in error &&
|
|
60
|
+
error.isTtyError === true);
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/utils/errors.ts"],"names":[],"mappings":";;;;;;AA6BA,sCAGC;AAKD,kCAWC;AAKD,gDAOC;AA5DD,kDAA0B;AAE1B;;GAEG;AACH,MAAa,cAAe,SAAQ,KAAK;IACvC,YACE,OAAe,EACC,IAAa;QAE7B,KAAK,CAAC,OAAO,CAAC,CAAC;QAFC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
+
* Result of a command execution
|
|
3
|
+
*/
|
|
1
4
|
export interface ExecutionResult {
|
|
5
|
+
/** Whether the command executed successfully */
|
|
2
6
|
success: boolean;
|
|
7
|
+
/** Standard output (may be empty when using stdio: 'inherit') */
|
|
3
8
|
stdout: string;
|
|
9
|
+
/** Standard error or error message */
|
|
4
10
|
stderr: string;
|
|
11
|
+
/** Exit code of the command (if available) */
|
|
12
|
+
exitCode?: number;
|
|
5
13
|
}
|
|
6
14
|
/**
|
|
7
15
|
* Execute a command in a specific directory
|
|
8
|
-
*
|
|
16
|
+
* Uses execa with shell mode for cross-platform compatibility
|
|
17
|
+
*
|
|
18
|
+
* @param command - The shell command to execute
|
|
19
|
+
* @param cwd - The working directory to execute the command in
|
|
20
|
+
* @returns A promise that resolves with the execution result
|
|
21
|
+
* @throws {Error} If the directory doesn't exist
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```ts
|
|
25
|
+
* const result = await executeCommand('npm install', '/path/to/project');
|
|
26
|
+
* if (result.success) {
|
|
27
|
+
* console.log('Installation successful');
|
|
28
|
+
* }
|
|
29
|
+
* ```
|
|
9
30
|
*/
|
|
10
31
|
export declare function executeCommand(command: string, cwd: string): Promise<ExecutionResult>;
|
|
11
32
|
//# sourceMappingURL=executor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../src/utils/executor.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../src/utils/executor.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,gDAAgD;IAChD,OAAO,EAAE,OAAO,CAAC;IACjB,iEAAiE;IACjE,MAAM,EAAE,MAAM,CAAC;IACf,sCAAsC;IACtC,MAAM,EAAE,MAAM,CAAC;IACf,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CA4C3F"}
|
package/dist/utils/executor.js
CHANGED
|
@@ -42,34 +42,59 @@ const path = __importStar(require("path"));
|
|
|
42
42
|
const fs = __importStar(require("fs"));
|
|
43
43
|
/**
|
|
44
44
|
* Execute a command in a specific directory
|
|
45
|
-
*
|
|
45
|
+
* Uses execa with shell mode for cross-platform compatibility
|
|
46
|
+
*
|
|
47
|
+
* @param command - The shell command to execute
|
|
48
|
+
* @param cwd - The working directory to execute the command in
|
|
49
|
+
* @returns A promise that resolves with the execution result
|
|
50
|
+
* @throws {Error} If the directory doesn't exist
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```ts
|
|
54
|
+
* const result = await executeCommand('npm install', '/path/to/project');
|
|
55
|
+
* if (result.success) {
|
|
56
|
+
* console.log('Installation successful');
|
|
57
|
+
* }
|
|
58
|
+
* ```
|
|
46
59
|
*/
|
|
47
60
|
async function executeCommand(command, cwd) {
|
|
61
|
+
// Validate inputs
|
|
62
|
+
if (!command || !command.trim()) {
|
|
63
|
+
throw new Error('Command cannot be empty');
|
|
64
|
+
}
|
|
65
|
+
// Resolve the directory path
|
|
66
|
+
const resolvedCwd = path.resolve(cwd);
|
|
67
|
+
// Check if directory exists
|
|
68
|
+
if (!fs.existsSync(resolvedCwd)) {
|
|
69
|
+
throw new Error(`Directory does not exist: ${resolvedCwd}`);
|
|
70
|
+
}
|
|
71
|
+
// Check if it's actually a directory
|
|
72
|
+
const stats = fs.statSync(resolvedCwd);
|
|
73
|
+
if (!stats.isDirectory()) {
|
|
74
|
+
throw new Error(`Path is not a directory: ${resolvedCwd}`);
|
|
75
|
+
}
|
|
48
76
|
try {
|
|
49
|
-
// Resolve the directory path
|
|
50
|
-
const resolvedCwd = path.resolve(cwd);
|
|
51
|
-
// Check if directory exists
|
|
52
|
-
if (!fs.existsSync(resolvedCwd)) {
|
|
53
|
-
throw new Error(`Directory does not exist: ${resolvedCwd}`);
|
|
54
|
-
}
|
|
55
77
|
// Execute the command using the user's shell
|
|
56
78
|
// stdio: 'inherit' allows real-time output to terminal
|
|
57
79
|
await (0, execa_1.default)(command, {
|
|
58
80
|
shell: true,
|
|
59
81
|
cwd: resolvedCwd,
|
|
60
|
-
stdio: 'inherit'
|
|
82
|
+
stdio: 'inherit',
|
|
61
83
|
});
|
|
62
84
|
return {
|
|
63
85
|
success: true,
|
|
64
86
|
stdout: '',
|
|
65
|
-
stderr: ''
|
|
87
|
+
stderr: '',
|
|
88
|
+
exitCode: 0,
|
|
66
89
|
};
|
|
67
90
|
}
|
|
68
91
|
catch (error) {
|
|
92
|
+
const execaError = error;
|
|
69
93
|
return {
|
|
70
94
|
success: false,
|
|
71
|
-
stdout:
|
|
72
|
-
stderr:
|
|
95
|
+
stdout: execaError.stdout || '',
|
|
96
|
+
stderr: execaError.stderr || execaError.message,
|
|
97
|
+
exitCode: execaError.exitCode,
|
|
73
98
|
};
|
|
74
99
|
}
|
|
75
100
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../src/utils/executor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../src/utils/executor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCA,wCA4CC;AA/ED,kDAA0B;AAC1B,2CAA6B;AAC7B,uCAAyB;AAgBzB;;;;;;;;;;;;;;;;GAgBG;AACI,KAAK,UAAU,cAAc,CAAC,OAAe,EAAE,GAAW;IAC/D,kBAAkB;IAClB,IAAI,CAAC,OA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2
2
|
* Get the last command from shell history
|
|
3
3
|
*
|
|
4
|
-
* IMPORTANT: This
|
|
5
|
-
*
|
|
4
|
+
* IMPORTANT: This reads from the shell history file, which may not include
|
|
5
|
+
* the most recent commands until the shell writes them.
|
|
6
6
|
*
|
|
7
|
-
* For best results,
|
|
7
|
+
* For best results, configure your shell for immediate history writing:
|
|
8
8
|
* - zsh: Add "setopt INC_APPEND_HISTORY" or "setopt SHARE_HISTORY" to ~/.zshrc
|
|
9
9
|
* - bash: Add "PROMPT_COMMAND='history -a'" to ~/.bashrc
|
|
10
10
|
* - PowerShell (Windows): History is written immediately by default
|
|
11
11
|
*
|
|
12
12
|
* Alternative: Use environment variable ALIASMATE_LAST_CMD passed from parent shell
|
|
13
|
+
*
|
|
14
|
+
* @returns The last command from history, or null if unavailable
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* const lastCmd = getLastCommand();
|
|
19
|
+
* if (lastCmd) {
|
|
20
|
+
* console.log(`Last command was: ${lastCmd}`);
|
|
21
|
+
* }
|
|
22
|
+
* ```
|
|
13
23
|
*/
|
|
14
24
|
export declare function getLastCommand(): string | null;
|
|
15
25
|
/**
|
|
16
26
|
* Get shell-specific configuration instructions for real-time history
|
|
27
|
+
*
|
|
28
|
+
* @returns Instructions formatted for the user's shell
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```ts
|
|
32
|
+
* const instructions = getHistoryConfigInstructions();
|
|
33
|
+
* console.log(`Configure your shell:\n${instructions}`);
|
|
34
|
+
* ```
|
|
17
35
|
*/
|
|
18
36
|
export declare function getHistoryConfigInstructions(): string;
|
|
19
37
|
//# sourceMappingURL=history.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../../src/utils/history.ts"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../../src/utils/history.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,cAAc,IAAI,MAAM,GAAG,IAAI,CA8F9C;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,4BAA4B,IAAI,MAAM,CAsBrD"}
|
package/dist/utils/history.js
CHANGED
|
@@ -41,15 +41,25 @@ const os = __importStar(require("os"));
|
|
|
41
41
|
/**
|
|
42
42
|
* Get the last command from shell history
|
|
43
43
|
*
|
|
44
|
-
* IMPORTANT: This
|
|
45
|
-
*
|
|
44
|
+
* IMPORTANT: This reads from the shell history file, which may not include
|
|
45
|
+
* the most recent commands until the shell writes them.
|
|
46
46
|
*
|
|
47
|
-
* For best results,
|
|
47
|
+
* For best results, configure your shell for immediate history writing:
|
|
48
48
|
* - zsh: Add "setopt INC_APPEND_HISTORY" or "setopt SHARE_HISTORY" to ~/.zshrc
|
|
49
49
|
* - bash: Add "PROMPT_COMMAND='history -a'" to ~/.bashrc
|
|
50
50
|
* - PowerShell (Windows): History is written immediately by default
|
|
51
51
|
*
|
|
52
52
|
* Alternative: Use environment variable ALIASMATE_LAST_CMD passed from parent shell
|
|
53
|
+
*
|
|
54
|
+
* @returns The last command from history, or null if unavailable
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```ts
|
|
58
|
+
* const lastCmd = getLastCommand();
|
|
59
|
+
* if (lastCmd) {
|
|
60
|
+
* console.log(`Last command was: ${lastCmd}`);
|
|
61
|
+
* }
|
|
62
|
+
* ```
|
|
53
63
|
*/
|
|
54
64
|
function getLastCommand() {
|
|
55
65
|
try {
|
|
@@ -90,7 +100,7 @@ function getLastCommand() {
|
|
|
90
100
|
path.join(homeDir, '.zsh_history'),
|
|
91
101
|
path.join(homeDir, '.bash_history'),
|
|
92
102
|
path.join(homeDir, '.sh_history'),
|
|
93
|
-
path.join(homeDir, '.history')
|
|
103
|
+
path.join(homeDir, '.history'),
|
|
94
104
|
];
|
|
95
105
|
for (const file of possibleFiles) {
|
|
96
106
|
if (fs.existsSync(file)) {
|
|
@@ -133,29 +143,33 @@ function getLastCommand() {
|
|
|
133
143
|
}
|
|
134
144
|
/**
|
|
135
145
|
* Get shell-specific configuration instructions for real-time history
|
|
146
|
+
*
|
|
147
|
+
* @returns Instructions formatted for the user's shell
|
|
148
|
+
*
|
|
149
|
+
* @example
|
|
150
|
+
* ```ts
|
|
151
|
+
* const instructions = getHistoryConfigInstructions();
|
|
152
|
+
* console.log(`Configure your shell:\n${instructions}`);
|
|
153
|
+
* ```
|
|
136
154
|
*/
|
|
137
155
|
function getHistoryConfigInstructions() {
|
|
138
156
|
const platform = os.platform();
|
|
139
157
|
const shell = process.env.SHELL || '';
|
|
140
158
|
if (platform === 'win32') {
|
|
141
|
-
return 'PowerShell writes history immediately. If using Git Bash, add to ~/.bashrc:\n' +
|
|
142
|
-
' PROMPT_COMMAND="history -a"';
|
|
159
|
+
return ('PowerShell writes history immediately. If using Git Bash, add to ~/.bashrc:\n' +
|
|
160
|
+
' PROMPT_COMMAND="history -a"');
|
|
143
161
|
}
|
|
144
162
|
else if (shell.includes('zsh')) {
|
|
145
|
-
return 'Add to ~/.zshrc:\n' +
|
|
146
|
-
' setopt INC_APPEND_HISTORY\n' +
|
|
147
|
-
'Then run: source ~/.zshrc';
|
|
163
|
+
return 'Add to ~/.zshrc:\n' + ' setopt INC_APPEND_HISTORY\n' + 'Then run: source ~/.zshrc';
|
|
148
164
|
}
|
|
149
165
|
else if (shell.includes('bash')) {
|
|
150
|
-
return 'Add to ~/.bashrc:\n' +
|
|
151
|
-
' PROMPT_COMMAND="history -a"\n' +
|
|
152
|
-
'Then run: source ~/.bashrc';
|
|
166
|
+
return 'Add to ~/.bashrc:\n' + ' PROMPT_COMMAND="history -a"\n' + 'Then run: source ~/.bashrc';
|
|
153
167
|
}
|
|
154
168
|
else if (shell.includes('fish')) {
|
|
155
169
|
return 'Fish writes history immediately by default';
|
|
156
170
|
}
|
|
157
|
-
return 'Configure your shell to write history immediately.\n' +
|
|
171
|
+
return ('Configure your shell to write history immediately.\n' +
|
|
158
172
|
'For bash: Add PROMPT_COMMAND="history -a" to ~/.bashrc\n' +
|
|
159
|
-
'For zsh: Add "setopt INC_APPEND_HISTORY" to ~/.zshrc';
|
|
173
|
+
'For zsh: Add "setopt INC_APPEND_HISTORY" to ~/.zshrc');
|
|
160
174
|
}
|
|
161
175
|
//# sourceMappingURL=history.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"history.js","sourceRoot":"","sources":["../../src/utils/history.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"history.js","sourceRoot":"","sources":["../../src/utils/history.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,wCA8FC;AAaD,oEAsBC;AA5JD,uCAAyB;AACzB,2CAA6B;AAC7B,uCAAyB;AAEzB;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,SAAgB,cAAc;IAC5B,IAAI,CAAC;QACH,2DAA2D;QAC3D,sEAAsE;QACtE,IAAI,OAAO,CAAC,GAAG,CAAC,kBAAkB,EAAE,CAAC;YACnC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,IAAI,EAAE,CAAC;YAClD,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC;gBACxC,OAAO,GAAG,CAAC;YACb,CAAC;QACH,CAAC;QAED,MAAM,OAAO,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC;QAC7B,MAAM,QAAQ,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC;QAC/B,IAAI,WAAW,GAAkB,IAAI,CAAC;QAEtC,qDAAqD;QACrD,IAAI,QAAQ,KAAK,OAAO,EAAE,CAAC;YACzB,6BAA6B;YAC7B,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAC7B,OAAO,EACP,SAAS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qD;QACrD,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED;;;;;;;;;;GAUG;AACH,SAAgB,4BAA4B;IAC1C,MAAM,QAAQ,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC;IAC/B,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC;IAEtC,IAAI,QAAQ,KAAK,OAAO,EAAE,CAAC;QACzB,OAAO,CACL,+EAA+E;YAC/E,+BAA+B,CAChC,CAAC;IACJ,CAAC;SAAM,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QACjC,OAAO,oBAAoB,GAAG,+BAA+B,GAAG,2BAA2B,CAAC;IAC9F,CAAC;SAAM,IAAI,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QAClC,OAAO,qBAAqB,GAAG,iCAAiC,GAAG,4BAA4B,CAAC;IAClG,CAAC;SAAM,IAAI,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QAClC,OAAO,4CAA4C,CAAC;IACtD,CAAC;IAED,OAAO,CACL,sDAAsD;QACtD,0DAA0D;QAC1D,sDAAsD,CACvD,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generate LLM.txt content with all AliasMate features and documentation
|
|
3
|
+
*/
|
|
4
|
+
export declare function generateLLMContent(): string;
|
|
5
|
+
/**
|
|
6
|
+
* Create llm.txt file in the specified directory
|
|
7
|
+
* @param targetDir - The directory where llm.txt should be created
|
|
8
|
+
* @returns The full path to the created file
|
|
9
|
+
*/
|
|
10
|
+
export declare function createLLMFile(targetDir: string): string;
|
|
11
|
+
/**
|
|
12
|
+
* Get the default LLM command configuration
|
|
13
|
+
* This command will be auto-created during onboarding
|
|
14
|
+
*/
|
|
15
|
+
export declare function getDefaultLLMCommand(): {
|
|
16
|
+
name: string;
|
|
17
|
+
command: string;
|
|
18
|
+
directory: string;
|
|
19
|
+
pathMode: 'current';
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=llm-generator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"llm-generator.d.ts","sourceRoot":"","sources":["../../src/utils/llm-generator.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CA4Q3C;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAOvD;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,SAAS,CAAA;CAAE,CAOhH"}
|