ctl overview
synopkgland ctl runs task-level commands on Apps installed on a NAS, from a terminal, a script or an AI agent. It ships with @synopackageland/cli, runs on your computer, and talks to DSM over HTTPS.
- A command exists only if the App’s developer declared it in
ctl.commands. ctl cannot call other methods, URLs or scripts. - The identity is the DSM account you sign in with. ctl has no identity or privilege of its own.
- Every call goes through the App’s own backend checks, the same path the App’s UI uses.
Use cases
Section titled “Use cases”| Use | Example |
|---|---|
| An AI agent operates an App | Discover commands and schemas with ctl list --json, then run ctl myapp notes add --text "Buy milk" --yes. |
| A script or CI check | ctl myapp status --host nas after a deploy, branching on the exit code. |
| Several NAS machines | --host a,b or --all-hosts; one result per host. |
| A long task | A job command starts once and waits; --no-wait returns the accepted job. |
| A bulk read or a file send | The paginate, ndjson and upload flows, with fixed limits. |
ctl does not install or upgrade packages (use deploy), cannot call UI-only methods, and never acts without a DSM sign-in.
How a call flows
Section titled “How a call flows”host addsigns in to DSM and stores the session and SynoToken in the OS credential store.ctl listasks DSM for the installed packages with your session. You approve the batch; ctl then reads each App’s private description, validates it and pins its hash.- A run validates your parameters against the command’s JSON Schema locally, requires
--yesfor writes, and sends{method, params}to the App’s fixed CGI. - The App checks the DSM session, the App entry, the method permission and its own handler rules (owner, ACL, grants).
synopkgland host add nas --url https://nas.example:5001 --username alicesynopkgland ctl list --host nas --jsonsynopkgland ctl myapp greeting set --text Hello --host nas --yesRequirements
Section titled “Requirements”| Need | Detail |
|---|---|
| CLI | The latest public CLI release. |
| App | Built with the latest public CLI and templates with their pinned SDK, with ctl.enabled: true and explicit commands. Automatic descriptions cover the native SDK backends (Go, Node.js, Python, Rust). |
| NAS | The DSM HTTPS port reachable from your computer, and an account that may open the App. |
| Computer | A usable OS credential store (Keychain, Credential Manager, or Secret Service on Linux). There is no plaintext fallback. |
To make an App controllable, see Expose App commands. To call commands, see Run ctl commands; what ctl checks, trusts and refuses is in ctl security. To write the API description by hand for a binary or Compose App, use API description v1.