Skip to content

Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active

chore: Add color to the install script - This will only work on terminals setup to use color

LaraClarae726e42cb59b
diff --git a/config/color-console.js b/config/color-console.js
new file mode 100644
index 0000000000..a85f78b367
--- /dev/null
+++ b/config/color-console.js
@@ -0,0 +1,14 @@
+/**
+ * Console changes
+ * This allows us to give the console some colour when running in a terminal
+ */
+
+console.orange = (msg) => console.log('\x1b[33m%s\x1b[0m', msg);
+console.green = (msg) => console.log('\x1b[32m%s\x1b[0m', msg);
+console.red = (msg) => console.log('\x1b[31m%s\x1b[0m', msg);
+console.blue = (msg) => console.log('\x1b[34m%s\x1b[0m', msg);
+console.purple = (msg) => console.log('\x1b[35m%s\x1b[0m', msg);
+console.cyan = (msg) => console.log('\x1b[36m%s\x1b[0m', msg);
+console.yellow = (msg) => console.log('\x1b[33m%s\x1b[0m', msg);
+console.white = (msg) => console.log('\x1b[37m%s\x1b[0m', msg);
+console.gray = (msg) => console.log('\x1b[90m%s\x1b[0m', msg);
\ No newline at end of file
diff --git a/config/install.js b/config/install.js
index 2ca1fa9fea..4f7c79b48f 100644
--- a/config/install.js
+++ b/config/install.js
@@ -4,6 +4,7 @@
const fs = require('fs');
const readline = require('readline');
const { exit } = require('process');
+require('./color-console');
// Save the original console.log function
const originalConsoleWarn = console.warn;
@@ -45,7 +46,7 @@ const askQuestion = (query) => {
});
return new Promise((resolve) =>
- rl.question(query, (ans) => {
+ rl.question("\x1b[34m" + query + "\n> " + "\x1b[0m", (ans) => {
rl.close();
resolve(ans);
})
@@ -73,8 +74,11 @@ const askQuestion = (query) => {
exit(0);
}
- console.log('Welcome to the ChatGPT Clone install script!');
- console.log('Please answer the following questions to setup your environment.');
+ // Lets colour the console
+ console.purple('=== LibreChat First Install ===');
+ console.cyan('Note: Leave blank to use the default value.');
+ console.log(''); // New line
+
// Ask for the app title
const title = await askQuestion(
'Enter the app title (default: "LibreChat"): '
@@ -104,14 +108,15 @@ const askQuestion = (query) => {
env['MONGO_URI'] = mongodb || 'mongodb://127.0.0.1:27017/LibreChat';
// Very basic check to make sure they entered a url
if (!env['MONGO_URI'].includes('://')) {
- console.warn('Warning: Your mongodb url looks incorrect, please double check it in the `.env` file.');
+ console.orange('Warning: Your mongodb url looks incorrect, please double check it in the `.env` file.');
}
// Update the env file
loader.writeEnvFile(rootEnvPath, env);
// We can ask for more here if we want
-
- console.log('Environment setup complete.');
+ console.log(''); // New line
+ console.green('Success! Please read our docs if you need help setting up the rest of the app.');
+ console.log(''); // New line
})();