mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-10 00:31:22 +00:00
Skills: prefer active OpenClaw paths
This commit is contained in:
@@ -153,7 +153,11 @@ export function registerDnsCli(program: Command) {
|
||||
}).trimEnd(),
|
||||
);
|
||||
defaultRuntime.log("");
|
||||
defaultRuntime.log(theme.heading("Recommended ~/.openclaw/openclaw.json:"));
|
||||
defaultRuntime.log(
|
||||
theme.heading(
|
||||
"Recommended config ($OPENCLAW_CONFIG_PATH, default ~/.openclaw/openclaw.json):",
|
||||
),
|
||||
);
|
||||
defaultRuntime.writeJson({
|
||||
gateway: { bind: "auto" },
|
||||
discovery: { wideArea: { enabled: true, domain: wideAreaDomain } },
|
||||
@@ -248,7 +252,7 @@ export function registerDnsCli(program: Command) {
|
||||
defaultRuntime.log("");
|
||||
defaultRuntime.log(
|
||||
theme.muted(
|
||||
"Note: enable discovery.wideArea.enabled in ~/.openclaw/openclaw.json on the gateway and restart the gateway so it writes the DNS-SD zone.",
|
||||
"Note: enable discovery.wideArea.enabled in the active OpenClaw config ($OPENCLAW_CONFIG_PATH, default ~/.openclaw/openclaw.json) on the gateway and restart the gateway so it writes the DNS-SD zone.",
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import { hasExplicitOptions } from "../command-options.js";
|
||||
export function registerSetupCommand(program: Command) {
|
||||
program
|
||||
.command("setup")
|
||||
.description("Initialize ~/.openclaw/openclaw.json and the agent workspace")
|
||||
.description("Initialize the active OpenClaw config and agent workspace")
|
||||
.addHelpText(
|
||||
"after",
|
||||
() =>
|
||||
|
||||
@@ -282,7 +282,7 @@ export function formatSkillInfo(
|
||||
` Save via CLI: ${formatCliCommand(`openclaw config set skills.entries.${safeSkillKey}.apiKey YOUR_KEY`)}`,
|
||||
);
|
||||
lines.push(
|
||||
` Stored in: ${theme.muted("~/.openclaw/openclaw.json")} ${theme.muted(`(skills.entries.${safeSkillKey}.apiKey)`)}`,
|
||||
` Stored in: ${theme.muted("$OPENCLAW_CONFIG_PATH")} ${theme.muted("(default: ~/.openclaw/openclaw.json)")}`,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -149,6 +149,36 @@ describe("skills-cli", () => {
|
||||
expect(output).toContain("API_KEY");
|
||||
});
|
||||
|
||||
it("shows API key storage guidance for the active config path", () => {
|
||||
const report = createMockReport([
|
||||
createMockSkill({
|
||||
name: "env-aware-skill",
|
||||
skillKey: "env-aware-skill",
|
||||
primaryEnv: "API_KEY",
|
||||
eligible: false,
|
||||
requirements: {
|
||||
bins: [],
|
||||
anyBins: [],
|
||||
env: ["API_KEY"],
|
||||
config: [],
|
||||
os: [],
|
||||
},
|
||||
missing: {
|
||||
bins: [],
|
||||
anyBins: [],
|
||||
env: ["API_KEY"],
|
||||
config: [],
|
||||
os: [],
|
||||
},
|
||||
}),
|
||||
]);
|
||||
|
||||
const output = formatSkillInfo(report, "env-aware-skill", {});
|
||||
expect(output).toContain("OPENCLAW_CONFIG_PATH");
|
||||
expect(output).toContain("default: ~/.openclaw/openclaw.json");
|
||||
expect(output).toContain("skills.entries.env-aware-skill.apiKey");
|
||||
});
|
||||
|
||||
it("normalizes text-presentation emoji selectors in info output", () => {
|
||||
const report = createMockReport([
|
||||
createMockSkill({
|
||||
|
||||
Reference in New Issue
Block a user