@xyz-credit/agent-cli 1.3.0 → 1.3.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyz-credit/agent-cli",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "CLI for onboarding AI agents to xyz.credit — Device Flow Auth, MCP Bridge, Service Marketplace, Daemonization & Cloud Export",
5
5
  "bin": {
6
6
  "xyz-agent": "./bin/xyz-agent.js"
@@ -43,7 +43,7 @@ async function authCommand() {
43
43
  type: 'input',
44
44
  name: 'platformUrl',
45
45
  message: 'Platform URL:',
46
- default: config.get('platformUrl') || 'https://agent-messaging.preview.emergentagent.com',
46
+ default: config.get('platformUrl') || 'https://thread-debug.preview.emergentagent.com',
47
47
  validate: (v) => v.startsWith('http') ? true : 'Must be a valid URL',
48
48
  }]);
49
49
 
@@ -99,14 +99,50 @@ async function setupCommand() {
99
99
  if (isAuthenticated()) {
100
100
  const creds = getCredentials();
101
101
  console.log(chalk.yellow(` Existing agent found: ${creds.agentName} (${creds.agentId.slice(0, 12)}...)`));
102
- const { reconfigure } = await inquirer.prompt([{
103
- type: 'confirm', name: 'reconfigure',
104
- message: 'Reconfigure from scratch?', default: false,
102
+ const { action } = await inquirer.prompt([{
103
+ type: 'list', name: 'action',
104
+ message: 'What would you like to do?',
105
+ choices: [
106
+ { name: 'Start agent with existing configuration', value: 'start' },
107
+ { name: 'Reconfigure from scratch (keep agent)', value: 'reconfigure' },
108
+ { name: 'Remove existing agent & create new one', value: 'remove' },
109
+ { name: 'Exit', value: 'exit' },
110
+ ],
105
111
  }]);
106
- if (!reconfigure) {
112
+
113
+ if (action === 'start') {
107
114
  console.log(chalk.green(' Using existing configuration.\n'));
115
+ console.log(chalk.dim(' Launching agent...\n'));
116
+ const { startCommand } = require('./start');
117
+ await startCommand({});
108
118
  return;
109
119
  }
120
+
121
+ if (action === 'remove') {
122
+ const { confirmRemove } = await inquirer.prompt([{
123
+ type: 'confirm', name: 'confirmRemove',
124
+ message: chalk.red('This will delete your local agent credentials. Are you sure?'),
125
+ default: false,
126
+ }]);
127
+ if (!confirmRemove) {
128
+ console.log(chalk.yellow(' Cancelled. Keeping existing agent.\n'));
129
+ return;
130
+ }
131
+ // Clear stored credentials
132
+ config.delete('agentId');
133
+ config.delete('agentName');
134
+ config.delete('apiKey');
135
+ config.delete('agentId');
136
+ console.log(chalk.green(' Agent credentials removed. Starting fresh setup...\n'));
137
+ // Fall through to full setup below
138
+ }
139
+
140
+ if (action === 'exit') {
141
+ console.log(chalk.dim(' Goodbye.\n'));
142
+ return;
143
+ }
144
+
145
+ // 'reconfigure' and 'remove' both fall through to the full setup wizard
110
146
  }
111
147
 
112
148
  // ── Step 1: Platform URL ──
@@ -114,7 +150,7 @@ async function setupCommand() {
114
150
  const { platformUrl } = await inquirer.prompt([{
115
151
  type: 'input', name: 'platformUrl',
116
152
  message: 'Platform URL:',
117
- default: config.get('platformUrl') || 'https://agent-messaging.preview.emergentagent.com',
153
+ default: config.get('platformUrl') || 'https://thread-debug.preview.emergentagent.com',
118
154
  validate: (v) => v.startsWith('http') ? true : 'Must start with http(s)://',
119
155
  }]);
120
156