# Choose SDK, CLI, or API

> Keep runtime authoring, operational automation, and application integration on their intended programmatic boundaries.

Use `@constal/sdk` to define code that executes inside an immutable Constal package. This includes Agent behavior, Tools, Channels, Auth Providers, executable Policies, Credential Provider lifecycles, typed analytics, subtasks, views, and data-stage functions. Runtime code expresses the seven Agent primitives and invokes only accepted Resources.

Use the `constal` CLI when an operator or pipeline needs a task-oriented client: deploy a package, start or control a Run, configure a Resource, manage Credentials and bindings, or query analytics. Structured output and caller-stable event identities make the same commands suitable for reviewed automation.

Use the Platform API when another application owns the interaction. It exposes canonical events, namespace administration, Channel messaging, Credentials, customers, analytics, artifacts, and exact Run controls through versioned HTTP contracts.

These interfaces compose but do not overlap semantically. A release pipeline may type-check SDK code and deploy it with the CLI. An application may invoke the resulting Agent through the API. The Agent then executes through `Ctx`. Moving a responsibility across those boundaries should be an explicit architecture decision, not a convenience shortcut.
