Skip to content
Syno Package Land
Language: English

CLI reference

Install the CLI, then run the synopkgland binary from your project directory.

Terminal window
corepack enable pnpm
pnpm add -g @synopackageland/cli --registry=https://registry.npmjs.org
synopkgland --project ./my-app check --json
OutputMeaning
SuccessExit status 0; commands with --json return {"ok":true,"command":"<name>","data":{}}, with command-specific data.
FailureExit status 1; JSON mode returns {"ok":false,"code":"<code>","message":"<message>","hint":"<hint>"}. Failed inspect also includes its report in data.
JSON availabilitycheck, inspect, build, deploy, status, install, and uninstall expose --json.
Project discoverycheck and build find the App manifest from the current directory or --project.

synopkgland [options] [command]

Use synopkgland to create, validate, build, and deploy a DSM package.

OptionDescriptionDefault
--project <dir>Start project discovery at this directory; place it before the command. It does not apply to init.Current directory
--strict-tlsVerify NAS CA, hostname, validity and recorded certificate.Off
--ca <file>Verify NAS HTTPS with a PEM CA file.—
-h, --helpShow command help and exit.—

synopkgland check [options]

Validate your manifest, capability combinations, API permissions, and Compose configuration.

OptionDescriptionDefault
--jsonWrite the result envelope to stdout; progress and errors go to stderr.Off
-h, --helpShow command help and exit.—

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 synopkgland built (top-level sdk-package.json or native-layout.json, or synology-app.yaml in the payload): identity, payload, signature and administrator approval requirements. For a package that declares entry, it shows the mode and reports ENTRY_LAUNCHER_MISMATCH when 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.

OptionDescriptionDefault
--baseline <spk>Compare upgrade approval requirements with the released SPK of the same package and architecture; the comparison grants no approval.None
--jsonWrite the result envelope to stdout; on failure the report is in data.Off
-h, --helpShow command help and exit.—

synopkgland images [options] [command]

Select a container image command.

OptionDescriptionDefault
-h, --helpShow command help and exit.—

synopkgland init [options] [dir]

Create a project from the compose, binary, or native-go template.

OptionDescriptionDefault
-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-forkCreate a synology/ packaging recipe inside an existing upstream checkout; supported by compose and native-go.Off
--upstream <url>Original repository URL for fork attributionupstream Git remote
--upstream-maintainer <name>Verified original project/team nameBest-effort GitHub owner lookup, else TODO
--publisher <name>Your distributor nameSYNOPKGLAND_PUBLISHER, else TODO
--publisher-url <url>Your distributor URLSYNOPKGLAND_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, --helpShow command help and exit.—
ConstraintBehavior
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 UIOnly 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 DSMNative-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.

OptionDescriptionDefault
-h, --helpShow command help and exit.—
ConstraintBehavior
Capability syntaxPass names separated by spaces or commas. Already declared capabilities are reported as unchanged.
Project layoutCapability additions require backend.kind: go and backend.dir: backend.
File conflictsChanged template files or symlinks fail with ADD_FILE_CONFLICT before capability files are written. Resolve the conflict and retry; see errors.
delegateAdds 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-opsRaises os_min_ver to 7.1-42661 when lower, and prints the change on stderr.
portalAdds 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.

OptionDescriptionDefault
-h, --helpShow command help and exit.—

synopkgland test [options]

Validate your Compose project and wait for readiness; the containers stay running.

OptionDescriptionDefault
-h, --helpShow command help and exit.—

synopkgland deploy [options]

Build an SPK and install it on your NAS, or print a local deployment plan.

OptionDescriptionDefault
--jsonWrite 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
--devUse 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-runPrint a local plan without connecting to a NAS, building, or installing.Off
-h, --helpShow command help and exit.—
LimitBehavior
Native architecturex86_64, aarch64, or armv7; one family, declared in arches. Without --arch, deployment detects the NAS CPU family.
Compose architecturex86_64 or aarch64; a DSM-authenticated web App detects the NAS family when --arch is omitted.
Detection failurePass --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 versionIncrease version or build above the installed version; otherwise deployment fails with DEPLOY_VERSION_INVALID.
Native layoutBuilds the SPK for the NAS architecture (an aarch64 NAS uses a declared armv8) and installs it. It takes no --param.
Administrator approvalRoot operations and delegate need approval in the App window before they are ready.

synopkgland status [options] [package-id]

Read the installed package status, launch URL, and capability readiness from DSM.

OptionDescriptionDefault
--jsonWrite 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—
--devUse a separate development package identity; Compose only.Off
-h, --helpShow command help and exit.—
LimitBehavior
--devCompose only; native-go and binary reject it.
Capability statesready, needs-admin-approval, unsupported, or blocked; an uninstalled package has blocked capabilities.
portalListed 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 readinessCompares 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 layoutReports the installed state and the Open URL; a native layout has no capabilities.
identity: standaloneThe 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.

OptionDescriptionDefault
--host <name>Select a registered host; one host or an explicit default is automatic—
--devUse a separate development package identity; Compose only.Off
-h, --helpShow command help and exit.—
LimitBehavior
OutputPackage status lines and redacted diagnostics for Compose, native-go, and binary; application log streaming and follow mode are unavailable.
Missing installationFails with NOT_INSTALLED; deploy the package first. See errors.
Project typesCompose, native-go, and binary; --dev is Compose only. Native layout is unsupported.

synopkgland skill [options] [command]

Select a bundled agent skill command.

OptionDescriptionDefault
-h, --helpShow command help and exit.—

synopkgland build [options]

Build SPK files from dsm-package.yaml or synology-app.yaml.

OptionDescriptionDefault
--baseline <spk>Compare upgrade approval requirements with the released SPK of the same package and architecture; the comparison grants no approval.None
--jsonWrite 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, --helpShow command help and exit.—
Project typeAccepted --arch values and output
Native-gox86_64, aarch64, armv7; builds every manifest architecture when omitted.
Binaryx86_64, aarch64, armv7; builds every manifest architecture when omitted.
Native layoutx86_64, aarch64, armv8, armv7; uses the manifest layout and build hooks.
Compose gatewayx86_64, aarch64; builds both when omitted. Container Manager support is limited to those families.
Compose without gatewayProduces an architecture-independent SPK; the containers still require a supported NAS family.
Frontend dependenciesInstall them before building: run pnpm install --frozen-lockfile in frontend/ when it has a lockfile. Build does not install dependencies.
Single output pathNative and gateway builds require one explicit --arch with -o; otherwise use --out-dir.

--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.

--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].

OptionDescriptionDefault
--project <dir>Start project discovery at this directory; place it before the command. It does not apply to init.Current directory
--strict-tlsVerify NAS CA, hostname, validity and recorded certificate.Off
--ca <file>Verify NAS HTTPS with a PEM CA file.—
-h, --helpShow command help and exit.—

synopkgland images pin [options]

Resolve container image tags to digests and update your Compose project.

OptionDescriptionDefault
--checkReport unpinned or stale images without changing files; findings fail the command.Off
-h, --helpShow command help and exit.—
ConstraintBehavior
Registry accessUses 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 changedRewrites service image values in compose.yaml.
Check failure--check reports findings and fails with IMAGE_PIN_REQUIRED; see errors.

synopkgland images [options] [command]

Show help for a container image command.

OptionDescriptionDefault
-h, --helpShow command help and exit.—

synopkgland skill path [options]

Print the absolute path to the bundled skill pack.

OptionDescriptionDefault
-h, --helpShow command help and exit.—

synopkgland skill list [options]

List the bundled skills.

OptionDescriptionDefault
-h, --helpShow command help and exit.—

synopkgland skill show [options] <id>

Print the skill identified by <id>.

OptionDescriptionDefault
-h, --helpShow command help and exit.—

synopkgland skill [options] [command]

Show help for a skill command.

OptionDescriptionDefault
-h, --helpShow 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]

Terminal window
synopkgland host add nas --url https://nas.example:5001 --username alice
synopkgland host login nas
synopkgland host list --json
synopkgland host default nas

Enter 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.

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.

OptionDescription
--host <name>Registered NAS host
--source <url>HTTPS package source
--param <NAME=value>Install wizard value
--yesConfirm installation
--dry-runPrint the installation plan without writing to DSM
--jsonPrint a single JSON object
-h, --helpdisplay help for command

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.

OptionDescription
--host <name>Registered NAS host
--yesConfirm removal
--dry-runPrint the removal plan without writing to DSM
--jsonPrint a single JSON object
-h, --helpdisplay help for command