LeoYeAI/agent-master-skills / skills/api-key-ui-tab
apikeys-ui
VerifiedVault-backed API Keys management for OpenClaw. Secure file-based secret storage with one-click migration from plaintext config, dynamic key discovery, vault key selector for skills, manual secret creation, and plugin-registered settings tab.
| File | Kind | Size |
|---|---|---|
| INSTALL_INSTRUCTIONS.md | markdown | 928 B |
| SKILL.md | skill md | 16.3 KB |
| _meta.json | config | 479 B |
| reference/apikeys-controller.ts | script | 19.1 KB |
| reference/apikeys-views.ts | script | 16.1 KB |
| reference/secrets-rpc.ts | script | 16.0 KB |
| reference/skills-controller.ts | script | 5.7 KB |
| reference/skills-rpc.ts | script | 6.7 KB |
| reference/skills-status.ts | script | 8.9 KB |
| reference/skills-views.ts | script | 9.5 KB |
reference/skills-rpc.ts
View on GitHubimport {
listAgentIds,
resolveAgentWorkspaceDir,
resolveDefaultAgentId,
} from "../../agents/agent-scope.js";
import { installSkill } from "../../agents/skills-install.js";
import { buildWorkspaceSkillStatus } from "../../agents/skills-status.js";
import { loadWorkspaceSkillEntries, type SkillEntry } from "../../agents/skills.js";
import { listAgentWorkspaceDirs } from "../../agents/workspace-dirs.js";
import type { OpenClawConfig } from "../../config/config.js";
import { loadConfig, writeConfigFile } from "../../config/config.js";
import { getRemoteSkillEligibility } from "../../infra/skills-remote.js";
import { normalizeAgentId } from "../../routing/session-key.js";
import { normalizeSecretInput } from "../../utils/normalize-secret-input.js";
import {
ErrorCodes,
errorShape,
formatValidationErrors,
validateSkillsBinsParams,
validateSkillsInstallParams,
validateSkillsStatusParams,
validateSkillsUpdateParams,
} from "../protocol/index.js";
import type { GatewayRequestHandlers } from "./types.js";
function collectSkillBins(entries: SkillEntry[]): string[] {
const bins = new Set<string>();
for (const entry of entries) {
const required = entry.metadata?.requires?.bins ?? [];
const anyBins = entry.metadata?.requires?.anyBins ?? [];
const install = entry.metadata?.install ?? [];
for (const bin of required) {
const trimmed = bin.trim();
if (trimmed) {
bins.add(trimmed);
}
}
for (const bin of anyBins) {
const trimmed = bin.trim();
if (trimmed) {
bins.add(trimmed);
}
}
for (const spec of install) {
const specBins = spec?.bins ?? [];
for (const bin of specBins) {
const trimmed = String(bin).trim();
if (trimmed) {
bins.add(trimmed);
}
}
}
}
return [...bins].toSorted();
}
export const skillsHandlers: GatewayRequestHandlers = {
"skills.status": ({ params, respond }) => {
if (!validateSkillsStatusParams(params)) {
respond(
false,
undefined,
errorShape(
ErrorCodes.INVALID_REQUEST,
`invalid skills.status params: ${formatValidationErrors(validateSkillsStatusParams.errors)}`,
),
);
return;
}
const cfg = loadConfig();
const agentIdRaw = typeof params?.agentId === "string" ? params.agentId.trim() : "";
const agentId = agentIdRaw ? normalizeAgentId(agentIdRaw) : resolveDefaultAgentId(cfg);
if (agentIdRaw) {
const knownAgents = listAgentIds(cfg);
if (!knownAgents.includes(agentId)) {
respond(
false,
undefined,
errorShape(ErrorCodes.INVALID_REQUEST, `unknown agent id "${agentIdRaw}"`),
);
return;
}
}
const workspaceDir = resolveAgentWorkspaceDir(cfg, agentId);
const report = buildWorkspaceSkillStatus(workspaceDir, {
config: cfg,
eligibility: { remote: getRemoteSkillEligibility() },
});
respond(true, report, undefined);
},
"skills.bins": ({ params, respond }) => {
if (!validateSkillsBinsParams(params)) {
respond(
false,
undefined,
errorShape(
ErrorCodes.INVALID_REQUEST,
`invalid skills.bins params: ${formatValidationErrors(validateSkillsBinsParams.errors)}`,
),
);
return;
}
const cfg = loadConfig();
const workspaceDirs = listAgentWorkspaceDirs(cfg);
const bins = new Set<string>();
for (const workspaceDir of workspaceDirs) {
const entries = loadWorkspaceSkillEntries(workspaceDir, { config: cfg });
for (const bin of collectSkillBins(entries)) {
bins.add(bin);
}
}
respond(true, { bins: [...bins].toSorted() }, undefined);
},
"skills.install": async ({ params, respond }) => {
if (!validateSkillsInstallParams(params)) {
respond(
false,
undefined,
errorShape(
ErrorCodes.INVALID_REQUEST,
`invalid skills.install params: ${formatValidationErrors(validateSkillsInstallParams.errors)}`,
),
);
return;
}
const p = params as {
name: string;
installId: string;
timeoutMs?: number;
};
const cfg = loadConfig();
const workspaceDirRaw = resolveAgentWorkspaceDir(cfg, resolveDefaultAgentId(cfg));
const result = await installSkill({
workspaceDir: workspaceDirRaw,
skillName: p.name,
installId: p.installId,
timeoutMs: p.timeoutMs,
config: cfg,
});
respond(
result.ok,
result,
result.ok ? undefined : errorShape(ErrorCodes.UNAVAILABLE, result.message),
);
},
"skills.update": async ({ params, respond }) => {
if (!validateSkillsUpdateParams(params)) {
respond(
false,
undefined,
errorShape(
ErrorCodes.INVALID_REQUEST,
`invalid skills.update params: ${formatValidationErrors(validateSkillsUpdateParams.errors)}`,
),
);
return;
}
const p = params as {
skillKey: string;
enabled?: boolean;
apiKey?: string;
vaultKeyId?: string;
env?: Record<string, string>;
};
const cfg = loadConfig();
const skills = cfg.skills ? { ...cfg.skills } : {};
const entries = skills.entries ? { ...skills.entries } : {};
const current = entries[p.skillKey] ? { ...entries[p.skillKey] } : {};
if (typeof p.enabled === "boolean") {
current.enabled = p.enabled;
}
if (typeof p.vaultKeyId === "string" && p.vaultKeyId.trim()) {
// Link to a vault key via SecretRef
const keyId = p.vaultKeyId.trim();
current.apiKey = { source: "file", provider: "default", id: `/${keyId}` } as unknown as string;
} else if (p.vaultKeyId === "") {
// Unlink — clear the apiKey
delete current.apiKey;
} else if (typeof p.apiKey === "string") {
const trimmed = normalizeSecretInput(p.apiKey);
if (trimmed) {
current.apiKey = trimmed;
} else {
delete current.apiKey;
}
}
if (p.env && typeof p.env === "object") {
const nextEnv = current.env ? { ...current.env } : {};
for (const [key, value] of Object.entries(p.env)) {
const trimmedKey = key.trim();
if (!trimmedKey) {
continue;
}
const trimmedVal = value.trim();
if (!trimmedVal) {
delete nextEnv[trimmedKey];
} else {
nextEnv[trimmedKey] = trimmedVal;
}
}
current.env = nextEnv;
}
entries[p.skillKey] = current;
skills.entries = entries;
const nextConfig: OpenClawConfig = {
...cfg,
skills,
};
await writeConfigFile(nextConfig);
respond(true, { ok: true, skillKey: p.skillKey, config: current }, undefined);
},
};
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |