@orchagent/cli 0.2.6 → 0.2.8
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/commands/publish.js +2 -1
- package/dist/index.js +0 -0
- package/dist/lib/config.js +5 -1
- package/package.json +1 -1
package/dist/commands/publish.js
CHANGED
|
@@ -36,8 +36,9 @@ function registerPublishCommand(program) {
|
|
|
36
36
|
.option('--url <url>', 'Agent URL (for code-based agents)')
|
|
37
37
|
.option('--public', 'Make agent public (default: true)', true)
|
|
38
38
|
.option('--private', 'Make agent private')
|
|
39
|
+
.option('--profile <name>', 'Use API key from named profile')
|
|
39
40
|
.action(async (options) => {
|
|
40
|
-
const config = await (0, config_1.getResolvedConfig)();
|
|
41
|
+
const config = await (0, config_1.getResolvedConfig)({}, options.profile);
|
|
41
42
|
const cwd = process.cwd();
|
|
42
43
|
// Check for SKILL.md first (skills take precedence)
|
|
43
44
|
const skillMdPath = path_1.default.join(cwd, 'SKILL.md');
|
package/dist/index.js
CHANGED
|
File without changes
|
package/dist/lib/config.js
CHANGED
|
@@ -31,13 +31,17 @@ async function saveConfig(config) {
|
|
|
31
31
|
await promises_1.default.writeFile(CONFIG_PATH, payload, { mode: 0o600 });
|
|
32
32
|
await promises_1.default.chmod(CONFIG_PATH, 0o600);
|
|
33
33
|
}
|
|
34
|
-
async function getResolvedConfig(overrides = {}) {
|
|
34
|
+
async function getResolvedConfig(overrides = {}, profile) {
|
|
35
35
|
const fileConfig = await loadConfig();
|
|
36
|
+
// If profile specified, get config from profiles
|
|
37
|
+
const profileConfig = profile ? fileConfig.profiles?.[profile] : undefined;
|
|
36
38
|
const apiKey = overrides.api_key ??
|
|
37
39
|
process.env.ORCHAGENT_API_KEY ??
|
|
40
|
+
profileConfig?.api_key ??
|
|
38
41
|
fileConfig.api_key;
|
|
39
42
|
const apiUrl = overrides.api_url ??
|
|
40
43
|
process.env.ORCHAGENT_API_URL ??
|
|
44
|
+
profileConfig?.api_url ??
|
|
41
45
|
fileConfig.api_url ??
|
|
42
46
|
DEFAULT_API_URL;
|
|
43
47
|
const defaultOrg = overrides.default_org ??
|