@bobschlowinskii/clicraft 0.4.3 → 0.4.5
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 +21 -0
- package/commands/config.js +20 -2
- package/commands/create.js +11 -2
- package/commands/install.js +69 -18
- package/commands/launch.js +4 -4
- package/docs/commands/alias.md +27 -28
- package/docs/commands/auth.md +1 -6
- package/docs/commands/config.md +1 -1
- package/docs/commands/create.md +2 -0
- package/docs/commands/install.md +14 -18
- package/docs/configuration.md +10 -58
- package/docs/index.md +0 -24
- package/docs/installation.md +3 -26
- package/helpers/config.js +5 -1
- package/helpers/versions.js +2 -0
- package/index.js +4 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,27 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [0.4.5] - 2026-01-31
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- **Added `force` option to `create` command**
|
|
9
|
+
- Overwrites existing instance if folder already exists in path
|
|
10
|
+
- call with `--force` or `-f`
|
|
11
|
+
- **Added `path` option to `create` command**
|
|
12
|
+
- Specifies a path other than the working directory to install the instance
|
|
13
|
+
- call with `--path` or `-p`
|
|
14
|
+
- **Multi-mod installation support**
|
|
15
|
+
- Install multiple mods in a single command: `clicraft install mod1 mod2 mod3`
|
|
16
|
+
- Shows installation summary when installing multiple mods
|
|
17
|
+
- Tracks success/failure count for batch installations
|
|
18
|
+
|
|
19
|
+
## [0.4.4] - 2026-01-29
|
|
20
|
+
|
|
21
|
+
### Added
|
|
22
|
+
|
|
23
|
+
- **Added config entry for custom JVM args**
|
|
24
|
+
- **Cleaned up the Docs**
|
|
25
|
+
|
|
5
26
|
## [0.4.3] - 2026-01-28
|
|
6
27
|
|
|
7
28
|
### Added
|
package/commands/config.js
CHANGED
|
@@ -50,11 +50,29 @@ async function editSetting(key, value) {
|
|
|
50
50
|
return;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
let parsedValue
|
|
53
|
+
let parsedValue;
|
|
54
|
+
if (value === 'null' || value === 'auto') {
|
|
55
|
+
parsedValue = null;
|
|
56
|
+
} else if (Array.isArray(settings[key])) {
|
|
57
|
+
// Handle array settings (like jvmArgs)
|
|
58
|
+
// Try to parse as JSON array first, otherwise split by comma
|
|
59
|
+
try {
|
|
60
|
+
const jsonParsed = JSON.parse(value);
|
|
61
|
+
parsedValue = Array.isArray(jsonParsed) ? jsonParsed : [value];
|
|
62
|
+
} catch {
|
|
63
|
+
// Split by comma and trim whitespace
|
|
64
|
+
parsedValue = value.split(',').map(v => v.trim()).filter(v => v.length > 0);
|
|
65
|
+
}
|
|
66
|
+
} else {
|
|
67
|
+
parsedValue = parseValue(value);
|
|
68
|
+
}
|
|
69
|
+
|
|
54
70
|
settings[key] = parsedValue;
|
|
55
71
|
saveSettings(settings);
|
|
56
72
|
|
|
57
|
-
|
|
73
|
+
const displayValue = parsedValue === null ? '(auto)' :
|
|
74
|
+
Array.isArray(parsedValue) ? JSON.stringify(parsedValue) : parsedValue;
|
|
75
|
+
console.log(chalk.green(`\n✓ Set ${key} = ${displayValue}`));
|
|
58
76
|
}
|
|
59
77
|
|
|
60
78
|
// Show game settings ignore list
|
package/commands/create.js
CHANGED
|
@@ -482,7 +482,7 @@ export async function createInstance(options) {
|
|
|
482
482
|
message: 'Instance Name:',
|
|
483
483
|
validate: (input) => {
|
|
484
484
|
if (!input.trim()) return 'Instance name is required';
|
|
485
|
-
if (fs.existsSync(input.trim())) return 'A folder with this name already exists';
|
|
485
|
+
if (fs.existsSync(input.trim()) && !options.force) return 'A folder with this name already exists';
|
|
486
486
|
return true;
|
|
487
487
|
}
|
|
488
488
|
}]);
|
|
@@ -526,7 +526,16 @@ export async function createInstance(options) {
|
|
|
526
526
|
loaderVersion = await paginatedSelect('Forge Version:', forgeChoices);
|
|
527
527
|
}
|
|
528
528
|
|
|
529
|
-
const instancePath = path
|
|
529
|
+
const instancePath = options.path
|
|
530
|
+
? path.resolve(options.path) + path.resolve(instanceName.trim())
|
|
531
|
+
: path.resolve(instanceName.trim())
|
|
532
|
+
;
|
|
533
|
+
if (fs.existsSync(instancePath) && !options.force) {
|
|
534
|
+
console.log(chalk.red(`A folder already exists at ${instancePath}. Use --force to overwrite.`));
|
|
535
|
+
return;
|
|
536
|
+
} else if (fs.existsSync(instancePath) && options.force) {
|
|
537
|
+
fs.rmSync(instancePath, { recursive: true, force: true });
|
|
538
|
+
}
|
|
530
539
|
fs.mkdirSync(instancePath, { recursive: true });
|
|
531
540
|
fs.mkdirSync(path.join(instancePath, 'mods'), { recursive: true });
|
|
532
541
|
|
package/commands/install.js
CHANGED
|
@@ -5,12 +5,41 @@ import { downloadFile, loadConfig, saveConfig, getInstancePath, requireConfig }
|
|
|
5
5
|
import { getProject, getProjectVersions } from '../helpers/modrinth.js';
|
|
6
6
|
import { callPostCommandActions } from '../helpers/post-command.js';
|
|
7
7
|
|
|
8
|
-
export async function installMod(
|
|
8
|
+
export async function installMod(modSlugs, options) {
|
|
9
9
|
const instancePath = getInstancePath(options);
|
|
10
10
|
|
|
11
11
|
const config = requireConfig(instancePath);
|
|
12
12
|
if (!config) return;
|
|
13
13
|
|
|
14
|
+
// Handle multiple mods
|
|
15
|
+
const slugs = Array.isArray(modSlugs) ? modSlugs : [modSlugs];
|
|
16
|
+
|
|
17
|
+
let successCount = 0;
|
|
18
|
+
let failCount = 0;
|
|
19
|
+
|
|
20
|
+
for (const modSlug of slugs) {
|
|
21
|
+
const success = await installSingleMod(modSlug, instancePath, config, options);
|
|
22
|
+
if (success) {
|
|
23
|
+
successCount++;
|
|
24
|
+
} else {
|
|
25
|
+
failCount++;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// Show summary if multiple mods were requested
|
|
30
|
+
if (slugs.length > 1) {
|
|
31
|
+
console.log(chalk.cyan('\n📊 Installation Summary:'));
|
|
32
|
+
console.log(chalk.green(` ✅ ${successCount} mod(s) installed successfully`));
|
|
33
|
+
if (failCount > 0) {
|
|
34
|
+
console.log(chalk.red(` ❌ ${failCount} mod(s) failed to install`));
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
callPostCommandActions();
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
async function installSingleMod(modSlug, instancePath, config, options) {
|
|
42
|
+
|
|
14
43
|
console.log(chalk.cyan(`\n📦 Installing "${modSlug}" to ${config.name}...\n`));
|
|
15
44
|
|
|
16
45
|
try {
|
|
@@ -19,12 +48,12 @@ export async function installMod(modSlug, options) {
|
|
|
19
48
|
if (!project) {
|
|
20
49
|
console.log(chalk.red(`Error: Mod "${modSlug}" not found on Modrinth.`));
|
|
21
50
|
console.log(chalk.gray('Use "clicraft search <query>" to find available mods.'));
|
|
22
|
-
return;
|
|
51
|
+
return false;
|
|
23
52
|
}
|
|
24
53
|
|
|
25
54
|
if (project.project_type !== 'mod') {
|
|
26
55
|
console.log(chalk.red(`Error: "${modSlug}" is a ${project.project_type}, not a mod.`));
|
|
27
|
-
return;
|
|
56
|
+
return false;
|
|
28
57
|
}
|
|
29
58
|
|
|
30
59
|
console.log(chalk.gray(`Found: ${project.title}`));
|
|
@@ -44,7 +73,7 @@ export async function installMod(modSlug, options) {
|
|
|
44
73
|
console.log(chalk.gray(`\nAvailable loaders: ${loaders.join(', ')}`));
|
|
45
74
|
console.log(chalk.gray(`Recent game versions: ${gameVersions.join(', ')}`));
|
|
46
75
|
}
|
|
47
|
-
return;
|
|
76
|
+
return false;
|
|
48
77
|
}
|
|
49
78
|
|
|
50
79
|
// Use the latest compatible version
|
|
@@ -53,7 +82,7 @@ export async function installMod(modSlug, options) {
|
|
|
53
82
|
|
|
54
83
|
if (!file) {
|
|
55
84
|
console.log(chalk.red('Error: No downloadable file found for this version.'));
|
|
56
|
-
return;
|
|
85
|
+
return false;
|
|
57
86
|
}
|
|
58
87
|
|
|
59
88
|
// Check if already installed
|
|
@@ -61,7 +90,7 @@ export async function installMod(modSlug, options) {
|
|
|
61
90
|
if (existingMod && !options.force) {
|
|
62
91
|
console.log(chalk.yellow(`\n⚠️ ${project.title} is already installed (version ${existingMod.versionNumber})`));
|
|
63
92
|
console.log(chalk.gray('Use --force to reinstall or update.'));
|
|
64
|
-
return;
|
|
93
|
+
return false;
|
|
65
94
|
}
|
|
66
95
|
|
|
67
96
|
// Create mods folder if needed
|
|
@@ -104,30 +133,52 @@ export async function installMod(modSlug, options) {
|
|
|
104
133
|
// Show dependencies if any
|
|
105
134
|
if (version.dependencies?.length > 0) {
|
|
106
135
|
const requiredDeps = version.dependencies.filter(d => d.dependency_type === 'required');
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
}
|
|
136
|
+
let totalDeps = [];
|
|
137
|
+
let notInstalledDeps = [];
|
|
138
|
+
|
|
139
|
+
for (const dep of requiredDeps) {
|
|
140
|
+
if (dep.project_id) {
|
|
141
|
+
const depProject = await getProject(dep.project_id);
|
|
142
|
+
if (depProject) {
|
|
143
|
+
const isInstalled = config.mods.some(m => m.projectId === dep.project_id);
|
|
144
|
+
// const status = isInstalled ? chalk.green('✓') : chalk.red('✗');
|
|
145
|
+
totalDeps.push({ project: depProject, title: depProject.title, slug: depProject.slug, installed: isInstalled });
|
|
117
146
|
}
|
|
118
147
|
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
for (const dep of totalDeps) {
|
|
151
|
+
if (!dep.installed) {
|
|
152
|
+
notInstalledDeps.push(dep);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
if (notInstalledDeps.length > 0) {
|
|
157
|
+
console.log(chalk.yellow(`\n⚠️ This mod has ${notInstalledDeps.length} dependencies which are not installed:`));
|
|
158
|
+
totalDeps.forEach(dep => {
|
|
159
|
+
if(dep.installed)
|
|
160
|
+
console.log(chalk.green(` - ${dep.title} (${dep.slug})`));
|
|
161
|
+
if(!dep.installed)
|
|
162
|
+
console.log(chalk.yellow(` - ${dep.title} (${dep.slug})`));
|
|
163
|
+
});
|
|
119
164
|
console.log(chalk.gray('\nInstall dependencies with: clicraft install <slug>'));
|
|
120
165
|
}
|
|
166
|
+
|
|
167
|
+
if (notInstalledDeps.length === 0) {
|
|
168
|
+
console.log(chalk.green('\n✅ All dependencies are already installed.'));
|
|
169
|
+
|
|
170
|
+
}
|
|
121
171
|
}
|
|
122
172
|
|
|
173
|
+
return true;
|
|
174
|
+
|
|
123
175
|
} catch (error) {
|
|
124
176
|
console.error(chalk.red('Error installing mod:'), error.message);
|
|
125
177
|
if (options.verbose) {
|
|
126
178
|
console.error(error);
|
|
127
179
|
}
|
|
180
|
+
return false;
|
|
128
181
|
}
|
|
129
|
-
|
|
130
|
-
callPostCommandActions();
|
|
131
182
|
}
|
|
132
183
|
|
|
133
184
|
export default { installMod };
|
package/commands/launch.js
CHANGED
|
@@ -175,7 +175,7 @@ export async function launchInstance(aliasOrOptions, options) {
|
|
|
175
175
|
if (!opts?.offline) {
|
|
176
176
|
auth = await refreshAuth();
|
|
177
177
|
if (!auth) {
|
|
178
|
-
console.log(chalk.yellow('Not logged in. Use "clicraft login" to authenticate.'));
|
|
178
|
+
console.log(chalk.yellow('Not logged in. Use "clicraft auth login" to authenticate.'));
|
|
179
179
|
console.log(chalk.gray('Or use --offline to play offline (if available).'));
|
|
180
180
|
return;
|
|
181
181
|
}
|
|
@@ -255,10 +255,8 @@ export async function launchInstance(aliasOrOptions, options) {
|
|
|
255
255
|
};
|
|
256
256
|
|
|
257
257
|
// Build JVM arguments
|
|
258
|
-
|
|
258
|
+
let jvmArgs = [
|
|
259
259
|
`-Djava.library.path=${nativesPath}`,
|
|
260
|
-
'-Xmx2G',
|
|
261
|
-
'-Xms512M',
|
|
262
260
|
'-XX:+UnlockExperimentalVMOptions',
|
|
263
261
|
'-XX:+UseG1GC',
|
|
264
262
|
'-XX:G1NewSizePercent=20',
|
|
@@ -268,6 +266,8 @@ export async function launchInstance(aliasOrOptions, options) {
|
|
|
268
266
|
'-cp', classpath
|
|
269
267
|
];
|
|
270
268
|
|
|
269
|
+
jvmArgs = [...jvmArgs, ...settings.jvmArgs];
|
|
270
|
+
|
|
271
271
|
const mainClass = versionData.mainClass;
|
|
272
272
|
|
|
273
273
|
// Build game arguments
|
package/docs/commands/alias.md
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
layout: default
|
|
3
|
+
title: alias
|
|
4
|
+
parent: Commands
|
|
5
|
+
nav_order: 10
|
|
6
|
+
description: "Manage Instance Aliases"
|
|
7
|
+
permalink: /commands/alias
|
|
8
|
+
---
|
|
9
|
+
|
|
1
10
|
# Alias Command
|
|
2
11
|
|
|
3
12
|
The `alias` command allows you to create shortcuts for your Minecraft instances, making it easy to launch them without needing to remember or type full paths.
|
|
@@ -5,12 +14,25 @@ The `alias` command allows you to create shortcuts for your Minecraft instances,
|
|
|
5
14
|
## Usage
|
|
6
15
|
|
|
7
16
|
```bash
|
|
17
|
+
# Declaring an alias
|
|
8
18
|
clicraft alias [action] [args...]
|
|
19
|
+
|
|
20
|
+
# Launching from an alias
|
|
21
|
+
clicraft launch [alias]
|
|
9
22
|
```
|
|
10
23
|
|
|
24
|
+
## Arguments
|
|
25
|
+
|
|
26
|
+
| Argument | Action |
|
|
27
|
+
| -------- | ------ |
|
|
28
|
+
| `add <name> [path]` | Add an alias |
|
|
29
|
+
| `list, ls` | List aliases and their corresponding paths |
|
|
30
|
+
| `remove, rm, delete` | Remove an alias |
|
|
31
|
+
|
|
32
|
+
|
|
11
33
|
## Actions
|
|
12
34
|
|
|
13
|
-
|
|
35
|
+
## `alias list`
|
|
14
36
|
|
|
15
37
|
List all configured aliases:
|
|
16
38
|
|
|
@@ -22,7 +44,7 @@ clicraft alias # default action
|
|
|
22
44
|
|
|
23
45
|
This shows all aliases with their paths and instance information (mod loader, Minecraft version, type).
|
|
24
46
|
|
|
25
|
-
###
|
|
47
|
+
### `alias add`
|
|
26
48
|
|
|
27
49
|
Create a new alias for an instance:
|
|
28
50
|
|
|
@@ -46,7 +68,7 @@ clicraft alias add survival ~/minecraft/survival-world
|
|
|
46
68
|
clicraft alias add my-modded-world /path/to/instance
|
|
47
69
|
```
|
|
48
70
|
|
|
49
|
-
###
|
|
71
|
+
### `alias remove`
|
|
50
72
|
|
|
51
73
|
Remove an existing alias:
|
|
52
74
|
|
|
@@ -66,22 +88,6 @@ clicraft alias remove myworld
|
|
|
66
88
|
clicraft alias remove ~/minecraft/survival-world
|
|
67
89
|
```
|
|
68
90
|
|
|
69
|
-
## Using Aliases with Launch
|
|
70
|
-
|
|
71
|
-
Once you've created an alias, you can use it with the `launch` command:
|
|
72
|
-
|
|
73
|
-
```bash
|
|
74
|
-
clicraft launch myworld
|
|
75
|
-
clicraft launch my-modded-world --offline
|
|
76
|
-
clicraft launch survival --verbose
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
This is equivalent to using the `--instance` flag:
|
|
80
|
-
|
|
81
|
-
```bash
|
|
82
|
-
clicraft launch --instance /path/to/instance
|
|
83
|
-
```
|
|
84
|
-
|
|
85
91
|
## Alias Creation During Instance Creation
|
|
86
92
|
|
|
87
93
|
When you create a new instance with `clicraft create`, you'll be prompted to create an alias:
|
|
@@ -99,14 +105,7 @@ Aliases are stored in `~/.clicraft/aliases.json`. This file maps alias names to
|
|
|
99
105
|
|
|
100
106
|
```json
|
|
101
107
|
{
|
|
102
|
-
"myworld": "
|
|
103
|
-
"survival": "
|
|
108
|
+
"myworld": "~/minecraft/my-world",
|
|
109
|
+
"survival": "~/Games/survival-server"
|
|
104
110
|
}
|
|
105
111
|
```
|
|
106
|
-
|
|
107
|
-
## Tips
|
|
108
|
-
|
|
109
|
-
- Use short, memorable names for frequently-used instances
|
|
110
|
-
- Alias names cannot contain spaces
|
|
111
|
-
- If an alias already exists, adding it again will update the path
|
|
112
|
-
- The `alias list` command shows warnings for missing paths or invalid instances
|
package/docs/commands/auth.md
CHANGED
|
@@ -11,7 +11,7 @@ permalink: /commands/auth
|
|
|
11
11
|
|
|
12
12
|
Manage your Microsoft/Minecraft accounts. CLIcraft supports multiple accounts with easy switching between them.
|
|
13
13
|
|
|
14
|
-
##
|
|
14
|
+
## Usage
|
|
15
15
|
|
|
16
16
|
```bash
|
|
17
17
|
clicraft auth [action] [args...] [options]
|
|
@@ -360,11 +360,6 @@ If you used an older version of CLIcraft, your existing auth is automatically mi
|
|
|
360
360
|
- New location: `~/.clicraft/auth/accounts.json`
|
|
361
361
|
- A backup is created at `~/.clicraft/auth.json.backup`
|
|
362
362
|
|
|
363
|
-
## 📚 Related Commands
|
|
364
|
-
|
|
365
|
-
- [`clicraft launch`](launch.md) - Launch requires login for online play
|
|
366
|
-
- [`clicraft config`](config.md) - CLI configuration
|
|
367
|
-
|
|
368
363
|
## 🔗 External Resources
|
|
369
364
|
|
|
370
365
|
- [Microsoft Account](https://account.microsoft.com/)
|
package/docs/commands/config.md
CHANGED
|
@@ -71,8 +71,8 @@ clicraft config set checkUpdates auto #sets to true
|
|
|
71
71
|
|-----|-------------|----------------|--------|
|
|
72
72
|
| `checkUpdates` | whether to check for updates | `true, false` | `true` |
|
|
73
73
|
| `autoSaveToConfig` | whether to automatically save minecraft settings to mcconfig.json | `true, false` | `true` |
|
|
74
|
+
| `autoLoadConfigOnLaunch` | whether to automatically load minecraft settings from mcconfig.json | `true, false` | `true` |
|
|
74
75
|
|
|
75
|
-
*Do NOT change settingsVersion, unless you want to mess around and fix my bugs ;)*
|
|
76
76
|
|
|
77
77
|
### `ignore`
|
|
78
78
|
|
package/docs/commands/create.md
CHANGED
|
@@ -47,6 +47,8 @@ This is perfect for sharing modpack configurations or replicating setups across
|
|
|
47
47
|
| Option | Description |
|
|
48
48
|
|--------|-------------|
|
|
49
49
|
| `--verbose` | Enable verbose output to see detailed progress |
|
|
50
|
+
| `--force, -f` | Overwrites existing instance folder if necessary |
|
|
51
|
+
| `--path, -p <path>` | Specifies path in which to install instance |
|
|
50
52
|
|
|
51
53
|
## 💡 Interactive Prompts
|
|
52
54
|
|
package/docs/commands/install.md
CHANGED
|
@@ -14,12 +14,12 @@ Install mods from Modrinth directly to your Minecraft instance.
|
|
|
14
14
|
## 📝 Synopsis
|
|
15
15
|
|
|
16
16
|
```bash
|
|
17
|
-
clicraft install <
|
|
17
|
+
clicraft install <mods...> [options]
|
|
18
18
|
```
|
|
19
19
|
|
|
20
20
|
## 📖 Description
|
|
21
21
|
|
|
22
|
-
The `install` command downloads and installs mods from Modrinth to your Minecraft instance. It automatically:
|
|
22
|
+
The `install` command downloads and installs one or more mods from Modrinth to your Minecraft instance. It automatically:
|
|
23
23
|
|
|
24
24
|
1. Searches for the mod on Modrinth
|
|
25
25
|
2. Finds the correct version for your Minecraft version and loader
|
|
@@ -31,7 +31,7 @@ The `install` command downloads and installs mods from Modrinth to your Minecraf
|
|
|
31
31
|
|
|
32
32
|
| Argument | Description | Required |
|
|
33
33
|
|----------|-------------|----------|
|
|
34
|
-
| `<
|
|
34
|
+
| `<mods...>` | One or more mod names or Modrinth project IDs | Yes (at least one) |
|
|
35
35
|
|
|
36
36
|
## 🎯 Options
|
|
37
37
|
|
|
@@ -69,9 +69,13 @@ Use the project ID from `clicraft search` results.
|
|
|
69
69
|
### Install multiple mods
|
|
70
70
|
```bash
|
|
71
71
|
cd my-instance
|
|
72
|
-
clicraft install sodium
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
clicraft install sodium lithium iris
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
When installing multiple mods, you'll see a summary at the end:
|
|
76
|
+
```
|
|
77
|
+
📊 Installation Summary:
|
|
78
|
+
✅ 3 mod(s) installed successfully
|
|
75
79
|
```
|
|
76
80
|
|
|
77
81
|
### Verbose installation
|
|
@@ -130,33 +134,25 @@ instance-directory/
|
|
|
130
134
|
### Building a Performance Pack
|
|
131
135
|
```bash
|
|
132
136
|
cd my-instance
|
|
133
|
-
clicraft install sodium
|
|
134
|
-
clicraft install lithium # Server optimization
|
|
135
|
-
clicraft install starlight # Lighting engine
|
|
136
|
-
clicraft install ferritecore # Memory optimization
|
|
137
|
+
clicraft install sodium lithium starlight ferritecore
|
|
137
138
|
```
|
|
138
139
|
|
|
139
140
|
### Adding Quality of Life Mods
|
|
140
141
|
```bash
|
|
141
142
|
cd my-instance
|
|
142
|
-
clicraft install
|
|
143
|
-
clicraft install "journeymap" # Minimap
|
|
144
|
-
clicraft install "appleskin" # Food info
|
|
143
|
+
clicraft install jei journeymap appleskin
|
|
145
144
|
```
|
|
146
145
|
|
|
147
146
|
### Installing Shader Support
|
|
148
147
|
```bash
|
|
149
148
|
cd my-instance
|
|
150
|
-
clicraft install sodium
|
|
151
|
-
clicraft install iris # Shader loader
|
|
149
|
+
clicraft install sodium iris
|
|
152
150
|
```
|
|
153
151
|
|
|
154
152
|
### Server Mods
|
|
155
153
|
```bash
|
|
156
154
|
cd my-server
|
|
157
|
-
clicraft install lithium
|
|
158
|
-
clicraft install starlight
|
|
159
|
-
clicraft install "fabric api"
|
|
155
|
+
clicraft install lithium starlight fabric-api
|
|
160
156
|
```
|
|
161
157
|
|
|
162
158
|
## ⚠️ Important Notes
|
package/docs/configuration.md
CHANGED
|
@@ -16,7 +16,8 @@ CLIcraft uses configuration files to manage:
|
|
|
16
16
|
- CLI settings (`~/.clicraft/settings.json`)
|
|
17
17
|
- Default game settings (`~/.clicraft/default-game-settings.json`)
|
|
18
18
|
- Game settings ignore list (`~/.clicraft/game-settings-ignore.json`)
|
|
19
|
-
- Authentication data (`~/.clicraft/auth.json`)
|
|
19
|
+
- Authentication data (`~/.clicraft/auth/accounts.json`)
|
|
20
|
+
- Aliases for game instances (`~/.clicraft/aliases.json`)
|
|
20
21
|
- Instance settings (`mcconfig.json`)
|
|
21
22
|
|
|
22
23
|
## 🏠 Configuration Locations
|
|
@@ -28,7 +29,8 @@ CLI-wide settings are stored in your home directory:
|
|
|
28
29
|
├── settings.json # CLI settings
|
|
29
30
|
├── default-game-settings.json # Default Minecraft settings for new instances
|
|
30
31
|
├── game-settings-ignore.json # Game settings to exclude when capturing
|
|
31
|
-
└── auth
|
|
32
|
+
└── auth # Authentication tokens
|
|
33
|
+
└── accounts.json # accounts
|
|
32
34
|
```
|
|
33
35
|
|
|
34
36
|
### Instance Configuration
|
|
@@ -46,11 +48,9 @@ Global settings for CLIcraft. Manage with `clicraft config`.
|
|
|
46
48
|
|
|
47
49
|
```json
|
|
48
50
|
{
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
"modSource": "modrinth",
|
|
53
|
-
"checkUpdates": true
|
|
51
|
+
checkUpdates: true,
|
|
52
|
+
autoSaveToConfig: true,
|
|
53
|
+
autoLoadConfigOnLaunch: true,
|
|
54
54
|
}
|
|
55
55
|
```
|
|
56
56
|
|
|
@@ -58,11 +58,9 @@ Global settings for CLIcraft. Manage with `clicraft config`.
|
|
|
58
58
|
|
|
59
59
|
| Field | Type | Default | Description |
|
|
60
60
|
|-------|------|---------|-------------|
|
|
61
|
-
| `
|
|
62
|
-
| `
|
|
63
|
-
| `
|
|
64
|
-
| `modSource` | string | `"modrinth"` | Default mod source for searches |
|
|
65
|
-
| `checkUpdates` | boolean | `true` | Check for CLI updates on launch |
|
|
61
|
+
| `checkUpdates` | boolean | `true` | automatically check for updates |
|
|
62
|
+
| `autoSaveToConfig` | boolean | `true` | automatically save game settings to mcconfig.json |
|
|
63
|
+
| `autoLoadConfigOnLaunch` | boolean | `true` | automatically load game settings on launch |
|
|
66
64
|
|
|
67
65
|
### Managing Settings
|
|
68
66
|
|
|
@@ -140,19 +138,6 @@ When you create a new instance with `clicraft create`, these settings are automa
|
|
|
140
138
|
}
|
|
141
139
|
```
|
|
142
140
|
|
|
143
|
-
### Common Settings
|
|
144
|
-
|
|
145
|
-
| Setting | Type | Description | Example |
|
|
146
|
-
|---------|------|-------------|---------|
|
|
147
|
-
| `renderDistance` | number | View distance (2-32 chunks) | `16` |
|
|
148
|
-
| `fov` | number | Field of view (30-110) | `70` |
|
|
149
|
-
| `guiScale` | number | GUI scale (0=auto, 1-4) | `2` |
|
|
150
|
-
| `gamma` | number | Brightness (0.0-1.0) | `0.5` |
|
|
151
|
-
| `maxFps` | number | Frame rate limit | `144` |
|
|
152
|
-
| `lang` | string | Language code | `"en_us"` |
|
|
153
|
-
| `autoJump` | boolean | Auto-jump enabled | `false` |
|
|
154
|
-
| `soundCategory_master` | number | Master volume (0.0-1.0) | `1.0` |
|
|
155
|
-
|
|
156
141
|
### Managing Default Settings
|
|
157
142
|
|
|
158
143
|
```bash
|
|
@@ -269,19 +254,6 @@ When you run `clicraft create` in a directory containing `mcconfig.json`, CLIcra
|
|
|
269
254
|
5. Install all mods from the config
|
|
270
255
|
6. Apply game settings (if present)
|
|
271
256
|
|
|
272
|
-
This is perfect for:
|
|
273
|
-
- Sharing modpack configurations
|
|
274
|
-
- Replicating setups across machines
|
|
275
|
-
- Creating instance templates
|
|
276
|
-
|
|
277
|
-
```bash
|
|
278
|
-
# Share your instance config
|
|
279
|
-
cp my-instance/mcconfig.json ~/shared-configs/
|
|
280
|
-
|
|
281
|
-
# Create a new instance from it
|
|
282
|
-
cd ~/shared-configs/
|
|
283
|
-
clicraft create
|
|
284
|
-
```
|
|
285
257
|
|
|
286
258
|
## 🔐 Authentication Configuration
|
|
287
259
|
|
|
@@ -385,26 +357,6 @@ If game crashes with memory errors:
|
|
|
385
357
|
- Close other applications
|
|
386
358
|
- Check available system RAM
|
|
387
359
|
|
|
388
|
-
### Config Not Applied
|
|
389
|
-
If changes don't take effect:
|
|
390
|
-
- Verify JSON syntax is valid
|
|
391
|
-
- Restart the game completely
|
|
392
|
-
- Check for typos in field names
|
|
393
|
-
|
|
394
|
-
## 📚 Related Commands
|
|
395
|
-
|
|
396
|
-
- [`clicraft config`](commands/config.md) - Manage CLI and game settings
|
|
397
|
-
- [`clicraft create`](commands/create.md) - Creates initial config
|
|
398
|
-
- [`clicraft info`](commands/info.md) - Shows current config
|
|
399
|
-
- [`clicraft launch`](commands/launch.md) - Uses config to launch
|
|
400
|
-
- [`clicraft upgrade`](commands/upgrade.md) - Updates version fields
|
|
401
|
-
|
|
402
|
-
## 🔗 See Also
|
|
403
|
-
|
|
404
|
-
- [Commands Overview](commands.md)
|
|
405
|
-
- [Installation Guide](installation.md)
|
|
406
|
-
- [Launch Command](commands/launch.md)
|
|
407
|
-
|
|
408
360
|
---
|
|
409
361
|
|
|
410
362
|
[← Back to Home](index.md)
|
package/docs/index.md
CHANGED
|
@@ -14,16 +14,6 @@ Welcome to **CLIcraft** - A simple, powerful Minecraft Mod Package Manager writt
|
|
|
14
14
|
|
|
15
15
|
CLIcraft is a command-line tool that simplifies managing Minecraft instances and mods. Create instances with Fabric or Forge, search and install mods from Modrinth, and launch the game directly from your terminal.
|
|
16
16
|
|
|
17
|
-
## ✨ Key Features
|
|
18
|
-
|
|
19
|
-
- **🎮 Create Instances** - Set up new Minecraft client or server instances with Fabric or Forge
|
|
20
|
-
- **🔍 Search Mods** - Find mods on Modrinth with filters for version, loader, and more
|
|
21
|
-
- **📦 Install Mods** - Download and install mods directly to your instance
|
|
22
|
-
- **🔄 Upgrade** - Update mods, mod loader, or Minecraft version
|
|
23
|
-
- **ℹ️ Instance Info** - View detailed information about your instances
|
|
24
|
-
- **🔐 Microsoft Login** - Authenticate with your Microsoft account to play online
|
|
25
|
-
- **🚀 Launch Game** - Start Minecraft directly from the terminal
|
|
26
|
-
|
|
27
17
|
## 🚀 Quick Start
|
|
28
18
|
|
|
29
19
|
```bash
|
|
@@ -49,22 +39,8 @@ clicraft launch
|
|
|
49
39
|
### Getting Started
|
|
50
40
|
- [Installation](installation.md) - Install CLIcraft on your system
|
|
51
41
|
- [Commands Overview](commands.md) - List of all available commands
|
|
52
|
-
|
|
53
|
-
### Commands
|
|
54
|
-
- [`create`](commands/create.md) - Create a new Minecraft instance
|
|
55
|
-
- [`search`](commands/search.md) - Search for mods on Modrinth
|
|
56
|
-
- [`install`](commands/install.md) - Install mods to your instance
|
|
57
|
-
- [`auth`](commands/auth.md) - Manage Microsoft accounts (login, logout, switch)
|
|
58
|
-
- [`launch`](commands/launch.md) - Launch your Minecraft instance
|
|
59
|
-
- [`info`](commands/info.md) - View instance information
|
|
60
|
-
- [`upgrade`](commands/upgrade.md) - Upgrade mods and loaders
|
|
61
|
-
|
|
62
|
-
### Configuration
|
|
63
42
|
- [Configuration Guide](configuration.md) - Instance and authentication configuration
|
|
64
43
|
|
|
65
|
-
### Contributing
|
|
66
|
-
- [Contributing Guide](contributing.md) - How to contribute to CLIcraft
|
|
67
|
-
|
|
68
44
|
## 🎯 Requirements
|
|
69
45
|
|
|
70
46
|
- **Node.js** 18 or higher
|
package/docs/installation.md
CHANGED
|
@@ -36,7 +36,7 @@ npm install -g @bobschlowinskii/clicraft
|
|
|
36
36
|
|
|
37
37
|
This is the easiest and recommended way to install CLIcraft.
|
|
38
38
|
|
|
39
|
-
### Method 2: Clone from Source
|
|
39
|
+
### Method 2: Clone from Source
|
|
40
40
|
|
|
41
41
|
Alternatively, you can install from source:
|
|
42
42
|
|
|
@@ -54,10 +54,6 @@ npm link
|
|
|
54
54
|
|
|
55
55
|
After linking, you can use the `clicraft` command from any directory:
|
|
56
56
|
|
|
57
|
-
```bash
|
|
58
|
-
clicraft --version
|
|
59
|
-
```
|
|
60
|
-
|
|
61
57
|
## 🔧 Verifying Installation
|
|
62
58
|
|
|
63
59
|
To verify that CLIcraft is installed correctly, run:
|
|
@@ -68,16 +64,6 @@ clicraft --version
|
|
|
68
64
|
|
|
69
65
|
This should display the current version of CLIcraft.
|
|
70
66
|
|
|
71
|
-
## 📁 Configuration Files
|
|
72
|
-
|
|
73
|
-
CLIcraft stores configuration files in the following locations:
|
|
74
|
-
|
|
75
|
-
- **CLI settings**: `~/.clicraft/settings.json`
|
|
76
|
-
- **Authentication accounts**: `~/.clicraft/auth/accounts.json`
|
|
77
|
-
- **Instance configuration**: `mcconfig.json` (in each instance directory)
|
|
78
|
-
|
|
79
|
-
These files are created automatically when you use CLIcraft for the first time.
|
|
80
|
-
|
|
81
67
|
## ⬆️ Updating CLIcraft
|
|
82
68
|
|
|
83
69
|
### If installed from source:
|
|
@@ -85,7 +71,7 @@ These files are created automatically when you use CLIcraft for the first time.
|
|
|
85
71
|
```bash
|
|
86
72
|
cd clicraft
|
|
87
73
|
git pull origin main
|
|
88
|
-
npm install
|
|
74
|
+
npm install -g
|
|
89
75
|
```
|
|
90
76
|
|
|
91
77
|
### If installed via npm:
|
|
@@ -113,7 +99,7 @@ npm uninstall -g @bobschlowinskii/clicraft
|
|
|
113
99
|
To also remove configuration files:
|
|
114
100
|
|
|
115
101
|
```bash
|
|
116
|
-
rm -rf ~/.
|
|
102
|
+
rm -rf ~/.clicraft
|
|
117
103
|
```
|
|
118
104
|
|
|
119
105
|
## 🐛 Troubleshooting
|
|
@@ -151,15 +137,6 @@ If you encounter any issues during installation:
|
|
|
151
137
|
2. Open a new issue with details about your problem
|
|
152
138
|
3. Include your operating system, Node.js version, and any error messages
|
|
153
139
|
|
|
154
|
-
## ⏭️ Next Steps
|
|
155
|
-
|
|
156
|
-
Once CLIcraft is installed, you're ready to:
|
|
157
|
-
|
|
158
|
-
1. [Create your first instance](commands/create.md)
|
|
159
|
-
2. [Search for mods](commands/search.md)
|
|
160
|
-
3. [Install mods](commands/install.md)
|
|
161
|
-
4. [Launch the game](commands/launch.md)
|
|
162
|
-
|
|
163
140
|
---
|
|
164
141
|
|
|
165
142
|
[← Back to Home](index.md) | [View All Commands →](commands.md)
|
package/helpers/config.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
2
|
import path from 'path';
|
|
3
3
|
import os from 'os';
|
|
4
|
+
import version from "../helpers/getv.js"
|
|
4
5
|
|
|
5
6
|
// Get the .clicraft config directory path
|
|
6
7
|
export function getConfigDir() {
|
|
@@ -20,11 +21,14 @@ const DEFAULT_SETTINGS = {
|
|
|
20
21
|
// Default memory allocation
|
|
21
22
|
// minMemory: '1G',
|
|
22
23
|
// maxMemory: '2G',
|
|
24
|
+
jvmArgs: [
|
|
25
|
+
'-Xmx2G',
|
|
26
|
+
'-Xms512M',
|
|
27
|
+
],
|
|
23
28
|
|
|
24
29
|
checkUpdates: true,
|
|
25
30
|
autoSaveToConfig: true,
|
|
26
31
|
autoLoadConfigOnLaunch: true,
|
|
27
|
-
settingsVersion: '0.3.0',
|
|
28
32
|
};
|
|
29
33
|
|
|
30
34
|
// Default game settings to apply to new instances
|
package/helpers/versions.js
CHANGED
package/index.js
CHANGED
|
@@ -31,11 +31,13 @@ program
|
|
|
31
31
|
.command('create')
|
|
32
32
|
.description('Create a new Minecraft instance')
|
|
33
33
|
.option('--verbose', 'Enable verbose output')
|
|
34
|
+
.option('-f, --force', 'Overwrite existing instance if it exists')
|
|
35
|
+
.option('-p, --path <path>', 'Path to create the instance in')
|
|
34
36
|
.action(createInstance);
|
|
35
37
|
|
|
36
38
|
program
|
|
37
|
-
.command('install <
|
|
38
|
-
.description('Install
|
|
39
|
+
.command('install <mods...>')
|
|
40
|
+
.description('Install one or more mods to the current Minecraft instance')
|
|
39
41
|
.option('-i, --instance <path>', 'Path to the instance directory')
|
|
40
42
|
.option('-f, --force', 'Force reinstall/update if already installed')
|
|
41
43
|
.option('--verbose', 'Enable verbose output')
|