Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

add xspace-agent/xspace-agent/packages/cli/src/prompts.ts

overstepping9842f5303463
diff --git a/xspace-agent/xspace-agent/packages/cli/src/prompts.ts b/xspace-agent/xspace-agent/packages/cli/src/prompts.ts
new file mode 100644
index 000000000..9f1c5058e
--- /dev/null
+++ b/xspace-agent/xspace-agent/packages/cli/src/prompts.ts
@@ -0,0 +1,109 @@
+// SPDX-License-Identifier: Apache-2.0
+// Copyright 2026 nirholas (https://github.com/nirholas/xspace-agent) [§32]
+
+import inquirer from 'inquirer';
+
+export interface InitAnswers {
+ provider: string;
+ apiKey: string;
+ systemPrompt: string;
+ ttsProvider: string;
+ ttsApiKey?: string;
+ authMethod: string;
+ authToken?: string;
+}
+
+export async function promptInit(): Promise<InitAnswers> {
+ const answers = await inquirer.prompt([
+ {
+ type: 'list',
+ name: 'provider',
+ message: 'AI Provider:',
+ choices: [
+ { name: 'OpenAI (gpt-4o-mini)', value: 'openai' },
+ { name: 'OpenAI Chat (gpt-4o-mini)', value: 'openai-chat' },
+ { name: 'Claude (claude-sonnet)', value: 'claude' },
+ { name: 'Groq (llama-3.3-70b)', value: 'groq' },
+ ],
+ },
+ {
+ type: 'password',
+ name: 'apiKey',
+ message: 'API Key:',
+ mask: '*',
+ validate: (input: string) => input.length > 0 || 'API key is required',
+ },
+ {
+ type: 'input',
+ name: 'systemPrompt',
+ message: 'System prompt:',
+ default: 'You are a helpful AI agent participating in an X Space.',
+ },
+ {
+ type: 'list',
+ name: 'ttsProvider',
+ message: 'TTS Provider:',
+ choices: [
+ { name: 'OpenAI TTS (built-in, no extra key)', value: 'openai' },
+ { name: 'ElevenLabs (premium voices)', value: 'elevenlabs' },
+ ],
+ },
+ {
+ type: 'password',
+ name: 'ttsApiKey',
+ message: 'ElevenLabs API Key:',
+ mask: '*',
+ when: (ans: InitAnswers) => ans.ttsProvider === 'elevenlabs',
+ validate: (input: string) => input.length > 0 || 'ElevenLabs API key is required',
+ },
+ ]);
+
+ return answers;
+}
+
+export async function promptAuth(): Promise<{ method: string; authToken?: string; username?: string; password?: string }> {
+ const { method } = await inquirer.prompt([
+ {
+ type: 'list',
+ name: 'method',
+ message: 'Login method:',
+ choices: [
+ { name: 'Paste auth_token (easiest)', value: 'token' },
+ { name: 'Login with username/password', value: 'credentials' },
+ ],
+ },
+ ]);
+
+ if (method === 'token') {
+ const { authToken } = await inquirer.prompt([
+ {
+ type: 'password',
+ name: 'authToken',
+ message: 'auth_token:',
+ mask: '*',
+ validate: (input: string) => input.length > 0 || 'auth_token is required',
+ },
+ ]);
+ return { method, authToken };
+ }
+
+ const credentials = await inquirer.prompt([
+ {
+ type: 'input',
+ name: 'username',
+ message: 'X Username:',
+ validate: (input: string) => input.length > 0 || 'Username is required',
+ },
+ {
+ type: 'password',
+ name: 'password',
+ message: 'X Password:',
+ mask: '*',
+ validate: (input: string) => input.length > 0 || 'Password is required',
+ },
+ ]);
+
+ return { method, ...credentials };
+}
+
+