@a5gard/asgard 0.0.1

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 (207) hide show
  1. package/.env +2 -0
  2. package/.gitignore copy +6 -0
  3. package/.vscode/ntrsync/.vscode/ocrmnavigator/id.txt +1 -0
  4. package/.vscode/ntrsync/.vscode/ocrmnavigator.code-snippets +3664 -0
  5. package/.vscode/ntrsync/00002_CRM URGENT_todo.md +79 -0
  6. package/.vscode/ntrsync/10005_notes repo url.md +3 -0
  7. package/.vscode/ntrsync/10012_vscode_color_settings.md +133 -0
  8. package/.vscode/ntrsync/10013_Googles Snapchat Upload Hack note.md +11 -0
  9. package/.vscode/ntrsync/10014_APP IDEA - Lawyer CRM.md +229 -0
  10. package/.vscode/ntrsync/10015_APP IDEA - Onlyfans.md +293 -0
  11. package/.vscode/ntrsync/10016_notes repo url.md +3 -0
  12. package/.vscode/ntrsync/10504_adhd symptom.md +3 -0
  13. package/.vscode/ntrsync/10505_APP IDEA - GMAIL.md +39 -0
  14. package/.vscode/ntrsync/10506_container home - build mats.md +18 -0
  15. package/.vscode/ntrsync/10507_cleint facing site meta and loader function.md +25 -0
  16. package/.vscode/ntrsync/10508_Sabaak VSCode 1-8 players - private teams, solo q, duos q.md +11 -0
  17. package/.vscode/ntrsync/10509_schema dump.md +80 -0
  18. package/.vscode/ntrsync/10510_APPT BEACONHILL_reminder.md +7 -0
  19. package/.vscode/ntrsync/10512_clipboard very usefull should use asap within all apps.md +101 -0
  20. package/.vscode/ntrsync/10516_DevStack_todo.md +130 -0
  21. package/.vscode/ntrsync/10517_CRM_todo.md +95 -0
  22. package/.vscode/ntrsync/10518_Catalyst POS_todo.md +73 -0
  23. package/.vscode/ntrsync/10519_Catalyst Software_todo.md +497 -0
  24. package/.vscode/ntrsync/10523_new note.md +6 -0
  25. package/.vscode/ntrsync/10524_New Reminder_reminder.md +5 -0
  26. package/.vscode/ntrsync/10525_Mobile - Notes, To-Dos And Things_todo.md +4 -0
  27. package/.vscode/ntrsync/90002_COMPLETED_todo.md +97 -0
  28. package/.vscode/ntrsync/README.md +1 -0
  29. package/.vscode/ocrmnavigator/id.txt +1 -0
  30. package/.vscode/ocrmnavigator.code-snippets +349 -0
  31. package/.vscode/settings.json +1 -0
  32. package/CHANGELOG.md +6 -0
  33. package/LICENSE.md +21 -0
  34. package/README.md +1612 -0
  35. package/bin/dev.cmd +3 -0
  36. package/bin/dev.js +17 -0
  37. package/bin/run.cmd +3 -0
  38. package/bin/run.js +5 -0
  39. package/config.asgard +8 -0
  40. package/dist/commands/add-source.d.ts +9 -0
  41. package/dist/commands/add-source.d.ts.map +1 -0
  42. package/dist/commands/add-source.js +68 -0
  43. package/dist/commands/add-source.js.map +1 -0
  44. package/dist/commands/baldr.d.ts +5 -0
  45. package/dist/commands/baldr.d.ts.map +1 -0
  46. package/dist/commands/baldr.js +35 -0
  47. package/dist/commands/baldr.js.map +1 -0
  48. package/dist/commands/combine-timelines.d.ts +5 -0
  49. package/dist/commands/combine-timelines.d.ts.map +1 -0
  50. package/dist/commands/combine-timelines.js +53 -0
  51. package/dist/commands/combine-timelines.js.map +1 -0
  52. package/dist/commands/create-project.d.ts +10 -0
  53. package/dist/commands/create-project.d.ts.map +1 -0
  54. package/dist/commands/create-project.js +195 -0
  55. package/dist/commands/create-project.js.map +1 -0
  56. package/dist/commands/create-timeline.d.ts +8 -0
  57. package/dist/commands/create-timeline.d.ts.map +1 -0
  58. package/dist/commands/create-timeline.js +54 -0
  59. package/dist/commands/create-timeline.js.map +1 -0
  60. package/dist/commands/delete-project.d.ts +5 -0
  61. package/dist/commands/delete-project.d.ts.map +1 -0
  62. package/dist/commands/delete-project.js +47 -0
  63. package/dist/commands/delete-project.js.map +1 -0
  64. package/dist/commands/delete-source.d.ts +8 -0
  65. package/dist/commands/delete-source.d.ts.map +1 -0
  66. package/dist/commands/delete-source.js +57 -0
  67. package/dist/commands/delete-source.js.map +1 -0
  68. package/dist/commands/delete-timeline.d.ts +8 -0
  69. package/dist/commands/delete-timeline.d.ts.map +1 -0
  70. package/dist/commands/delete-timeline.js +54 -0
  71. package/dist/commands/delete-timeline.js.map +1 -0
  72. package/dist/commands/delete-version.d.ts +8 -0
  73. package/dist/commands/delete-version.d.ts.map +1 -0
  74. package/dist/commands/delete-version.js +65 -0
  75. package/dist/commands/delete-version.js.map +1 -0
  76. package/dist/commands/download-file.d.ts +17 -0
  77. package/dist/commands/download-file.d.ts.map +1 -0
  78. package/dist/commands/download-file.js +87 -0
  79. package/dist/commands/download-file.js.map +1 -0
  80. package/dist/commands/download-folder.d.ts +18 -0
  81. package/dist/commands/download-folder.d.ts.map +1 -0
  82. package/dist/commands/download-folder.js +111 -0
  83. package/dist/commands/download-folder.js.map +1 -0
  84. package/dist/commands/download-source.d.ts +12 -0
  85. package/dist/commands/download-source.d.ts.map +1 -0
  86. package/dist/commands/download-source.js +46 -0
  87. package/dist/commands/download-source.js.map +1 -0
  88. package/dist/commands/gh-setup.d.ts +7 -0
  89. package/dist/commands/gh-setup.d.ts.map +1 -0
  90. package/dist/commands/gh-setup.js +106 -0
  91. package/dist/commands/gh-setup.js.map +1 -0
  92. package/dist/commands/load-project.d.ts +5 -0
  93. package/dist/commands/load-project.d.ts.map +1 -0
  94. package/dist/commands/load-project.js +56 -0
  95. package/dist/commands/load-project.js.map +1 -0
  96. package/dist/commands/menu.d.ts +5 -0
  97. package/dist/commands/menu.d.ts.map +1 -0
  98. package/dist/commands/menu.js +41 -0
  99. package/dist/commands/menu.js.map +1 -0
  100. package/dist/commands/midgardr.d.ts +5 -0
  101. package/dist/commands/midgardr.d.ts.map +1 -0
  102. package/dist/commands/midgardr.js +24 -0
  103. package/dist/commands/midgardr.js.map +1 -0
  104. package/dist/commands/publish-project.d.ts +5 -0
  105. package/dist/commands/publish-project.d.ts.map +1 -0
  106. package/dist/commands/publish-project.js +102 -0
  107. package/dist/commands/publish-project.js.map +1 -0
  108. package/dist/commands/replace-timeline.d.ts +8 -0
  109. package/dist/commands/replace-timeline.d.ts.map +1 -0
  110. package/dist/commands/replace-timeline.js +63 -0
  111. package/dist/commands/replace-timeline.js.map +1 -0
  112. package/dist/commands/restore-version.d.ts +8 -0
  113. package/dist/commands/restore-version.d.ts.map +1 -0
  114. package/dist/commands/restore-version.js +67 -0
  115. package/dist/commands/restore-version.js.map +1 -0
  116. package/dist/commands/save-project.d.ts +8 -0
  117. package/dist/commands/save-project.d.ts.map +1 -0
  118. package/dist/commands/save-project.js +43 -0
  119. package/dist/commands/save-project.js.map +1 -0
  120. package/dist/commands/set-source.d.ts +9 -0
  121. package/dist/commands/set-source.d.ts.map +1 -0
  122. package/dist/commands/set-source.js +59 -0
  123. package/dist/commands/set-source.js.map +1 -0
  124. package/dist/commands/switch-timeline.d.ts +8 -0
  125. package/dist/commands/switch-timeline.d.ts.map +1 -0
  126. package/dist/commands/switch-timeline.js +61 -0
  127. package/dist/commands/switch-timeline.js.map +1 -0
  128. package/dist/commands/sync-source.d.ts +5 -0
  129. package/dist/commands/sync-source.d.ts.map +1 -0
  130. package/dist/commands/sync-source.js +29 -0
  131. package/dist/commands/sync-source.js.map +1 -0
  132. package/dist/commands/upload-project+++.d.ts +5 -0
  133. package/dist/commands/upload-project+++.d.ts.map +1 -0
  134. package/dist/commands/upload-project+++.js +32 -0
  135. package/dist/commands/upload-project+++.js.map +1 -0
  136. package/dist/commands/upload-project++.d.ts +5 -0
  137. package/dist/commands/upload-project++.d.ts.map +1 -0
  138. package/dist/commands/upload-project++.js +33 -0
  139. package/dist/commands/upload-project++.js.map +1 -0
  140. package/dist/commands/upload-project+.d.ts +5 -0
  141. package/dist/commands/upload-project+.d.ts.map +1 -0
  142. package/dist/commands/upload-project+.js +40 -0
  143. package/dist/commands/upload-project+.js.map +1 -0
  144. package/dist/commands/upload-project.d.ts +5 -0
  145. package/dist/commands/upload-project.d.ts.map +1 -0
  146. package/dist/commands/upload-project.js +29 -0
  147. package/dist/commands/upload-project.js.map +1 -0
  148. package/dist/commands/view-timeline.d.ts +5 -0
  149. package/dist/commands/view-timeline.d.ts.map +1 -0
  150. package/dist/commands/view-timeline.js +39 -0
  151. package/dist/commands/view-timeline.js.map +1 -0
  152. package/dist/commands/view-versions.d.ts +5 -0
  153. package/dist/commands/view-versions.d.ts.map +1 -0
  154. package/dist/commands/view-versions.js +45 -0
  155. package/dist/commands/view-versions.js.map +1 -0
  156. package/dist/git/helpers.d.ts +10 -0
  157. package/dist/git/helpers.d.ts.map +1 -0
  158. package/dist/git/helpers.js +300 -0
  159. package/dist/git/helpers.js.map +1 -0
  160. package/dist/git/sync-repo.d.ts +2 -0
  161. package/dist/git/sync-repo.d.ts.map +1 -0
  162. package/dist/git/sync-repo.js +17 -0
  163. package/dist/git/sync-repo.js.map +1 -0
  164. package/dist/index.d.ts +2 -0
  165. package/dist/index.d.ts.map +1 -0
  166. package/dist/index.js +3 -0
  167. package/dist/index.js.map +1 -0
  168. package/dist/utils/box.d.ts +11 -0
  169. package/dist/utils/box.d.ts.map +1 -0
  170. package/dist/utils/box.js +158 -0
  171. package/dist/utils/box.js.map +1 -0
  172. package/ideas.md +46 -0
  173. package/package.json +53 -0
  174. package/src/commands/add-source.js +72 -0
  175. package/src/commands/baldr.js +38 -0
  176. package/src/commands/combine-timelines.js +65 -0
  177. package/src/commands/create-project.js +216 -0
  178. package/src/commands/create-timeline.js +60 -0
  179. package/src/commands/delete-project.js +54 -0
  180. package/src/commands/delete-source.js +63 -0
  181. package/src/commands/delete-timeline.js +63 -0
  182. package/src/commands/delete-version.js +74 -0
  183. package/src/commands/download-file.js +101 -0
  184. package/src/commands/download-folder.js +123 -0
  185. package/src/commands/download-source.js +51 -0
  186. package/src/commands/gh-setup.js +77 -0
  187. package/src/commands/load-project.js +63 -0
  188. package/src/commands/menu.js +46 -0
  189. package/src/commands/midgardr.js +25 -0
  190. package/src/commands/publish-project.js +167 -0
  191. package/src/commands/replace-timeline.js +76 -0
  192. package/src/commands/restore-version.js +80 -0
  193. package/src/commands/save-project.js +48 -0
  194. package/src/commands/set-source.js +65 -0
  195. package/src/commands/switch-timeline.js +69 -0
  196. package/src/commands/sync-source.js +32 -0
  197. package/src/commands/upload-project+++.js +34 -0
  198. package/src/commands/upload-project++.js +35 -0
  199. package/src/commands/upload-project+.js +47 -0
  200. package/src/commands/upload-project.js +31 -0
  201. package/src/commands/view-timeline.js +43 -0
  202. package/src/commands/view-versions.js +50 -0
  203. package/src/git/helpers.js +333 -0
  204. package/src/git/sync-repo.js +16 -0
  205. package/src/index.js +2 -0
  206. package/src/utils/box.js +282 -0
  207. package/tsconfig.json +23 -0
@@ -0,0 +1,72 @@
1
+ import { Command, Flags } from '@oclif/core';
2
+ import inquirer from 'inquirer';
3
+ import { boxStart, boxDivider, boxEnd, boxLine } from '../utils/box.js';
4
+ import ora from 'ora';
5
+ import { execSync } from 'child_process';
6
+
7
+
8
+ export default class AddSource extends Command {
9
+ static description = 'Add additional remote';
10
+
11
+ static flags = {
12
+ name: Flags.string({ char: 'n', description: 'Remote name' }),
13
+ url: Flags.string({ char: 'u', description: 'Remote URL' })
14
+ };
15
+
16
+ async run() {
17
+ const { flags } = await this.parse(AddSource);
18
+
19
+ let name = flags.name;
20
+ let url = flags.url;
21
+
22
+ if (!name || !url) {
23
+ boxStart('Add Remote Source');
24
+ boxLine('Please provide the following values:');
25
+ boxDivider();
26
+
27
+ const answers = await inquirer.prompt([
28
+ {
29
+ type: 'input',
30
+ name: 'name',
31
+ message: 'Remote name:',
32
+ prefix: '',
33
+ suffix: '',
34
+ default: 'main',
35
+ when: !name
36
+ },
37
+ {
38
+ type: 'input',
39
+ name: 'url',
40
+ message: 'Remote URL:',
41
+ prefix: '',
42
+ suffix: '',
43
+ validate: input => input.length > 0,
44
+ when: !url
45
+ }
46
+ ]);
47
+
48
+ name = name || answers.name;
49
+ url = url || answers.url;
50
+
51
+ boxDivider();
52
+ } else {
53
+ boxStart('Add Remote Source');
54
+ }
55
+ const spinner = ora('Adding remote...').start();
56
+ try {
57
+ try {
58
+ execSync(`git remote add ${name} ${url}`, { stdio: 'inherit' });
59
+ } catch (e) {
60
+ // If it already exists, just update the URL instead of crashing
61
+ execSync(`git remote set-url ${name} ${url}`, { stdio: 'inherit' });
62
+ }
63
+ boxDivider();
64
+ spinner.stop();
65
+ boxEnd(true, `Remote '${name}' added`);
66
+ } catch (error) {
67
+ boxLine(error.message, 'error');
68
+ boxDivider();
69
+ boxEnd(false, 'Failed to add remote');
70
+ }
71
+ }
72
+ }
@@ -0,0 +1,38 @@
1
+ import { Command } from '@oclif/core';
2
+ import { execSync } from 'child_process';
3
+ import fs from 'fs-extra';
4
+ import path from 'path';
5
+ import ora from 'ora';
6
+ import { boxStart, boxDivider, boxEnd, boxLine } from '../utils/box.js';
7
+
8
+ export default class Baldr extends Command {
9
+ static description = 'Install @a5gard/baldr icon library';
10
+
11
+ async run() {
12
+ boxStart('Install Baldr Icons');
13
+
14
+ const cwd = process.cwd();
15
+ const configPath = path.join(cwd, 'config.asgard');
16
+ let packageManager = 'pnpm';
17
+
18
+ if (fs.existsSync(configPath)) {
19
+ const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
20
+ packageManager = config.packageManager || 'pnpm';
21
+ }
22
+
23
+ const spinner = ora('Installing @a5gard/baldr...').start();
24
+
25
+ try {
26
+ execSync(`${packageManager} add @a5gard/baldr`, { cwd, stdio: 'inherit' });
27
+ spinner.stop();
28
+ boxLine('baldr installed successfully', 'success');
29
+ boxDivider();
30
+ boxEnd(true, 'Complete');
31
+ } catch (error) {
32
+ spinner.stop();
33
+ boxLine(error.message, 'error');
34
+ boxDivider();
35
+ boxEnd(false, 'Installation failed');
36
+ }
37
+ }
38
+ }
@@ -0,0 +1,65 @@
1
+ import { Command, Flags } from '@oclif/core';
2
+ import { ux } from '@oclif/core';
3
+ import ora from 'ora';
4
+ import { syncRepo } from '../git/sync-repo.js';
5
+ import { boxStart, boxDivider, boxEnd, boxLine } from '../utils/box.js';
6
+ import { execSync } from 'child_process';
7
+
8
+ export default class CombineTimelines extends Command {
9
+ async run() {
10
+ const cwd = process.cwd();
11
+ boxStart('Combine Timelines');
12
+
13
+ const spinner = ora('Syncing with remote...').start();
14
+ await syncRepo();
15
+ spinner.stop();
16
+
17
+ const { flags } = await this.parse(CombineTimelines);
18
+ let branchName = flags.branch;
19
+
20
+ const loadSpinner = ora('Loading branches...').start();
21
+
22
+ const current = execSync('git branch --show-current', { encoding: 'utf8' }).trim();
23
+
24
+ const branchListRaw = execSync('git branch --format="%(refname:short)"', { encoding: 'utf8' });
25
+ const mergeable = branchListRaw.split('\n').map(b => b.trim()).filter(b => b && b !== current);
26
+
27
+ loadSpinner.stop();
28
+
29
+ if (mergeable.length === 0) {
30
+ boxLine('No branches available to merge', 'warning');
31
+ boxDivider();
32
+ boxEnd(false, 'No merge performed');
33
+ return;
34
+ }
35
+
36
+ if (!branchName) {
37
+ boxLine('Please select a branch to merge:');
38
+ boxDivider();
39
+
40
+ branchName = await ux.select({
41
+ message: `Merge into '${current}'`,
42
+ options: mergeable.map(b => ({ name: b, value: b }))
43
+ });
44
+
45
+ boxDivider();
46
+ }
47
+
48
+ const mergeSpinner = ora('Merging...').start();
49
+
50
+ try {
51
+ execSync(`git merge ${branchName} --no-edit`, { cwd, stdio: 'pipe' });
52
+
53
+ mergeSpinner.stop();
54
+ boxLine(`Merged '${branchName}' into '${current}'`, 'success');
55
+ boxDivider();
56
+ boxEnd(true, 'Merge complete');
57
+ } catch (error) {
58
+ mergeSpinner.stop();
59
+ const msg = error.stdout ? error.stdout.toString() : error.message;
60
+ boxLine(msg, 'error');
61
+ boxDivider();
62
+ boxEnd(false, 'Merge failed');
63
+ }
64
+ }
65
+ }
@@ -0,0 +1,216 @@
1
+ import { Command } from '@oclif/core';
2
+ import { Octokit } from 'octokit';
3
+ import { execSync } from 'child_process';
4
+ import inquirer from 'inquirer';
5
+ import fs from 'fs-extra';
6
+ import path from 'path';
7
+ import ora from 'ora';
8
+ import { getLicenseContent, ensureGitConfig } from '../git/helpers.js';
9
+ import { boxStart, boxDivider, boxEnd, boxLine } from '../utils/box.js';
10
+
11
+ export default class CreateProject extends Command {
12
+ static description = 'Create a new project with GitHub repository';
13
+ static args = [
14
+ {
15
+ name: 'projectName',
16
+ required: false,
17
+ description: 'Name of the project'
18
+ }
19
+ ];
20
+
21
+ async run() {
22
+ await ensureGitConfig();
23
+
24
+ const { args } = await this.parse(CreateProject);
25
+ const cwd = process.cwd();
26
+ const configPath = path.join(cwd, 'config.asgard');
27
+ let config = {};
28
+ let projectName = args.projectName;
29
+ let projectPath;
30
+ let shouldCreateRepo = true;
31
+
32
+ if (fs.existsSync(configPath)) {
33
+ config = fs.readJsonSync(configPath);
34
+ projectName = config.repo || projectName;
35
+ shouldCreateRepo = config.autoPushRepo !== false;
36
+ }
37
+
38
+ if (!projectName) {
39
+ boxStart('Create New Project');
40
+ boxLine('Please provide the following values:');
41
+ boxDivider();
42
+
43
+ const gitUser = execSync('git config user.name', { encoding: 'utf8' }).trim();
44
+
45
+ const answers = await inquirer.prompt([
46
+ {
47
+ type: 'input',
48
+ name: 'projectName',
49
+ message: 'Project name:',
50
+ prefix: '',
51
+ suffix: '',
52
+ validate: input => input.length > 0
53
+ },
54
+ {
55
+ type: 'list',
56
+ name: 'packageManager',
57
+ message: 'Package manager:',
58
+ choices: ['pnpm', 'npm', 'yarn', 'bun'],
59
+ prefix: '',
60
+ suffix: '',
61
+ default: 'pnpm'
62
+ },
63
+ {
64
+ type: 'list',
65
+ name: 'license',
66
+ message: 'License type:',
67
+ choices: ['MIT', 'Apache-2.0', 'GPL-3.0', 'BSD-3-Clause', 'ISC'],
68
+ prefix: '',
69
+ suffix: '',
70
+ default: 'MIT'
71
+ },
72
+ {
73
+ type: 'confirm',
74
+ name: 'icons',
75
+ message: 'Install @a5gard/baldr icons?',
76
+ prefix: '',
77
+ suffix: '',
78
+ default: false
79
+ },
80
+ {
81
+ type: 'list',
82
+ name: 'uiComponents',
83
+ message: 'UI Components installation:',
84
+ choices: ['false', 'full-install', 'full-install-ngin', 'components-and-libs'],
85
+ prefix: '',
86
+ suffix: '',
87
+ default: 'false'
88
+ }
89
+ ]);
90
+
91
+ config = {
92
+ repo: answers.projectName,
93
+ owner: gitUser,
94
+ branch: 'main',
95
+ license: answers.license,
96
+ autoPushRepo: true,
97
+ icons: answers.icons,
98
+ platform: '',
99
+ build: '',
100
+ uiComponents: answers.uiComponents,
101
+ packageManager: answers.packageManager,
102
+ token: process.env.GITHUB_TOKEN
103
+ };
104
+ projectName = answers.projectName;
105
+ boxDivider();
106
+ } else {
107
+ boxStart('Create New Project');
108
+ }
109
+
110
+ projectPath = path.join(cwd, projectName);
111
+ const spinner = ora('Creating project structure...').start();
112
+
113
+ try {
114
+ await fs.ensureDir(projectPath);
115
+
116
+ const packageJson = {
117
+ name: projectName,
118
+ version: '0.0.1',
119
+ description: '',
120
+ main: 'index.js',
121
+ scripts: {
122
+ test: 'echo "Error: no test specified" && exit 1'
123
+ },
124
+ author: config.owner || '',
125
+ license: config.license || 'MIT'
126
+ };
127
+
128
+ await fs.writeJson(path.join(projectPath, 'package.json'), packageJson, { spaces: 2 });
129
+
130
+ const readme = `# ${projectName}\n\nProject created with @a5gard/asgard\n`;
131
+ await fs.writeFile(path.join(projectPath, 'README.md'), readme);
132
+
133
+ const changelog = `# Changelog\n\n## [0.0.1] - ${new Date().toISOString().split('T')[0]}\n- Initial project setup\n`;
134
+ await fs.writeFile(path.join(projectPath, 'CHANGELOG.md'), changelog);
135
+
136
+ await fs.writeFile(path.join(projectPath, '.gitignore'), `node_modules/\n.env\ndist/\n`);
137
+
138
+ const licenseContent = getLicenseContent(config.license || 'MIT', config.owner || '');
139
+ await fs.writeFile(path.join(projectPath, 'LICENSE.md'), licenseContent);
140
+
141
+ await fs.writeFile(path.join(projectPath, '.dev.env'), `LOCAL_DATABASE_URL=""\n`);
142
+ await fs.writeFile(path.join(projectPath, '.env'), `# AUTO-GENERATED\nDATABASE_URL=""\n`);
143
+
144
+ await fs.writeJson(path.join(projectPath, 'config.asgard'), {
145
+ repo: config.repo || projectName,
146
+ owner: config.owner || '',
147
+ branch: 'main',
148
+ license: config.license || 'MIT',
149
+ autoPushRepo: config.autoPushRepo !== false,
150
+ icons: config.icons || false,
151
+ uiComponents: config.uiComponents || 'false',
152
+ packageManager: config.packageManager || 'pnpm'
153
+ }, { spaces: 2 });
154
+
155
+ spinner.stop();
156
+ boxLine('Project structure created', 'success');
157
+
158
+ spinner.text = 'Initializing git repository...';
159
+ spinner.start();
160
+ execSync('git init', { cwd: projectPath });
161
+ execSync('git add .', { cwd: projectPath });
162
+ execSync('git commit -m "Initial commit"', { cwd: projectPath });
163
+ spinner.stop();
164
+ boxLine('Git repository initialized', 'success');
165
+
166
+ if (shouldCreateRepo && config.token) {
167
+ spinner.text = 'Creating GitHub repository...';
168
+ spinner.start();
169
+ const octokit = new Octokit({ auth: config.token });
170
+ const { data } = await octokit.rest.repos.createForAuthenticatedUser({
171
+ name: projectName,
172
+ private: true,
173
+ auto_init: false
174
+ });
175
+ spinner.stop();
176
+ boxLine('GitHub repository created', 'success');
177
+
178
+ spinner.text = 'Pushing to GitHub...';
179
+ spinner.start();
180
+ execSync(`git remote add origin ${data.clone_url}`, { cwd: projectPath });
181
+ execSync('git branch -M main', { cwd: projectPath });
182
+ execSync('git push -u origin main', { cwd: projectPath });
183
+ spinner.stop();
184
+ boxLine(`Pushed to ${data.html_url}`, 'success');
185
+ } else {
186
+ boxLine('Project created locally only', 'info');
187
+ }
188
+
189
+ if (config.icons) {
190
+ spinner.text = 'Installing @a5gard/baldr...';
191
+ spinner.start();
192
+ execSync(`${config.packageManager} add @a5gard/baldr`, { cwd: projectPath });
193
+ spinner.stop();
194
+ boxLine('@a5gard/baldr installed', 'success');
195
+ }
196
+
197
+ if (config.uiComponents && config.uiComponents !== 'false') {
198
+ spinner.text = `Installing UI components...`;
199
+ spinner.start();
200
+ execSync(`${config.packageManager} add @a5gard/ui-${config.uiComponents}`, { cwd: projectPath });
201
+ spinner.stop();
202
+ boxLine(`UI components installed`, 'success');
203
+ }
204
+
205
+ boxDivider();
206
+ boxEnd(true, 'Project created successfully');
207
+
208
+ } catch (error) {
209
+ spinner.stop();
210
+ boxLine(error.message, 'error');
211
+ boxDivider();
212
+ boxEnd(false, 'Project creation failed');
213
+ process.exit(1);
214
+ }
215
+ }
216
+ }
@@ -0,0 +1,60 @@
1
+ import { Command, Flags } from '@oclif/core';
2
+ import { execSync } from 'child_process';
3
+ import inquirer from 'inquirer';
4
+ import ora from 'ora';
5
+ import { syncRepo } from '../git/sync-repo.js';
6
+ import { boxStart, boxDivider, boxEnd, boxLine } from '../utils/box.js';
7
+
8
+ export default class CreateTimeline extends Command {
9
+ static description = 'Create a new branch';
10
+
11
+ static flags = {
12
+ name: Flags.string({ char: 'n', description: 'Branch name'})
13
+ };
14
+
15
+ async run() {
16
+ const cwd = process.cwd();
17
+ boxStart('Create Timeline');
18
+
19
+ const syncSpinner = ora('Syncing with remote...').start();
20
+ await syncRepo();
21
+ syncSpinner.stop();
22
+
23
+ const { flags } = await this.parse(CreateTimeline);
24
+ let name = flags.name;
25
+
26
+ if (!name) {
27
+ boxLine('Please provide the following values:');
28
+ boxDivider();
29
+
30
+ const answers = await inquirer.prompt([
31
+ {
32
+ type: 'input',
33
+ name: 'name',
34
+ message: 'Branch name:',
35
+ prefix: '',
36
+ suffix: '',
37
+ validate: input => input.length > 0
38
+ }
39
+ ]);
40
+ name = answers.name;
41
+ boxDivider();
42
+ }
43
+
44
+ const spinner = ora('Creating branch...').start();
45
+
46
+ try {
47
+ execSync(`git checkout -b ${name}`, { cwd, stdio: 'pipe' });
48
+ spinner.stop();
49
+ boxLine(`Branch '${name}' created`, 'success');
50
+ boxDivider();
51
+ boxEnd(true, 'Complete');
52
+ } catch (error) {
53
+ spinner.stop();
54
+ const msg = error.stderr ? error.stderr.toString() : error.message;
55
+ boxLine(msg, 'error');
56
+ boxDivider();
57
+ boxEnd(false, 'Failed to create branch');
58
+ }
59
+ }
60
+ }
@@ -0,0 +1,54 @@
1
+ import { Command } from '@oclif/core';
2
+ import { execSync } from 'child_process';
3
+ import { ux } from '@oclif/core';
4
+ import chalk from 'chalk';
5
+ import ora from 'ora';
6
+ import { boxStart, boxDivider, boxEnd, boxLine } from '../utils/box.js';
7
+
8
+ export default class DeleteProject extends Command {
9
+ static description = 'Delete a stash';
10
+
11
+ async run() {
12
+ const cwd = process.cwd();
13
+ boxStart('Deleting Project');
14
+ const spinner = ora('Loading stash list...').start();
15
+
16
+ try {
17
+ const stashRaw = execSync('git stash list', { cwd, encoding: 'utf8' }).trim();
18
+ spinner.stop();
19
+
20
+ if (!stashRaw) {
21
+ console.log(chalk.yellow('No stashes found'));
22
+ return;
23
+ }
24
+
25
+ const stashes = stashRaw.split('\n').map((line, index) => {
26
+ return {
27
+ label: line,
28
+ value: index
29
+ };
30
+ });
31
+
32
+ boxLine('Please provide the following values:');
33
+
34
+ const stashIndex = await ux.select({
35
+ message: 'Select stash to delete',
36
+ options: stashes
37
+ });
38
+
39
+ boxDivider();
40
+
41
+ const deleteSpinner = ora('Deleting stash...').start();
42
+ execSync(`git stash drop stash@{${stashIndex}}`, { cwd, stdio: 'pipe' });
43
+
44
+ deleteSpinner.stop();
45
+ boxLine(`Stash deleted`, 'success');
46
+ boxEnd(true, 'Complete');
47
+ } catch (error) {
48
+ spinner.stop();
49
+ const msg = error.stderr ? error.stderr.toString() : error.message;
50
+ boxLine(msg, 'error');
51
+ boxEnd(false, 'Failed to delete stash');
52
+ }
53
+ }
54
+ }
@@ -0,0 +1,63 @@
1
+ import { Command, Flags } from '@oclif/core';
2
+ import { execSync } from 'child_process';
3
+ import { ux } from '@oclif/core';
4
+ import ora from 'ora';
5
+ import { boxStart, boxDivider, boxEnd, boxLine } from '../utils/box.js';
6
+
7
+ export default class DeleteSource extends Command {
8
+ static description = 'Remove a remote';
9
+
10
+ static flags = {
11
+ name: Flags.string({ char: 'n', description: 'Remote name' })
12
+ };
13
+
14
+ async run() {
15
+ const cwd = process.cwd();
16
+ boxStart('Delete Source');
17
+
18
+ const { flags } = await this.parse(DeleteSource);
19
+ let remoteName = flags.name;
20
+
21
+ let remotes = [];
22
+ try {
23
+ const remoteRaw = execSync('git remote', { cwd, encoding: 'utf8' }).trim();
24
+ remotes = remoteRaw ? remoteRaw.split('\n') : [];
25
+ } catch (e) {
26
+ remotes = [];
27
+ }
28
+
29
+ if (remotes.length === 0) {
30
+ boxLine('No remotes found', 'warning');
31
+ boxDivider();
32
+ boxEnd(false, 'No remotes available');
33
+ return;
34
+ }
35
+
36
+ if (!remoteName) {
37
+ boxLine('Please select a remote to delete:');
38
+ boxDivider();
39
+
40
+ remoteName = await ux.select({
41
+ message: 'Select remote to delete',
42
+ options: remotes.map(r => ({ label: r, value: r }))
43
+ });
44
+ boxDivider();
45
+ }
46
+
47
+ const spinner = ora('Removing remote...').start();
48
+
49
+ try {
50
+ execSync(`git remote remove ${remoteName}`, { cwd, stdio: 'pipe' });
51
+ spinner.stop();
52
+ boxLine(`Remote '${remoteName}' removed`, 'success');
53
+ boxDivider();
54
+ boxEnd(true, 'Complete');
55
+ } catch (error) {
56
+ spinner.stop();
57
+ const msg = error.stderr ? error.stderr.toString() : error.message;
58
+ boxLine(msg, 'error');
59
+ boxDivider();
60
+ boxEnd(false, 'Failed to remove remote');
61
+ }
62
+ }
63
+ }
@@ -0,0 +1,63 @@
1
+ import { Command, Flags } from '@oclif/core';
2
+ import { execSync } from 'child_process';
3
+ import { ux } from '@oclif/core';
4
+ import ora from 'ora';
5
+ import { boxStart, boxDivider, boxEnd, boxLine } from '../utils/box.js';
6
+
7
+ export default class DeleteTimeline extends Command {
8
+ static description = 'Delete a branch';
9
+
10
+ static flags = {
11
+ branch: Flags.string({ char: 'b', description: 'Branch name' })
12
+ };
13
+
14
+ async run() {
15
+ const cwd = process.cwd();
16
+ boxStart('Delete Timeline');
17
+
18
+ const { flags } = await this.parse(DeleteTimeline);
19
+ let branchName = flags.branch;
20
+
21
+ const spinner = ora('Loading branches...').start();
22
+
23
+ const current = execSync('git branch --show-current', { cwd, encoding: 'utf8' }).trim();
24
+ const branchListRaw = execSync('git branch --format="%(refname:short)"', { cwd, encoding: 'utf8' });
25
+ const deletable = branchListRaw.split('\n').map(b => b.trim()).filter(b => b && b !== current);
26
+
27
+ spinner.stop();
28
+
29
+ if (deletable.length === 0) {
30
+ boxLine('No branches available to delete', 'warning');
31
+ boxDivider();
32
+ boxEnd(false, 'No deletable branches');
33
+ return;
34
+ }
35
+
36
+ if (!branchName) {
37
+ boxLine('Please select a branch to delete:');
38
+ boxDivider();
39
+
40
+ branchName = await ux.select({
41
+ message: 'Select branch to delete',
42
+ options: deletable.map(b => ({ label: b, value: b }))
43
+ });
44
+ boxDivider();
45
+ }
46
+
47
+ const deleteSpinner = ora('Deleting branch...').start();
48
+
49
+ try {
50
+ execSync(`git branch -d ${branchName}`, { cwd, stdio: 'pipe' });
51
+ deleteSpinner.stop();
52
+ boxLine(`Branch '${branchName}' deleted`, 'success');
53
+ boxDivider();
54
+ boxEnd(true, 'Complete');
55
+ } catch (error) {
56
+ deleteSpinner.stop();
57
+ const msg = error.stderr ? error.stderr.toString() : error.message;
58
+ boxLine(msg, 'error');
59
+ boxDivider();
60
+ boxEnd(false, 'Failed to delete branch');
61
+ }
62
+ }
63
+ }