trucontext 0.1.0 → 0.1.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/bin/cli.js +1 -1
- package/package.json +1 -1
- package/src/commands/login.js +7 -5
package/bin/cli.js
CHANGED
|
@@ -18,7 +18,7 @@ import { relationshipTypesListCommand } from '../src/commands/relationship-types
|
|
|
18
18
|
program
|
|
19
19
|
.name('trucontext')
|
|
20
20
|
.description('TruContext CLI — contextual memory for AI applications')
|
|
21
|
-
.version('0.1.
|
|
21
|
+
.version('0.1.1');
|
|
22
22
|
|
|
23
23
|
// Auth
|
|
24
24
|
program.command('login')
|
package/package.json
CHANGED
package/src/commands/login.js
CHANGED
|
@@ -93,14 +93,14 @@ export async function loginCommand(options) {
|
|
|
93
93
|
const creds = await performLogin({ provider });
|
|
94
94
|
console.log(chalk.green(`\nLogged in as ${chalk.bold(creds.email)}`));
|
|
95
95
|
|
|
96
|
-
// Fetch apps and select one
|
|
96
|
+
// Fetch apps and select or create one
|
|
97
97
|
try {
|
|
98
98
|
const res = await controlPlane('GET', '/apps');
|
|
99
99
|
const apps = res.data?.apps || [];
|
|
100
100
|
|
|
101
101
|
if (apps.length === 1) {
|
|
102
102
|
setActiveApp(apps[0].appId);
|
|
103
|
-
console.log(chalk.dim(`Active app: ${apps[0].name} (${apps[0].appId})`));
|
|
103
|
+
console.log(chalk.dim(`Active app: ${apps[0].name} (${apps[0].appId})\n`));
|
|
104
104
|
} else if (apps.length > 1) {
|
|
105
105
|
const chosen = await select({
|
|
106
106
|
message: 'Select an app:',
|
|
@@ -111,13 +111,15 @@ export async function loginCommand(options) {
|
|
|
111
111
|
});
|
|
112
112
|
setActiveApp(chosen);
|
|
113
113
|
const app = apps.find(a => a.appId === chosen);
|
|
114
|
-
console.log(chalk.green(`Active app: ${app.name}`));
|
|
114
|
+
console.log(chalk.green(`Active app: ${app.name}\n`));
|
|
115
115
|
} else {
|
|
116
|
-
console.log(chalk.
|
|
117
|
-
|
|
116
|
+
console.log(chalk.yellow('\nNo apps yet. Let\'s create your first one.\n'));
|
|
117
|
+
const { initCommand } = await import('./init.js');
|
|
118
|
+
await initCommand(undefined, {});
|
|
118
119
|
}
|
|
119
120
|
} catch {
|
|
120
121
|
// Non-fatal — login still succeeded
|
|
122
|
+
console.log();
|
|
121
123
|
}
|
|
122
124
|
} catch (err) {
|
|
123
125
|
console.error(chalk.red(`Login failed: ${err.message}`));
|