feat: Support for skills (#76)

This commit is contained in:
Devansh Jain
2025-11-07 15:00:01 -08:00
committed by GitHub
parent a71ede95d4
commit ea313159ce
12 changed files with 596 additions and 24 deletions

View File

@@ -32,6 +32,7 @@ OPTIONS
-p, --prompt Headless prompt mode
--output-format <fmt> Output format for headless mode (text, json, stream-json)
Default: text
--skills <path> Custom path to skills directory (default: .skills in current directory)
BEHAVIOR
By default, letta auto-resumes the last agent used in the current directory
@@ -91,6 +92,7 @@ async function main() {
"permission-mode": { type: "string" },
yolo: { type: "boolean" },
"output-format": { type: "string" },
skills: { type: "string" },
link: { type: "boolean" },
unlink: { type: "boolean" },
},
@@ -134,6 +136,7 @@ async function main() {
const forceNew = (values.new as boolean | undefined) ?? false;
const specifiedAgentId = (values.agent as string | undefined) ?? null;
const specifiedModel = (values.model as string | undefined) ?? undefined;
const skillsDirectory = (values.skills as string | undefined) ?? undefined;
const isHeadless = values.prompt || values.run || !process.stdin.isTTY;
// Check if API key is configured
@@ -257,7 +260,7 @@ async function main() {
await upsertToolsToServer(client);
const { handleHeadlessCommand } = await import("./headless");
await handleHeadlessCommand(process.argv, specifiedModel);
await handleHeadlessCommand(process.argv, specifiedModel, skillsDirectory);
return;
}
@@ -273,11 +276,13 @@ async function main() {
forceNew,
agentIdArg,
model,
skillsDirectory,
}: {
continueSession: boolean;
forceNew: boolean;
agentIdArg: string | null;
model?: string;
skillsDirectory?: string;
}) {
const [loadingState, setLoadingState] = useState<
| "assembling"
@@ -357,6 +362,7 @@ async function main() {
undefined,
updateArgs,
forceNew,
skillsDirectory,
);
}
@@ -394,7 +400,14 @@ async function main() {
// Priority 5: Create a new agent
if (!agent) {
const updateArgs = getModelUpdateArgs(model);
agent = await createAgent(undefined, model, undefined, updateArgs);
agent = await createAgent(
undefined,
model,
undefined,
updateArgs,
false,
skillsDirectory,
);
}
// Ensure local project settings are loaded before updating
@@ -461,6 +474,7 @@ async function main() {
forceNew: forceNew,
agentIdArg: specifiedAgentId,
model: specifiedModel,
skillsDirectory: skillsDirectory,
}),
{
exitOnCtrlC: false, // We handle CTRL-C manually with double-press guard