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.
Files changed (77) hide show
  1. package/CHANGELOG.md +109 -0
  2. package/README.md +126 -2
  3. package/dist/cli.js +52 -15
  4. package/dist/cli.js.map +1 -1
  5. package/dist/commands/delete.d.ts +12 -0
  6. package/dist/commands/delete.d.ts.map +1 -1
  7. package/dist/commands/delete.js +29 -8
  8. package/dist/commands/delete.js.map +1 -1
  9. package/dist/commands/edit.d.ts +13 -0
  10. package/dist/commands/edit.d.ts.map +1 -1
  11. package/dist/commands/edit.js +50 -23
  12. package/dist/commands/edit.js.map +1 -1
  13. package/dist/commands/export.d.ts +17 -0
  14. package/dist/commands/export.d.ts.map +1 -1
  15. package/dist/commands/export.js +42 -7
  16. package/dist/commands/export.js.map +1 -1
  17. package/dist/commands/import.d.ts +21 -0
  18. package/dist/commands/import.d.ts.map +1 -1
  19. package/dist/commands/import.js +93 -48
  20. package/dist/commands/import.js.map +1 -1
  21. package/dist/commands/list.d.ts +20 -0
  22. package/dist/commands/list.d.ts.map +1 -1
  23. package/dist/commands/list.js +66 -5
  24. package/dist/commands/list.js.map +1 -1
  25. package/dist/commands/prev.d.ts +14 -1
  26. package/dist/commands/prev.d.ts.map +1 -1
  27. package/dist/commands/prev.js +41 -13
  28. package/dist/commands/prev.js.map +1 -1
  29. package/dist/commands/run.d.ts +16 -1
  30. package/dist/commands/run.d.ts.map +1 -1
  31. package/dist/commands/run.js +30 -10
  32. package/dist/commands/run.js.map +1 -1
  33. package/dist/commands/save.d.ts +15 -1
  34. package/dist/commands/save.d.ts.map +1 -1
  35. package/dist/commands/save.js +64 -33
  36. package/dist/commands/save.js.map +1 -1
  37. package/dist/commands/search.d.ts +19 -0
  38. package/dist/commands/search.d.ts.map +1 -0
  39. package/dist/commands/search.js +113 -0
  40. package/dist/commands/search.js.map +1 -0
  41. package/dist/storage/index.d.ts +34 -7
  42. package/dist/storage/index.d.ts.map +1 -1
  43. package/dist/storage/index.js +55 -11
  44. package/dist/storage/index.js.map +1 -1
  45. package/dist/utils/constants.d.ts +48 -0
  46. package/dist/utils/constants.d.ts.map +1 -0
  47. package/dist/utils/constants.js +51 -0
  48. package/dist/utils/constants.js.map +1 -0
  49. package/dist/utils/errors.d.ts +30 -0
  50. package/dist/utils/errors.d.ts.map +1 -0
  51. package/dist/utils/errors.js +62 -0
  52. package/dist/utils/errors.js.map +1 -0
  53. package/dist/utils/executor.d.ts +22 -1
  54. package/dist/utils/executor.d.ts.map +1 -1
  55. package/dist/utils/executor.js +36 -11
  56. package/dist/utils/executor.js.map +1 -1
  57. package/dist/utils/history.d.ts +21 -3
  58. package/dist/utils/history.d.ts.map +1 -1
  59. package/dist/utils/history.js +28 -14
  60. package/dist/utils/history.js.map +1 -1
  61. package/dist/utils/llm-generator.d.ts +21 -0
  62. package/dist/utils/llm-generator.d.ts.map +1 -0
  63. package/dist/utils/llm-generator.js +337 -0
  64. package/dist/utils/llm-generator.js.map +1 -0
  65. package/dist/utils/onboarding.d.ts +10 -0
  66. package/dist/utils/onboarding.d.ts.map +1 -0
  67. package/dist/utils/onboarding.js +201 -0
  68. package/dist/utils/onboarding.js.map +1 -0
  69. package/dist/utils/paths.d.ts +39 -1
  70. package/dist/utils/paths.d.ts.map +1 -1
  71. package/dist/utils/paths.js +56 -1
  72. package/dist/utils/paths.js.map +1 -1
  73. package/dist/utils/prompts.d.ts +56 -0
  74. package/dist/utils/prompts.d.ts.map +1 -0
  75. package/dist/utils/prompts.js +51 -0
  76. package/dist/utils/prompts.js.map +1 -0
  77. package/package.json +22 -6
@@ -0,0 +1,337 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.generateLLMContent = generateLLMContent;
37
+ exports.createLLMFile = createLLMFile;
38
+ exports.getDefaultLLMCommand = getDefaultLLMCommand;
39
+ const fs = __importStar(require("fs"));
40
+ const path = __importStar(require("path"));
41
+ const constants_1 = require("./constants");
42
+ /**
43
+ * Generate LLM.txt content with all AliasMate features and documentation
44
+ */
45
+ function generateLLMContent() {
46
+ return `# AliasMate - Terminal Command Management CLI
47
+
48
+ Version: ${constants_1.APP_VERSION}
49
+ Official Tool: ${constants_1.APP_NAME}
50
+
51
+ ## Overview
52
+
53
+ AliasMate is a powerful CLI utility that saves, manages, and re-runs shell commands with their working directories. It helps developers save time, reduce errors, and boost productivity by eliminating the need to retype complex commands or remember their exact locations.
54
+
55
+ ## Core Capabilities
56
+
57
+ ### 1. Command Storage
58
+ - Save any shell command with a memorable name
59
+ - Store the working directory where the command should execute
60
+ - Preserve metadata (creation date, last modified)
61
+ - Support for complex multi-line commands and scripts
62
+
63
+ ### 2. Command Execution
64
+ - Run saved commands from anywhere in the filesystem
65
+ - Automatic directory switching to the saved location
66
+ - Option to override execution directory (use current or saved path)
67
+ - Support for both absolute and relative path overrides
68
+
69
+ ### 3. Command Management
70
+ - List all saved commands with full details
71
+ - Search commands by name, command text, or directory
72
+ - Edit existing commands interactively
73
+ - Delete unwanted commands
74
+ - Export/import commands for backup and team sharing
75
+
76
+ ## Available Commands
77
+
78
+ ### aliasmate prev <name>
79
+ Save the previous command from shell history.
80
+ - Automatically captures the last executed command
81
+ - Saves current working directory
82
+ - Example: \`aliasmate prev build\`
83
+
84
+ ### aliasmate run <name> [path]
85
+ Execute a saved command.
86
+ - Runs in saved directory by default
87
+ - Optional path parameter to override directory
88
+ - Supports path mode (saved vs current directory)
89
+ - Example: \`aliasmate run build\` or \`aliasmate run build .\`
90
+
91
+ ### aliasmate save
92
+ Interactively create a new saved command.
93
+ - Prompts for command name
94
+ - Prompts for command to execute
95
+ - Prompts for working directory
96
+ - Prompts for path mode preference
97
+ - Example: \`aliasmate save\`
98
+
99
+ ### aliasmate list (alias: ls)
100
+ Display all saved commands.
101
+ - Shows command name, actual command, and directory
102
+ - Displays path mode for each command
103
+ - Color-coded output for readability
104
+ - Example: \`aliasmate list\`
105
+
106
+ ### aliasmate search <query> (alias: find)
107
+ Search for commands by keyword.
108
+ - Searches in command name, command text, and directory path
109
+ - Case-insensitive matching
110
+ - Example: \`aliasmate search deploy\`
111
+
112
+ ### aliasmate edit <name>
113
+ Modify an existing command.
114
+ - Interactive prompts with current values
115
+ - Update command text, directory, or path mode
116
+ - Example: \`aliasmate edit build\`
117
+
118
+ ### aliasmate delete <name> (alias: rm)
119
+ Remove a saved command.
120
+ - Permanently deletes the command
121
+ - Example: \`aliasmate delete old-build\`
122
+
123
+ ### aliasmate export <file>
124
+ Export all commands to a JSON file.
125
+ - Backup your commands
126
+ - Share with team members
127
+ - Example: \`aliasmate export my-commands.json\`
128
+
129
+ ### aliasmate import <file>
130
+ Import commands from a JSON file.
131
+ - Restore from backup
132
+ - Load teammate's commands
133
+ - Prompts before overwriting existing commands
134
+ - Example: \`aliasmate import my-commands.json\`
135
+
136
+ ### aliasmate llm
137
+ Generate this llm.txt file (default command).
138
+ - Creates comprehensive documentation
139
+ - Can be shared with AI assistants
140
+ - Example: \`aliasmate run llm\`
141
+
142
+ ## Path Mode Feature
143
+
144
+ Each saved command can have a path mode that determines where it executes:
145
+
146
+ ### Saved Directory Mode (default)
147
+ - Command always runs in the directory where it was saved
148
+ - Useful for project-specific commands
149
+ - Example: Build scripts that must run in the project root
150
+
151
+ ### Current Directory Mode
152
+ - Command runs in your current working directory
153
+ - Useful for general-purpose utilities
154
+ - Example: Git commands that work in any repository
155
+
156
+ You can choose the path mode when saving or editing a command.
157
+
158
+ ## Configuration
159
+
160
+ ### Storage Location
161
+ - Config file: \`~/.config/aliasmate/config.json\`
162
+ - Contains all saved commands and their metadata
163
+ - JSON format for easy editing if needed
164
+
165
+ ### Command Alias Structure
166
+ Each command contains:
167
+ - \`command\`: The shell command to execute
168
+ - \`directory\`: The saved working directory path
169
+ - \`pathMode\`: Either "saved" or "current"
170
+ - \`createdAt\`: ISO 8601 timestamp
171
+ - \`updatedAt\`: ISO 8601 timestamp
172
+
173
+ ## Use Cases
174
+
175
+ ### Development Workflows
176
+ - Save complex build commands: \`aliasmate prev build-prod\`
177
+ - Run test suites: \`aliasmate prev test-integration\`
178
+ - Deploy applications: \`aliasmate prev deploy-staging\`
179
+
180
+ ### Multi-Project Management
181
+ - Switch between projects easily
182
+ - Run project-specific commands without navigating
183
+ - Maintain consistent workflows across projects
184
+
185
+ ### Team Collaboration
186
+ - Export team workflows: \`aliasmate export team-commands.json\`
187
+ - Share best practices and scripts
188
+ - Onboard new team members quickly
189
+
190
+ ### DevOps and Automation
191
+ - Save deployment scripts with correct paths
192
+ - Manage multiple environment configurations
193
+ - Quick access to frequently used operations
194
+
195
+ ## Best Practices
196
+
197
+ 1. **Descriptive Names**: Use clear, memorable names for commands
198
+ - Good: \`deploy-prod\`, \`test-unit\`, \`start-server\`
199
+ - Avoid: \`cmd1\`, \`x\`, \`temp\`
200
+
201
+ 2. **Path Mode Selection**: Choose the right mode for each command
202
+ - Use "saved" for project-specific commands
203
+ - Use "current" for general utilities
204
+
205
+ 3. **Regular Backups**: Export commands periodically
206
+ - \`aliasmate export ~/backups/aliases-\$(date +%Y%m%d).json\`
207
+
208
+ 4. **Team Sharing**: Maintain a shared command repository
209
+ - Version control your command exports
210
+ - Document complex commands
211
+
212
+ 5. **Command Organization**: Use prefixes for grouping
213
+ - \`test-unit\`, \`test-integration\`, \`test-e2e\`
214
+ - \`deploy-dev\`, \`deploy-staging\`, \`deploy-prod\`
215
+
216
+ ## Integration with AI Assistants
217
+
218
+ This llm.txt file is designed to help AI assistants understand AliasMate's full capabilities. When asking an AI for help with AliasMate:
219
+
220
+ 1. Share this file for complete context
221
+ 2. Mention specific commands you're working with
222
+ 3. Describe your workflow or use case
223
+ 4. Ask for command suggestions or optimizations
224
+
225
+ ## Troubleshooting
226
+
227
+ ### Command Not Found
228
+ - Run \`aliasmate list\` to see available commands
229
+ - Check spelling of command name
230
+ - Verify command was saved successfully
231
+
232
+ ### Directory Not Found
233
+ - Ensure the saved directory still exists
234
+ - Use path override to run in different location
235
+ - Edit command to update directory: \`aliasmate edit <name>\`
236
+
237
+ ### Command Execution Fails
238
+ - Verify command syntax is correct
239
+ - Check if required tools/dependencies are installed
240
+ - Ensure directory permissions are correct
241
+
242
+ ## Technical Details
243
+
244
+ - Written in TypeScript
245
+ - Cross-platform (Linux, macOS, Windows)
246
+ - Node.js 14.0.0 or higher required
247
+ - Dependencies: chalk, commander, execa, inquirer
248
+
249
+ ## Getting Help
250
+
251
+ - View all commands: \`aliasmate --help\`
252
+ - View command help: \`aliasmate <command> --help\`
253
+ - GitHub Issues: Report bugs or request features
254
+ - Version info: \`aliasmate --version\`
255
+
256
+ ## Example Workflows
257
+
258
+ ### Frontend Development
259
+ \`\`\`bash
260
+ # Save development server
261
+ npm run dev
262
+ aliasmate prev dev
263
+
264
+ # Save production build
265
+ npm run build
266
+ aliasmate prev build
267
+
268
+ # Save test suite
269
+ npm test
270
+ aliasmate prev test
271
+
272
+ # Run from anywhere
273
+ aliasmate run dev
274
+ aliasmate run build
275
+ aliasmate run test
276
+ \`\`\`
277
+
278
+ ### Backend API
279
+ \`\`\`bash
280
+ # Save API server
281
+ npm start
282
+ aliasmate prev api
283
+
284
+ # Save database migrations
285
+ npm run migrate
286
+ aliasmate prev migrate
287
+
288
+ # Save seed data
289
+ npm run seed
290
+ aliasmate prev seed
291
+ \`\`\`
292
+
293
+ ### DevOps
294
+ \`\`\`bash
295
+ # Save deployment scripts
296
+ ./scripts/deploy.sh production
297
+ aliasmate prev deploy-prod
298
+
299
+ # Save log viewing
300
+ tail -f /var/log/app.log
301
+ aliasmate prev logs
302
+
303
+ # Save health checks
304
+ curl http://localhost:3000/health
305
+ aliasmate prev health-check
306
+ \`\`\`
307
+
308
+ ---
309
+
310
+ Generated by AliasMate v${constants_1.APP_VERSION}
311
+ For more information, visit: https://github.com/aliasmate/aliasmate
312
+ `;
313
+ }
314
+ /**
315
+ * Create llm.txt file in the specified directory
316
+ * @param targetDir - The directory where llm.txt should be created
317
+ * @returns The full path to the created file
318
+ */
319
+ function createLLMFile(targetDir) {
320
+ const content = generateLLMContent();
321
+ const filePath = path.join(targetDir, 'llm.txt');
322
+ fs.writeFileSync(filePath, content, 'utf8');
323
+ return filePath;
324
+ }
325
+ /**
326
+ * Get the default LLM command configuration
327
+ * This command will be auto-created during onboarding
328
+ */
329
+ function getDefaultLLMCommand() {
330
+ return {
331
+ name: 'llm',
332
+ command: `cat > llm.txt << 'ALIASMATE_LLM_EOF'\n${generateLLMContent()}\nALIASMATE_LLM_EOF\necho "✓ Created llm.txt in $(pwd)"`,
333
+ directory: process.cwd(),
334
+ pathMode: 'current', // Run in current directory so users can create llm.txt anywhere
335
+ };
336
+ }
337
+ //# sourceMappingURL=llm-generator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"llm-generator.js","sourceRoot":"","sources":["../../src/utils/llm-generator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,gDA4QC;AAOD,sCAOC;AAMD,oDAOC;AA9SD,uCAAyB;AACzB,2CAA6B;AAC7B,2CAAoD;AAEpD;;GAEG;AACH,SAAgB,kBAAkB;IAChC,OAAO;;WAEE,uBAAW;iBACL,oBAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAqQC,uBAAW;;CAEpC,CAAC;AACF,CAAC;AAED;;;;GAIG;AACH,SAAgB,aAAa,CAAC,SAAiB;IAC7C,MAAM,OAAO,GAAG,kBAAkB,EAAE,CAAC;IACrC,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IAEjD,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IAE5C,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;;GAGG;AACH,SAAgB,oBAAoB;IAClC,OAAO;QACL,IAAI,EAAE,KAAK;QACX,OAAO,EAAE,yCAAyC,kBAAkB,EAAE,yDAAyD;QAC/H,SAAS,EAAE,OAAO,CAAC,GAAG,EAAE;QACxB,QAAQ,EAAE,SAAS,EAAE,gEAAgE;KACtF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Check if this is a first install or upgrade, and show appropriate onboarding
3
+ * @returns true if onboarding was shown, false otherwise
4
+ */
5
+ export declare function checkAndShowOnboarding(): boolean;
6
+ /**
7
+ * Check if user has completed onboarding
8
+ */
9
+ export declare function hasCompletedOnboarding(): boolean;
10
+ //# sourceMappingURL=onboarding.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"onboarding.d.ts","sourceRoot":"","sources":["../../src/utils/onboarding.ts"],"names":[],"mappings":"AA6IA;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI,OAAO,CAoChD;AAED;;GAEG;AACH,wBAAgB,sBAAsB,IAAI,OAAO,CAGhD"}
@@ -0,0 +1,201 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __importDefault = (this && this.__importDefault) || function (mod) {
36
+ return (mod && mod.__esModule) ? mod : { "default": mod };
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.checkAndShowOnboarding = checkAndShowOnboarding;
40
+ exports.hasCompletedOnboarding = hasCompletedOnboarding;
41
+ const fs = __importStar(require("fs"));
42
+ const path = __importStar(require("path"));
43
+ const chalk_1 = __importDefault(require("chalk"));
44
+ const storage_1 = require("../storage");
45
+ const constants_1 = require("./constants");
46
+ const ONBOARDING_FILE = 'onboarding.json';
47
+ /**
48
+ * Get the path to the onboarding state file
49
+ */
50
+ function getOnboardingPath() {
51
+ return path.join((0, storage_1.getConfigDir)(), ONBOARDING_FILE);
52
+ }
53
+ /**
54
+ * Load onboarding state from disk
55
+ */
56
+ function loadOnboardingState() {
57
+ const onboardingPath = getOnboardingPath();
58
+ if (!fs.existsSync(onboardingPath)) {
59
+ return null;
60
+ }
61
+ try {
62
+ const data = fs.readFileSync(onboardingPath, 'utf8');
63
+ return JSON.parse(data);
64
+ }
65
+ catch {
66
+ return null;
67
+ }
68
+ }
69
+ /**
70
+ * Save onboarding state to disk
71
+ */
72
+ function saveOnboardingState(state) {
73
+ const onboardingPath = getOnboardingPath();
74
+ try {
75
+ fs.writeFileSync(onboardingPath, JSON.stringify(state, null, 2), 'utf8');
76
+ }
77
+ catch (error) {
78
+ // Silently fail - onboarding is not critical
79
+ }
80
+ }
81
+ /**
82
+ * Display the welcome message for first-time users
83
+ */
84
+ function showWelcomeMessage() {
85
+ console.log();
86
+ console.log(chalk_1.default.bold.cyan('🎉 Welcome to AliasMate! 🎉'));
87
+ console.log();
88
+ console.log(chalk_1.default.white('Thanks for installing AliasMate - your terminal productivity companion!'));
89
+ console.log();
90
+ console.log(chalk_1.default.bold.green('Why AliasMate?'));
91
+ console.log(chalk_1.default.gray(' • Save complex commands with one simple command'));
92
+ console.log(chalk_1.default.gray(' • Never lose track of useful commands again'));
93
+ console.log(chalk_1.default.gray(' • Execute commands in their correct directories automatically'));
94
+ console.log(chalk_1.default.gray(' • Share your workflows with your team'));
95
+ console.log();
96
+ }
97
+ /**
98
+ * Display a quick tour of the main features
99
+ */
100
+ function showQuickTour() {
101
+ console.log(chalk_1.default.bold.yellow('⚡ Quick Tour - How It Works:'));
102
+ console.log();
103
+ console.log(chalk_1.default.bold('1️⃣ Save Commands'));
104
+ console.log(chalk_1.default.gray(' After running any command, save it:'));
105
+ console.log(chalk_1.default.cyan(' $ npm run build'));
106
+ console.log(chalk_1.default.cyan(' $ aliasmate prev build'));
107
+ console.log(chalk_1.default.gray(' ✓ Saves the command with its working directory'));
108
+ console.log();
109
+ console.log(chalk_1.default.bold('2️⃣ Run Anywhere'));
110
+ console.log(chalk_1.default.gray(' Execute saved commands from any location:'));
111
+ console.log(chalk_1.default.cyan(' $ aliasmate run build'));
112
+ console.log(chalk_1.default.gray(' ✓ Runs in the correct directory automatically'));
113
+ console.log();
114
+ console.log(chalk_1.default.bold('3️⃣ Manage Easily'));
115
+ console.log(chalk_1.default.cyan(' $ aliasmate list ') + chalk_1.default.gray('# View all saved commands'));
116
+ console.log(chalk_1.default.cyan(' $ aliasmate search test ') + chalk_1.default.gray('# Find specific commands'));
117
+ console.log(chalk_1.default.cyan(' $ aliasmate edit build ') + chalk_1.default.gray('# Modify saved commands'));
118
+ console.log();
119
+ console.log(chalk_1.default.bold('4️⃣ Share & Backup'));
120
+ console.log(chalk_1.default.cyan(' $ aliasmate export my-commands.json'));
121
+ console.log(chalk_1.default.cyan(' $ aliasmate import my-commands.json'));
122
+ console.log(chalk_1.default.gray(' ✓ Share workflows with your team'));
123
+ console.log();
124
+ console.log(chalk_1.default.bold('5️⃣ LLM Integration'));
125
+ console.log(chalk_1.default.gray(' A default "llm" command has been created for you:'));
126
+ console.log(chalk_1.default.cyan(' $ aliasmate run llm'));
127
+ console.log(chalk_1.default.gray(' ✓ Generates llm.txt with all AliasMate features'));
128
+ console.log(chalk_1.default.gray(' ✓ Share this file with AI assistants for better help'));
129
+ console.log();
130
+ }
131
+ /**
132
+ * Display upgrade message when version changes
133
+ */
134
+ function showUpgradeMessage(oldVersion, newVersion) {
135
+ console.log();
136
+ console.log(chalk_1.default.bold.green(`🎊 AliasMate upgraded from v${oldVersion} to v${newVersion}!`));
137
+ console.log();
138
+ console.log(chalk_1.default.white("What's new:"));
139
+ console.log(chalk_1.default.gray(' • Path mode option: Choose between saved directory or current directory'));
140
+ console.log(chalk_1.default.gray(' • Default "llm" command for LLM integration'));
141
+ console.log(chalk_1.default.gray(' • Enhanced onboarding experience'));
142
+ console.log();
143
+ console.log(chalk_1.default.yellow('Run') + chalk_1.default.cyan(' aliasmate list ') + chalk_1.default.yellow('to see your commands'));
144
+ console.log();
145
+ }
146
+ /**
147
+ * Display helpful tips after onboarding
148
+ */
149
+ function showHelpfulTips() {
150
+ console.log(chalk_1.default.bold.magenta('💡 Pro Tips:'));
151
+ console.log(chalk_1.default.gray(' • Use') + chalk_1.default.cyan(' aliasmate save ') + chalk_1.default.gray('for interactive command creation'));
152
+ console.log(chalk_1.default.gray(' • Combine with') + chalk_1.default.cyan(' aliasmate run <name> . ') + chalk_1.default.gray('to run in current directory'));
153
+ console.log(chalk_1.default.gray(' • Export commands to backup or share with teammates'));
154
+ console.log();
155
+ console.log(chalk_1.default.gray('Need help? Run') + chalk_1.default.cyan(' aliasmate --help'));
156
+ console.log();
157
+ console.log(chalk_1.default.bold.green('Happy commanding! 🚀'));
158
+ console.log();
159
+ }
160
+ /**
161
+ * Check if this is a first install or upgrade, and show appropriate onboarding
162
+ * @returns true if onboarding was shown, false otherwise
163
+ */
164
+ function checkAndShowOnboarding() {
165
+ const state = loadOnboardingState();
166
+ const currentVersion = constants_1.APP_VERSION;
167
+ // First install
168
+ if (!state) {
169
+ showWelcomeMessage();
170
+ showQuickTour();
171
+ showHelpfulTips();
172
+ const newState = {
173
+ version: currentVersion,
174
+ lastShownVersion: currentVersion,
175
+ hasSeenWelcome: true,
176
+ installDate: new Date().toISOString(),
177
+ };
178
+ saveOnboardingState(newState);
179
+ return true;
180
+ }
181
+ // Version upgrade
182
+ if (state.version !== currentVersion) {
183
+ showUpgradeMessage(state.version, currentVersion);
184
+ const updatedState = {
185
+ ...state,
186
+ version: currentVersion,
187
+ lastShownVersion: currentVersion,
188
+ };
189
+ saveOnboardingState(updatedState);
190
+ return true;
191
+ }
192
+ return false;
193
+ }
194
+ /**
195
+ * Check if user has completed onboarding
196
+ */
197
+ function hasCompletedOnboarding() {
198
+ const state = loadOnboardingState();
199
+ return state !== null && state.hasSeenWelcome;
200
+ }
201
+ //# sourceMappingURL=onboarding.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"onboarding.js","sourceRoot":"","sources":["../../src/utils/onboarding.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiJA,wDAoCC;AAKD,wDAGC;AA7LD,uCAAyB;AACzB,2CAA6B;AAC7B,kDAA0B;AAC1B,wCAA0C;AAC1C,2CAA0C;AAS1C,MAAM,eAAe,GAAG,iBAAiB,CAAC;AAE1C;;GAEG;AACH,SAAS,iBAAiB;IACxB,OAAO,IAAI,CAAC,IAAI,CAAC,IAAA,sBAAY,GAAE,EAAE,eAAe,CAAC,CAAC;AACpD,CAAC;AAED;;GAEG;AACH,SAAS,mBAAmB;IAC1B,MAAM,cAAc,GAAG,iBAAiB,EAAE,CAAC;IAE3C,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,cAAc,CAAC,EAAE,CAAC;QACnC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,EAAE,CAAC,YAAY,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;QACrD,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAoB,CAAC;IAC7C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED;;G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AAC,eAAK,CAAC,IAAI,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC,CAAC;IACtD,OAAO,CAAC,GAAG,EAAE,CAAC;AAChB,CAAC;AAED;;;GAGG;AACH,SAAgB,sBAAsB;IACpC,MAAM,KAAK,GAAG,mBAAmB,EAAE,CAAC;IACpC,MAAM,cAAc,GAAG,uBAAW,CAAC;IAEnC,gBAAgB;IAChB,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,kBAAkB,EAAE,CAAC;QACrB,aAAa,EAAE,CAAC;QAChB,eAAe,EAAE,CAAC;QAElB,MAAM,QAAQ,GAAoB;YAChC,OAAO,EAAE,cAAc;YACvB,gBAAgB,EAAE,cAAc;YAChC,cAAc,EAAE,IAAI;YACpB,WAAW,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;SACtC,CAAC;QAEF,mBAAmB,CAAC,QAAQ,CAAC,CAAC;QAC9B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,kBAAkB;IAClB,IAAI,KAAK,CAAC,OAAO,KAAK,cAAc,EAAE,CAAC;QACrC,kBAAkB,CAAC,KAAK,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;QAElD,MAAM,YAAY,GAAoB;YACpC,GAAG,KAAK;YACR,OAAO,EAAE,cAAc;YACvB,gBAAgB,EAAE,cAAc;SACjC,CAAC;QAEF,mBAAmB,CAAC,YAAY,CAAC,CAAC;QAClC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;GAEG;AACH,SAAgB,sBAAsB;IACpC,MAAM,KAAK,GAAG,mBAAmB,EAAE,CAAC;IACpC,OAAO,KAAK,KAAK,IAAI,IAAI,KAAK,CAAC,cAAc,CAAC;AAChD,CAAC"}
@@ -1,6 +1,44 @@
1
1
  /**
2
2
  * Resolve a path, handling relative paths, absolute paths, and special cases
3
- * Cross-platform path resolution
3
+ * Works cross-platform (Windows, macOS, Linux)
4
+ *
5
+ * @param inputPath - The path to resolve
6
+ * @param basePath - The base path to resolve relative paths against (defaults to cwd)
7
+ * @returns The resolved absolute path
8
+ *
9
+ * @example
10
+ * ```ts
11
+ * resolvePath('.', '/home/user') // => '/home/user'
12
+ * resolvePath('..', '/home/user') // => '/home'
13
+ * resolvePath('/absolute/path') // => '/absolute/path'
14
+ * resolvePath('relative/path', '/base') // => '/base/relative/path'
15
+ * ```
4
16
  */
5
17
  export declare function resolvePath(inputPath: string, basePath?: string): string;
18
+ /**
19
+ * Validate that a directory exists and is accessible
20
+ *
21
+ * @param dirPath - The directory path to validate
22
+ * @returns true if directory exists and is accessible, false otherwise
23
+ *
24
+ * @example
25
+ * ```ts
26
+ * if (isValidDirectory('/home/user/project')) {
27
+ * console.log('Directory is valid');
28
+ * }
29
+ * ```
30
+ */
31
+ export declare function isValidDirectory(dirPath: string): boolean;
32
+ /**
33
+ * Sanitize a command name by removing invalid characters
34
+ *
35
+ * @param name - The command name to sanitize
36
+ * @returns Sanitized command name
37
+ *
38
+ * @example
39
+ * ```ts
40
+ * sanitizeCommandName('my command!') // => 'my-command'
41
+ * ```
42
+ */
43
+ export declare function sanitizeCommandName(name: string): string;
6
44
  //# sourceMappingURL=paths.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/utils/paths.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAsB,GAAG,MAAM,CAqBvF"}
1
+ {"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/utils/paths.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAsB,GAAG,MAAM,CAqBvF;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAOzD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAMxD"}