CLI reference
Install the CLI, then run the synopkgland binary from your project directory.
corepack enable pnpmpnpm add -g @synopackageland/cli --registry=https://registry.npmjs.orgsynopkgland --project ./my-app check --json| Output | Meaning |
|---|---|
| Success | Exit status 0; commands with --json return {"ok":true,"command":"<name>","data":{}}, with command-specific data. |
| Failure | Exit status 1; JSON mode returns {"ok":false,"code":"<code>","message":"<message>","hint":"<hint>"}. Failed inspect also includes its report in data. |
| JSON availability | check, inspect, build, deploy, status, install, and uninstall expose --json. |
| Project discovery | check and build find the App manifest from the current directory or --project. |
global
Section titled “global”synopkgland [options] [command]
Use synopkgland to create, validate, build, and deploy a DSM package.
| Option | Description | Default |
|---|---|---|
--project <dir> | Start project discovery at this directory; place it before the command. It does not apply to init. | Current directory |
--strict-tls | Verify NAS CA, hostname, validity and recorded certificate. | Off |
--ca <file> | Verify NAS HTTPS with a PEM CA file. | — |
-h, --help | Show command help and exit. | — |
synopkgland check [options]
Validate your manifest, capability combinations, API permissions, and Compose configuration.
| Option | Description | Default |
|---|---|---|
--json | Write the result envelope to stdout; progress and errors go to stderr. | Off |
-h, --help | Show command help and exit. | — |
inspect
Section titled “inspect”synopkgland inspect [options] <spk>
Check any SPK without installing it, whether synopkgland built it or not. The output has two sections:
- DSM format, for every SPK: the archive layout,
INFO,package.tgz,scripts,conf, icons and wizards, each finding with a stable SPK rule code. - synopkgland contract, only for an SPK that
synopkglandbuilt (top-levelsdk-package.jsonornative-layout.json, orsynology-app.yamlin the payload): identity, payload, signature and administrator approval requirements. For a package that declaresentry, it shows the mode and reportsENTRY_LAUNCHER_MISMATCHwhen the launcher does not match it. SPKs built by other tools are not held to this contract.
An error in either section exits with SPK_INSPECTION_FAILED and code 1; warnings alone exit 0. The --json report has synopkgland (whether the contract was checked), dsm (ok, errors, warnings) and the contract fields findings, payload, signed, capabilities, icon and entry.
| Option | Description | Default |
|---|---|---|
--baseline <spk> | Compare upgrade approval requirements with the released SPK of the same package and architecture; the comparison grants no approval. | None |
--json | Write the result envelope to stdout; on failure the report is in data. | Off |
-h, --help | Show command help and exit. | — |
images
Section titled “images”synopkgland images [options] [command]
Select a container image command.
| Option | Description | Default |
|---|---|---|
-h, --help | Show command help and exit. | — |
synopkgland init [options] [dir]
Create a project from the compose, binary, or native-go template.
| Option | Description | Default |
|---|---|---|
-t, --template <name> | Choose compose, binary, or native-go. | Required |
--package <id> | Set the native package identifier. | Derived from directory name |
--name <display> | Set the native display name. | Derived from directory name |
--ui <vue|plain> | Choose the native-go UI; plain uses ui/app.js and ui/app.css. | vue for native-go |
--with <caps> | Comma-separated native-go capabilities: files, jobs, login, root-ops, delegate. | None |
--upstream-fork | Create a synology/ packaging recipe inside an existing upstream checkout; supported by compose and native-go. | Off |
--upstream <url> | Original repository URL for fork attribution | upstream Git remote |
--upstream-maintainer <name> | Verified original project/team name | Best-effort GitHub owner lookup, else TODO |
--publisher <name> | Your distributor name | SYNOPKGLAND_PUBLISHER, else TODO |
--publisher-url <url> | Your distributor URL | SYNOPKGLAND_PUBLISHER_URL |
--upstream-image <repository> | Select the official upstream image repository for a Compose fork, without tag or digest. | Required with a Compose fork |
--health-path <path> | Select the actual Compose readiness endpoint; use with --health-status. Redirects are not followed. | Must be selected explicitly |
--health-status <status> | Select the expected 2xx readiness status; use with --health-path. | Must be selected explicitly |
--from <compose.yaml> | Import an existing Compose file; applies only to compose. package and displayname come from --package, --name or the directory name; install keeps only entries the file references. | Bundled example |
--shared-folder <select|create> | Add a Shared Folder installation wizard; applies only to native-go. | None |
--shared-folder-name <name> | Name the Shared Folder to create; required with create, omitted with select. | None |
--shared-folder-key <key> | Set the Shared Folder configuration key. | shared |
--shared-folder-permission <ro|rw> | Set the package account permission requested for the Shared Folder. | rw |
--min-dsm <version> | Set the minimum DSM release or full version/build; see platforms. | Manifest value for build; template value for init |
-h, --help | Show command help and exit. | — |
| Constraint | Behavior |
|---|---|
| Target directory | [dir] defaults to .. Colliding files fail with INIT_TARGET_NOT_EMPTY. |
| Native capabilities | --with applies only to native-go. login and delegate require --ui vue; delegate also enables jobs. |
| Delegate UI | Only the Vue panel can confirm the install-selected scope. init --ui plain --with delegate fails with CAPABILITY_COMBINATION_INVALID, and check refuses install-selected with a plain UI. |
| Template minimum DSM | Native-go and binary default to 7.1-42661; Compose defaults to 7.2.1-69057. |
synopkgland add [options] <caps...>
Add files, jobs, login, root-ops, delegate, or portal to a native project.
| Option | Description | Default |
|---|---|---|
-h, --help | Show command help and exit. | — |
| Constraint | Behavior |
|---|---|
| Capability syntax | Pass names separated by spaces or commas. Already declared capabilities are reported as unchanged. |
| Project layout | Capability additions require backend.kind: go and backend.dir: backend. |
| File conflicts | Changed template files or symlinks fail with ADD_FILE_CONFLICT before capability files are written. Resolve the conflict and retry; see errors. |
delegate | Adds jobs and the delegate declaration shown in the manifest reference. For ordinary-user access, set app.status to authenticated in backend/internal/api/permissions.json. |
root-ops | Raises os_min_ver to 7.1-42661 when lower, and prints the change on stderr. |
portal | Adds portal: {}. Without an executor, set os_min_ver to 7.2-64570 or later first; a lower target is refused. Executor Apps retain the 7.1-42661 floor. Existing Portal declarations stay unchanged. |
synopkgland dev [options]
Start your Compose project locally and keep it running until you press Ctrl+C.
| Option | Description | Default |
|---|---|---|
-h, --help | Show command help and exit. | — |
synopkgland test [options]
Validate your Compose project and wait for readiness; the containers stay running.
| Option | Description | Default |
|---|---|---|
-h, --help | Show command help and exit. | — |
deploy
Section titled “deploy”synopkgland deploy [options]
Build an SPK and install it on your NAS, or print a local deployment plan.
| Option | Description | Default |
|---|---|---|
--json | Write the result envelope to stdout; progress and errors go to stderr. | Off |
--host <name> | Select a registered host; one host or an explicit default is automatic | — |
--arch <family> | Build for one architecture; see the deployment limits below. | Detect from NAS when needed |
--dev | Use a separate development package identity; Compose only. | Off |
--share <slot=name> | Repeat to provide a Compose Shared Folder name for each slot. | Required on first deploy / saved answer |
--run-as <slot=name> | Repeat to provide a Compose DSM user account for each slot; use a name, not a numeric UID or root. | Required on first deploy / saved answer |
--param <NAME=value> | Repeat to provide declared Compose installation parameters. For native-go and binary, only the install wizard values of an install-selected delegate: delegate_share=<Shared Folder> or delegate_home=true. | Declared default when available; native first install of an install-selected delegate requires one |
--dry-run | Print a local plan without connecting to a NAS, building, or installing. | Off |
-h, --help | Show command help and exit. | — |
| Limit | Behavior |
|---|---|
| Native architecture | x86_64, aarch64, or armv7; one family, declared in arches. Without --arch, deployment detects the NAS CPU family. |
| Compose architecture | x86_64 or aarch64; a DSM-authenticated web App detects the NAS family when --arch is omitted. |
| Detection failure | Pass --arch for DEPLOY_ARCH_UNDETERMINED (native) or NATIVE_ARCH_UNDETERMINED (Compose gateway); see errors. |
| Native install options | --dev, --share and --run-as are unsupported. --param accepts only delegate_share or delegate_home for an install-selected delegate; the first install without one fails with DEPLOY_PARAM_REQUIRED before anything is built. |
| Native version | Increase version or build above the installed version; otherwise deployment fails with DEPLOY_VERSION_INVALID. |
| Native layout | Builds the SPK for the NAS architecture (an aarch64 NAS uses a declared armv8) and installs it. It takes no --param. |
| Administrator approval | Root operations and delegate need approval in the App window before they are ready. |
status
Section titled “status”synopkgland status [options] [package-id]
Read the installed package status, launch URL, and capability readiness from DSM.
| Option | Description | Default |
|---|---|---|
--json | Write the result envelope to stdout; progress and errors go to stderr. | Off |
--host <name> | Select a registered host; one host or an explicit default is automatic | — |
--dev | Use a separate development package identity; Compose only. | Off |
-h, --help | Show command help and exit. | — |
| Limit | Behavior |
|---|---|
--dev | Compose only; native-go and binary reject it. |
| Capability states | ready, needs-admin-approval, unsupported, or blocked; an uninstalled package has blocked capabilities. |
portal | Listed when the app declares portal. ready with the URL when an administrator applied an alias, needs-admin-approval when none is applied, and blocked before install or when the status cannot be read. |
| Root readiness | Compares DSM root tasks with the local dist/ SPK of the installed version. Without that SPK, it compares them with the source policy and the policy digest the running executor reports; executor bytes are not compared. |
| Native layout | Reports the installed state and the Open URL; a native layout has no capabilities. |
identity: standalone | The executor is read through a short-lived App session made from the administrator’s DSM session and logged out right after. That needs an https:// host; over http:// the capability is blocked and says so. |
synopkgland logs [options]
Print package status lines and redacted diagnostics from DSM.
| Option | Description | Default |
|---|---|---|
--host <name> | Select a registered host; one host or an explicit default is automatic | — |
--dev | Use a separate development package identity; Compose only. | Off |
-h, --help | Show command help and exit. | — |
| Limit | Behavior |
|---|---|
| Output | Package status lines and redacted diagnostics for Compose, native-go, and binary; application log streaming and follow mode are unavailable. |
| Missing installation | Fails with NOT_INSTALLED; deploy the package first. See errors. |
| Project types | Compose, native-go, and binary; --dev is Compose only. Native layout is unsupported. |
synopkgland skill [options] [command]
Select a bundled agent skill command.
| Option | Description | Default |
|---|---|---|
-h, --help | Show command help and exit. | — |
synopkgland build [options]
Build SPK files from dsm-package.yaml or synology-app.yaml.
| Option | Description | Default |
|---|---|---|
--baseline <spk> | Compare upgrade approval requirements with the released SPK of the same package and architecture; the comparison grants no approval. | None |
--json | Write the result envelope to stdout; progress and errors go to stderr. | Off |
-o, --output <path> | Write one SPK to this path; native and gateway builds require a single explicit --arch. | Generated filename |
--out-dir <dir> | Set the output directory for native builds or multiple Compose gateway builds. | Native: dist/; Compose: project root |
--arch <families> | Build a comma-separated architecture list. Repeat the option to add more, for example --arch x86_64 --arch aarch64; see the build limits below. | Manifest arches; Compose gateway: both families |
--min-dsm <version> | Set the minimum DSM release or full version/build; see platforms. | Manifest value for build; template value for init |
--jobs <n> | Build up to n architectures at the same time; see parallel builds. | 1 (one after another) |
--verify-reproducible [when] | Build again from a clean state and compare the SPKs; when is changed or always. See reproducible builds. | Off; changed when given without a value |
-h, --help | Show command help and exit. | — |
| Project type | Accepted --arch values and output |
|---|---|
| Native-go | x86_64, aarch64, armv7; builds every manifest architecture when omitted. |
| Binary | x86_64, aarch64, armv7; builds every manifest architecture when omitted. |
| Native layout | x86_64, aarch64, armv8, armv7; uses the manifest layout and build hooks. |
| Compose gateway | x86_64, aarch64; builds both when omitted. Container Manager support is limited to those families. |
| Compose without gateway | Produces an architecture-independent SPK; the containers still require a supported NAS family. |
| Frontend dependencies | Install them before building: run pnpm install --frozen-lockfile in frontend/ when it has a lockfile. Build does not install dependencies. |
| Single output path | Native and gateway builds require one explicit --arch with -o; otherwise use --out-dir. |
Parallel builds
Section titled “Parallel builds”--jobs <n> builds up to n architectures at the same time, with the same byte-identical SPKs as --jobs 1. Each architecture gets its own temporary folder, and with n above 1 every output line is prefixed with its architecture, for example [aarch64]. SPKs are written only after every architecture succeeds; if one fails, the error names it and no SPK from that build is written.
A native layout hook is your own code: with --jobs above 1, layout.payload must contain {arch}, and the hook must not write to a folder another architecture uses. Use SYNOPKGLAND_WORK_DIR or per-architecture paths such as target/<rust target>/. See Existing native product.
Reproducible builds
Section titled “Reproducible builds”--verify-reproducible keeps this build’s SPKs, then builds again into a temporary folder after removing the paths in reproducible.clean, with an empty Go build cache. Each pair must match byte for byte; otherwise the command fails with BUILD_NOT_REPRODUCIBLE and lists the differing payload and metadata files.
reproducible: inputs: [backend/go.mod, backend/go.sum, frontend/pnpm-lock.yaml] clean: [target/{arch}]The fingerprint is the SHA-256 of each inputs file, the CLI version and, for a native layout, the native.toolkits pins; source edits and version bumps do not change it. After a passing check the CLI writes reproducible-fingerprint.json, which you commit. --verify-reproducible and changed skip the second round when the fingerprint is unchanged and the architectures were already checked; always never skips. Without inputs, every build checks and records nothing. --json adds reproducible to data: skipped, identical, fingerprint, changed, and one result per SPK.
synopkgland [options] [command]
Show help with synopkgland help [command].
| Option | Description | Default |
|---|---|---|
--project <dir> | Start project discovery at this directory; place it before the command. It does not apply to init. | Current directory |
--strict-tls | Verify NAS CA, hostname, validity and recorded certificate. | Off |
--ca <file> | Verify NAS HTTPS with a PEM CA file. | — |
-h, --help | Show command help and exit. | — |
images pin
Section titled “images pin”synopkgland images pin [options]
Resolve container image tags to digests and update your Compose project.
| Option | Description | Default |
|---|---|---|
--check | Report unpinned or stale images without changing files; findings fail the command. | Off |
-h, --help | Show command help and exit. | — |
| Constraint | Behavior |
|---|---|
| Registry access | Uses anonymous registry requests to public registries only: loopback, private, link-local and metadata addresses are refused, as is a DNS answer that mixes public and private addresses. Private image authentication is unavailable. Docker is not required for pinning. |
| Files changed | Rewrites service image values in compose.yaml. |
| Check failure | --check reports findings and fails with IMAGE_PIN_REQUIRED; see errors. |
images help
Section titled “images help”synopkgland images [options] [command]
Show help for a container image command.
| Option | Description | Default |
|---|---|---|
-h, --help | Show command help and exit. | — |
skill path
Section titled “skill path”synopkgland skill path [options]
Print the absolute path to the bundled skill pack.
| Option | Description | Default |
|---|---|---|
-h, --help | Show command help and exit. | — |
skill list
Section titled “skill list”synopkgland skill list [options]
List the bundled skills.
| Option | Description | Default |
|---|---|---|
-h, --help | Show command help and exit. | — |
skill show
Section titled “skill show”synopkgland skill show [options] <id>
Print the skill identified by <id>.
| Option | Description | Default |
|---|---|---|
-h, --help | Show command help and exit. | — |
skill help
Section titled “skill help”synopkgland skill [options] [command]
Show help for a skill command.
| Option | Description | Default |
|---|---|---|
-h, --help | Show command help and exit. | — |
synopkgland host add|list|show|login|logout|remove|revoke|default|trust; ctl list [--host a,b|--all-hosts] [--app pkg] [--refresh]; ctl <alias|package> <command...> [typed flags|--input file|-] [--dry-run] [--yes]; NAS HTTPS accepts any certificate by default; --strict-tls or --ca <file> opts into verification
synopkgland ctl operates installed Apps with authenticated API v1 discovery. Its host/session store, JSON envelopes and exit codes are separate from project build/deploy commands. See ctl overview, Run ctl commands for hosts, trust, typed flags, confirmation, flows and exit codes, and ctl security.
synopkgland host add|list|show|login|logout|remove|revoke|default|trust; ctl list [--host a,b|--all-hosts] [--app pkg] [--refresh]; ctl <alias|package> <command...> [typed flags|--input file|-] [--dry-run] [--yes]; NAS HTTPS accepts any certificate by default; --strict-tls or --ca <file> opts into verification
host add <name> --url <https-origin> [--username <user>] [--strict-tls] [--ca <PEM> | --fingerprint <sha256>] [--password-stdin] [--no-remember-device]
Hosts and sessions
Section titled “Hosts and sessions”synopkgland host add nas --url https://nas.example:5001 --username alicesynopkgland host login nassynopkgland host list --jsonsynopkgland host default nasEnter passwords and OTP only in your own terminal’s hidden prompts, never in chat or command arguments. The session, SynoToken and remembered-device token use the OS credential store; host metadata and App approvals live under ~/.synopkgland/ctl, and passwords are not saved. All DSM commands share this session: ctl, deploy, status, logs, install and uninstall. --host <name> selects a registration; one host or an explicit default is selected automatically. An expired session gives the exact synopkgland host login <name> hint.
NAS HTTPS accepts every certificate by default: self-signed, untrusted CA, hostname mismatch and expired certificates all work, and every CLI NAS path uses the same transport. The leaf SHA-256 is recorded for display; a change prints NAS certificate changed: <old short> -> <new short>, now trusting the new one once on stderr, updates the record and continues. host add --strict-tls stores strict mode, and --strict-tls or --ca <file> on a command opts into CA, hostname, validity and recorded-certificate verification. Strict failures use HOST_TLS_UNTRUSTED or HOST_CERT_CHANGED. host trust <name> updates the recorded fingerprint after confirmation, and host add --fingerprint <sha256> checks an expected leaf during registration. Passwords are sent only on the connection whose certificate was inspected. Public package feeds and SPK downloads keep normal HTTPS verification.
Use host show <name>, host logout <name>, host remove <name> --yes and host revoke <name> <package-id> to inspect the host, end the session, remove local data or revoke an App description approval. Certificate trust and App description approval are separate.
For automation, set DSM_USERNAME and DSM_PASSWORD (and DSM_OTP if needed) in the process environment, then select a registered host with the same account; these credentials create an in-memory session and are never saved. Without a registration, install, deploy, status and logs also accept DSM_URL with both credentials. NAS certificates are accepted by default; --strict-tls or --ca <file> opts into verification. Use a CI secret store and never put secrets in arguments or committed files. host add/login --password-stdin can read a password from standard input.
install
Section titled “install”synopkgland install [options] <package-or-spk>
For every package change, run --dry-run first, explain dependencies and data-removal effects, and add --yes only after the user agrees. A dry run reads NAS/source metadata but does not upload or change DSM. Install and uninstall require a DSM administrator, and uninstall hooks may remove package data. A failed plan can leave earlier dependencies installed; inspect status before retrying.
install <package-id>[@version] installs or upgrades a compatible release from https://packages.synopkgland.com/; use --source <HTTPS URL> for another source. The feed is queried for the NAS platform and DSM build. Dependencies come from the same feed, or the CLI names the required Synology package to install separately in Package Center. Every declared size/MD5/SHA-256 pin is verified before upload. Exact versions must be offered by the source; downgrades are refused.
install ./file.spk runs the inspect checks, validates INFO architecture/DSM bounds, then uploads and waits for the installed version. Signature presence is reported; it is not cryptographic publisher authentication. Repeat --param NAME=value for wizard values, which remain private in plan/JSON output and are validated by package hooks.
Package installation/removal works independently of ctl; operating an App still requires an SDK App that declares ctl commands. Synology packages are outside this workflow.
| Option | Description |
|---|---|
--host <name> | Registered NAS host |
--source <url> | HTTPS package source |
--param <NAME=value> | Install wizard value |
--yes | Confirm installation |
--dry-run | Print the installation plan without writing to DSM |
--json | Print a single JSON object |
-h, --help | display help for command |
uninstall
Section titled “uninstall”synopkgland uninstall [options] <package-id>
uninstall removes an installed package from the NAS. Run it with --dry-run first: the plan names what the package’s uninstall hooks may delete. See Data and removal for what survives.
| Option | Description |
|---|---|
--host <name> | Registered NAS host |
--yes | Confirm removal |
--dry-run | Print the removal plan without writing to DSM |
--json | Print a single JSON object |
-h, --help | display help for command |