@rigstate/cli 0.7.15 → 0.7.16
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/dist/index.cjs +8 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +8 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/commands/config.ts +4 -4
- package/src/commands/link.ts +3 -2
package/package.json
CHANGED
package/src/commands/config.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
2
|
import chalk from 'chalk';
|
|
3
|
-
import { getApiKey, setApiKey, getProjectId, setProjectId, getApiUrl } from '../utils/config.js';
|
|
3
|
+
import { getApiKey, setApiKey, getProjectId, setProjectId, getApiUrl, setApiUrl } from '../utils/config.js';
|
|
4
4
|
|
|
5
5
|
export function createConfigCommand() {
|
|
6
6
|
const config = new Command('config');
|
|
@@ -68,12 +68,12 @@ export function createConfigCommand() {
|
|
|
68
68
|
console.log(chalk.green(`✅ project_id updated`));
|
|
69
69
|
break;
|
|
70
70
|
case 'api_url':
|
|
71
|
-
|
|
72
|
-
console.log(chalk.
|
|
71
|
+
setApiUrl(value);
|
|
72
|
+
console.log(chalk.green(`✅ api_url updated`));
|
|
73
73
|
break;
|
|
74
74
|
default:
|
|
75
75
|
console.log(chalk.red(`Unknown config key: ${key}`));
|
|
76
|
-
console.log(chalk.dim('Valid keys: api_key, project_id'));
|
|
76
|
+
console.log(chalk.dim('Valid keys: api_key, project_id, api_url'));
|
|
77
77
|
}
|
|
78
78
|
});
|
|
79
79
|
|
package/src/commands/link.ts
CHANGED
|
@@ -4,6 +4,7 @@ import fs from 'fs/promises';
|
|
|
4
4
|
import path from 'path';
|
|
5
5
|
import chalk from 'chalk';
|
|
6
6
|
import os from 'os';
|
|
7
|
+
import { getApiUrl, getApiKey } from '../utils/config.js';
|
|
7
8
|
|
|
8
9
|
export function createLinkCommand() {
|
|
9
10
|
return new Command('link')
|
|
@@ -31,7 +32,7 @@ export function createLinkCommand() {
|
|
|
31
32
|
|
|
32
33
|
const content = {
|
|
33
34
|
project_id: projectId,
|
|
34
|
-
api_url:
|
|
35
|
+
api_url: getApiUrl(),
|
|
35
36
|
linked_at: new Date().toISOString()
|
|
36
37
|
};
|
|
37
38
|
|
|
@@ -45,7 +46,7 @@ export function createLinkCommand() {
|
|
|
45
46
|
console.log(chalk.bold('🤖 Rigstate Automation Detected'));
|
|
46
47
|
console.log('');
|
|
47
48
|
|
|
48
|
-
const { getApiKey, getApiUrl } = await import('../utils/config.js');
|
|
49
|
+
const { getApiKey: _getApiKey, getApiUrl: _getApiUrl } = await import('../utils/config.js');
|
|
49
50
|
const apiKey = getApiKey(); // Might throw if not logged in
|
|
50
51
|
const apiUrl = getApiUrl();
|
|
51
52
|
|