Skip to content

AdaL SDK & Headless

FieldValue
DeveloperSylphAI
LanguagePython 3.10+
RequiresAdaL CLI with --sdk-runtime, anyio>=4.0
AgentAdaL CLI
Docsdocs.sylph.ai/sdk/overview

There are two ways to run AdaL without a person at the keyboard. Headless mode is a flag on the CLI you already have. The SDK embeds the runtime in your own application.

Pass a prompt, get a result. No interactive UI.

Terminal window
adal -q "explain this codebase"

Piped input is treated as a query, so the agent slots into an ordinary shell pipeline:

Terminal window
cat bug_report.txt | adal
FlagPurpose
-q, --queryRun a prompt and trigger headless mode
-o, --outputtext (default), json, or stream-json
-m, --modelOverride the model
-r, --resumeContinue a previous session by ID
-p, --promptOverride the system prompt
--yoloAuto-approve every tool call
--enabled-default-toolsWhitelist tools, e.g. "Read,Search"
--disabled-default-toolsBlacklist tools, e.g. "Bash"

The tool flags matter more than they look. An agent reviewing a pull request in CI has no business running Bash, and --enabled-default-tools "Read,Search" is how you say so.

text returns the final answer alone, which is what you want when piping to another command.

json returns the answer with metadata:

{
"success": true,
"answer": "...",
"model": "claude-sonnet-4-20250514",
"session_id": "a1b2c3d4-...",
"exit_code": 0
}

stream-json emits NDJSON — one object per line, with tool_call, tool_result, answer, error, and complete events. Use it when you want to show progress rather than wait for a result.

Exit code 0 means success. 1 covers authentication, model, and agent errors, so CI can branch on it.

Headless mode needs a prior interactive login; credentials are cached after that.

The SDK embeds the full agent runtime in your own application.

Terminal window
# macOS, Linux, WSL
curl -fsSL https://adal.sylph.ai/install.sh | bash
# Windows PowerShell
irm https://adal.sylph.ai/install/windows | iex

Two entry points:

  • query() — one-shot requests
  • AdalAgentClient — a persistent client for multi-query sessions

What it gives you over shelling out to the CLI:

  • Stream events as they happen rather than parsing stdout
  • Approve, deny, or modify any tool call programmatically — your code decides what the agent is allowed to do, per call
  • Resume sessions across client instances
  • Orchestrate multi-step workflows

The permission hook is the reason to reach for the SDK. Headless mode gives you a blunt allow-list; the SDK lets you inspect a specific call and decide.

Use headless for CI jobs, git hooks, log analysis, and anything that fits in a shell pipeline. It is one flag on a binary you already installed.

Use the SDK when the agent is part of a product — when you need per-call approval logic, event streams in your own UI, or sessions that outlive a process.

For parallel work, adal worktree create and adal worktree remove isolate concurrent agent tasks so they do not fight over the same checkout.