@bobschlowinskii/clicraft 0.4.0 ā 0.4.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.
- package/CHANGELOG.md +11 -0
- package/README.md +8 -5
- package/commands/auth.js +3 -0
- package/commands/config.js +3 -0
- package/commands/create.js +3 -0
- package/commands/info.js +3 -0
- package/commands/install.js +3 -0
- package/commands/launch.js +3 -0
- package/commands/search.js +3 -0
- package/commands/uninstall.js +3 -0
- package/commands/upgrade.js +3 -0
- package/commands/version.js +3 -0
- package/docs/index.md +4 -1
- package/docs/installation.md +12 -9
- package/helpers/post-command.js +22 -0
- package/helpers/versions.js +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [0.4.1] - 2026-01-24
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- **Published to npm**
|
|
10
|
+
- Package available as `@bobschlowinskii/clicraft`
|
|
11
|
+
- Install globally with `npm install -g @bobschlowinskii/clicraft`
|
|
12
|
+
- **Added Auto-update checking**
|
|
13
|
+
- *disable by setting `checkUpdates` to false in `~/.clicraft/settings/`*
|
|
14
|
+
|
|
5
15
|
## [0.4.0] - 2026-01-22
|
|
6
16
|
|
|
7
17
|
### Added
|
|
@@ -19,6 +29,7 @@ All notable changes to this project will be documented in this file.
|
|
|
19
29
|
- Token status (valid/expired) shown for each account
|
|
20
30
|
- Automatic migration from legacy `auth.json` format
|
|
21
31
|
|
|
32
|
+
|
|
22
33
|
### Changed
|
|
23
34
|
|
|
24
35
|
- **Auth Commands Restructured**
|
package/README.md
CHANGED
|
@@ -12,14 +12,19 @@ Unlike other PMs or Launchers, CLIcraft can do both! Simply type a few commands
|
|
|
12
12
|
- š® **Create Instances** - Set up new Minecraft client or server instances with Fabric or Forge
|
|
13
13
|
- š **Search Mods** - Find mods on Modrinth with filters for version, loader, and more
|
|
14
14
|
- š¦ **Install Mods** - Download and install mods directly to your instance
|
|
15
|
-
-
|
|
15
|
+
- ā¬ļø **Upgrade** - Update mods, mod loader, or Minecraft version
|
|
16
16
|
- ā¹ļø **Instance Info** - View detailed information about your instances
|
|
17
|
-
-
|
|
17
|
+
- š **Microsoft Login** - Authenticate with your Microsoft account to play online
|
|
18
18
|
- š **Launch Game** - Start Minecraft directly from the terminal
|
|
19
19
|
|
|
20
20
|
## Installation
|
|
21
21
|
|
|
22
|
-
###
|
|
22
|
+
### NPM Package (Recommended)
|
|
23
|
+
```bash
|
|
24
|
+
npm install -g @bobschlowinskii/clicraft
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### From Source
|
|
23
28
|
```bash
|
|
24
29
|
# Clone the repository
|
|
25
30
|
git clone https://github.com/theinfamousben/clicraft.git
|
|
@@ -31,8 +36,6 @@ npm install
|
|
|
31
36
|
# Link globally (optional, for using 'clicraft' command anywhere)
|
|
32
37
|
npm link
|
|
33
38
|
```
|
|
34
|
-
### Install NPM Package
|
|
35
|
-
**npm package coming soon!**
|
|
36
39
|
|
|
37
40
|
|
|
38
41
|
## Requirements
|
package/commands/auth.js
CHANGED
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
performAuthentication,
|
|
17
17
|
refreshAccountAuth
|
|
18
18
|
} from '../helpers/auth/microsoft.js';
|
|
19
|
+
import { callPostCommandActions } from '../helpers/post-command.js';
|
|
19
20
|
|
|
20
21
|
// Migrate from legacy auth.json on first run
|
|
21
22
|
migrateFromLegacy();
|
|
@@ -412,6 +413,8 @@ export async function authCommand(action, args, options) {
|
|
|
412
413
|
await status(action, options);
|
|
413
414
|
break;
|
|
414
415
|
}
|
|
416
|
+
|
|
417
|
+
callPostCommandActions();
|
|
415
418
|
}
|
|
416
419
|
|
|
417
420
|
// Legacy exports for backward compatibility
|
package/commands/config.js
CHANGED
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
requireConfig,
|
|
20
20
|
parseValue
|
|
21
21
|
} from '../helpers/utils.js';
|
|
22
|
+
import { callPostCommandActions } from '../helpers/post-command.js';
|
|
22
23
|
|
|
23
24
|
// Show current CLI settings
|
|
24
25
|
async function showSettings() {
|
|
@@ -351,6 +352,8 @@ export async function configCommand(action, args, options) {
|
|
|
351
352
|
console.log(chalk.gray(' clear-game-settings - Clear saved game settings'));
|
|
352
353
|
break;
|
|
353
354
|
}
|
|
355
|
+
|
|
356
|
+
callPostCommandActions();
|
|
354
357
|
}
|
|
355
358
|
|
|
356
359
|
export default { configCommand };
|
package/commands/create.js
CHANGED
|
@@ -27,6 +27,7 @@ import {
|
|
|
27
27
|
downloadAssets
|
|
28
28
|
} from '../helpers/minecraft.js';
|
|
29
29
|
import { FORGE_MAVEN } from '../helpers/constants.js';
|
|
30
|
+
import { callPostCommandActions } from '../helpers/post-command.js';
|
|
30
31
|
|
|
31
32
|
const execAsync = promisify(exec);
|
|
32
33
|
|
|
@@ -529,6 +530,8 @@ export async function createInstance(options) {
|
|
|
529
530
|
console.error(error);
|
|
530
531
|
}
|
|
531
532
|
}
|
|
533
|
+
|
|
534
|
+
callPostCommandActions();
|
|
532
535
|
}
|
|
533
536
|
|
|
534
537
|
export default { createInstance };
|
package/commands/info.js
CHANGED
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
formatDate,
|
|
10
10
|
getDirSize
|
|
11
11
|
} from '../helpers/utils.js';
|
|
12
|
+
import { callPostCommandActions } from '../helpers/post-command.js';
|
|
12
13
|
|
|
13
14
|
export async function instanceInfo(options) {
|
|
14
15
|
const instancePath = getInstancePath(options);
|
|
@@ -108,6 +109,8 @@ export async function instanceInfo(options) {
|
|
|
108
109
|
}
|
|
109
110
|
|
|
110
111
|
console.log();
|
|
112
|
+
|
|
113
|
+
callPostCommandActions();
|
|
111
114
|
}
|
|
112
115
|
|
|
113
116
|
export default { instanceInfo };
|
package/commands/install.js
CHANGED
|
@@ -3,6 +3,7 @@ import fs from 'fs';
|
|
|
3
3
|
import path from 'path';
|
|
4
4
|
import { downloadFile, loadConfig, saveConfig, getInstancePath, requireConfig } from '../helpers/utils.js';
|
|
5
5
|
import { getProject, getProjectVersions } from '../helpers/modrinth.js';
|
|
6
|
+
import { callPostCommandActions } from '../helpers/post-command.js';
|
|
6
7
|
|
|
7
8
|
export async function installMod(modSlug, options) {
|
|
8
9
|
const instancePath = getInstancePath(options);
|
|
@@ -125,6 +126,8 @@ export async function installMod(modSlug, options) {
|
|
|
125
126
|
console.error(error);
|
|
126
127
|
}
|
|
127
128
|
}
|
|
129
|
+
|
|
130
|
+
callPostCommandActions();
|
|
128
131
|
}
|
|
129
132
|
|
|
130
133
|
export default { installMod };
|
package/commands/launch.js
CHANGED
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
requireConfig,
|
|
12
12
|
mavenToPath
|
|
13
13
|
} from '../helpers/utils.js';
|
|
14
|
+
import { callPostCommandActions } from '../helpers/post-command.js';
|
|
14
15
|
|
|
15
16
|
// Find Java executable
|
|
16
17
|
function findJava() {
|
|
@@ -291,6 +292,8 @@ export async function launchInstance(options) {
|
|
|
291
292
|
console.error(error);
|
|
292
293
|
}
|
|
293
294
|
}
|
|
295
|
+
|
|
296
|
+
callPostCommandActions();
|
|
294
297
|
}
|
|
295
298
|
|
|
296
299
|
export default { launchInstance };
|
package/commands/search.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import chalk from 'chalk';
|
|
2
2
|
import { searchMods as searchModrinth } from '../helpers/modrinth.js';
|
|
3
3
|
import { formatDownloads } from '../helpers/utils.js';
|
|
4
|
+
import { callPostCommandActions } from '../helpers/post-command.js';
|
|
4
5
|
|
|
5
6
|
export async function searchMods(query, options) {
|
|
6
7
|
if (!query) {
|
|
@@ -45,6 +46,8 @@ export async function searchMods(query, options) {
|
|
|
45
46
|
console.error(error);
|
|
46
47
|
}
|
|
47
48
|
}
|
|
49
|
+
|
|
50
|
+
callPostCommandActions();
|
|
48
51
|
}
|
|
49
52
|
|
|
50
53
|
export default { searchMods };
|
package/commands/uninstall.js
CHANGED
|
@@ -4,6 +4,7 @@ import path from 'path';
|
|
|
4
4
|
import inquirer from 'inquirer';
|
|
5
5
|
import { loadConfig, saveConfig, getInstancePath, requireConfig } from '../helpers/utils.js';
|
|
6
6
|
import { findMod } from '../helpers/modrinth.js';
|
|
7
|
+
import { callPostCommandActions } from '../helpers/post-command.js';
|
|
7
8
|
|
|
8
9
|
export async function uninstallMod(modSlug, options) {
|
|
9
10
|
const instancePath = getInstancePath(options);
|
|
@@ -89,6 +90,8 @@ async function uninstallSingleMod(instancePath, config, modSlug, options) {
|
|
|
89
90
|
console.error(error);
|
|
90
91
|
}
|
|
91
92
|
}
|
|
93
|
+
|
|
94
|
+
callPostCommandActions();
|
|
92
95
|
}
|
|
93
96
|
|
|
94
97
|
export default { uninstallMod };
|
package/commands/upgrade.js
CHANGED
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
} from '../helpers/utils.js';
|
|
17
17
|
import { getProjectVersions } from '../helpers/modrinth.js';
|
|
18
18
|
import { MOJANG_VERSION_MANIFEST, FABRIC_META, FABRIC_MAVEN } from '../helpers/constants.js';
|
|
19
|
+
import { callPostCommandActions } from '../helpers/post-command.js';
|
|
19
20
|
|
|
20
21
|
const CONFIG_VERSION = version;
|
|
21
22
|
|
|
@@ -338,6 +339,8 @@ export async function upgrade(modName, options) {
|
|
|
338
339
|
console.error(error);
|
|
339
340
|
}
|
|
340
341
|
}
|
|
342
|
+
|
|
343
|
+
callPostCommandActions();
|
|
341
344
|
}
|
|
342
345
|
|
|
343
346
|
export default { upgrade };
|
package/commands/version.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import chalk from 'chalk';
|
|
2
2
|
import version from '../helpers/getv.js';
|
|
3
|
+
import { callPostCommandActions } from '../helpers/post-command.js';
|
|
3
4
|
|
|
4
5
|
const art = "\n" +
|
|
5
6
|
" _____ _ _____ __ _ \n" +
|
|
@@ -18,4 +19,6 @@ const output = (`
|
|
|
18
19
|
|
|
19
20
|
export function showVersion() {
|
|
20
21
|
console.log(output);
|
|
22
|
+
|
|
23
|
+
callPostCommandActions();
|
|
21
24
|
}
|
package/docs/index.md
CHANGED
|
@@ -27,6 +27,9 @@ CLIcraft is a command-line tool that simplifies managing Minecraft instances and
|
|
|
27
27
|
## š Quick Start
|
|
28
28
|
|
|
29
29
|
```bash
|
|
30
|
+
# Install CLIcraft
|
|
31
|
+
npm install -g @bobschlowinskii/clicraft
|
|
32
|
+
|
|
30
33
|
# Create a new instance
|
|
31
34
|
clicraft create
|
|
32
35
|
|
|
@@ -51,7 +54,7 @@ clicraft launch
|
|
|
51
54
|
- [`create`](commands/create.md) - Create a new Minecraft instance
|
|
52
55
|
- [`search`](commands/search.md) - Search for mods on Modrinth
|
|
53
56
|
- [`install`](commands/install.md) - Install mods to your instance
|
|
54
|
-
- [`
|
|
57
|
+
- [`auth`](commands/auth.md) - Manage Microsoft accounts (login, logout, switch)
|
|
55
58
|
- [`launch`](commands/launch.md) - Launch your Minecraft instance
|
|
56
59
|
- [`info`](commands/info.md) - View instance information
|
|
57
60
|
- [`upgrade`](commands/upgrade.md) - Upgrade mods and loaders
|
package/docs/installation.md
CHANGED
|
@@ -26,17 +26,19 @@ java --version
|
|
|
26
26
|
|
|
27
27
|
## š¦ Installation Methods
|
|
28
28
|
|
|
29
|
-
### Method 1: NPM Package (
|
|
29
|
+
### Method 1: NPM Package (Recommended)
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
Install CLIcraft globally via npm:
|
|
32
32
|
|
|
33
33
|
```bash
|
|
34
|
-
npm install -g clicraft
|
|
34
|
+
npm install -g @bobschlowinskii/clicraft
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
+
This is the easiest and recommended way to install CLIcraft.
|
|
38
|
+
|
|
37
39
|
### Method 2: Clone from Source
|
|
38
40
|
|
|
39
|
-
|
|
41
|
+
Alternatively, you can install from source:
|
|
40
42
|
|
|
41
43
|
```bash
|
|
42
44
|
# Clone the repository
|
|
@@ -70,7 +72,8 @@ This should display the current version of CLIcraft.
|
|
|
70
72
|
|
|
71
73
|
CLIcraft stores configuration files in the following locations:
|
|
72
74
|
|
|
73
|
-
- **
|
|
75
|
+
- **CLI settings**: `~/.clicraft/settings.json`
|
|
76
|
+
- **Authentication accounts**: `~/.clicraft/auth/accounts.json`
|
|
74
77
|
- **Instance configuration**: `mcconfig.json` (in each instance directory)
|
|
75
78
|
|
|
76
79
|
These files are created automatically when you use CLIcraft for the first time.
|
|
@@ -85,10 +88,10 @@ git pull origin main
|
|
|
85
88
|
npm install
|
|
86
89
|
```
|
|
87
90
|
|
|
88
|
-
### If installed via npm
|
|
91
|
+
### If installed via npm:
|
|
89
92
|
|
|
90
93
|
```bash
|
|
91
|
-
npm update -g clicraft
|
|
94
|
+
npm update -g @bobschlowinskii/clicraft
|
|
92
95
|
```
|
|
93
96
|
|
|
94
97
|
## šļø Uninstalling
|
|
@@ -101,10 +104,10 @@ npm unlink clicraft
|
|
|
101
104
|
|
|
102
105
|
Then delete the cloned repository folder.
|
|
103
106
|
|
|
104
|
-
### If installed via npm
|
|
107
|
+
### If installed via npm:
|
|
105
108
|
|
|
106
109
|
```bash
|
|
107
|
-
npm uninstall -g clicraft
|
|
110
|
+
npm uninstall -g @bobschlowinskii/clicraft
|
|
108
111
|
```
|
|
109
112
|
|
|
110
113
|
To also remove configuration files:
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { loadSettings } from "./config";
|
|
2
|
+
|
|
3
|
+
async function checkForUpdates() {
|
|
4
|
+
const packageInfo = await fetchJson('https://registry.npmjs.org/@bobschlowinskii/clicraft');
|
|
5
|
+
const latestVersion = packageInfo['dist-tags'].latest;
|
|
6
|
+
const currentVersion = version;
|
|
7
|
+
|
|
8
|
+
if (latestVersion !== currentVersion) {
|
|
9
|
+
console.log(chalk.yellow(`\nā A new CLIcraft version is available (v${latestVersion})`));
|
|
10
|
+
console.log(chalk.gray(' Run ') + chalk.cyan('npm install -g @bobschlowinskii/clicraft') + chalk.gray(' to update.\n'));
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function callPostCommandActions() {
|
|
17
|
+
const settings = loadSettings();
|
|
18
|
+
|
|
19
|
+
if (settings.checkUpdates) {
|
|
20
|
+
checkForUpdates();
|
|
21
|
+
}
|
|
22
|
+
}
|
package/helpers/versions.js
CHANGED