Skip to main content

qnap

codecov

A CLI for QNAP NAS management. It is designed for both interactive use and automation: human-friendly tables by default, stable JSON contracts on inspection commands, and a schema command for agent introspection.

Supported platforms: Linux and macOS.

Installation

cargo install qnap

# Or run from PyPI without installing
uvx qnap-cli --help

The PyPI package provides both qnap and qnap-cli as executable names.

Or build from source:

git clone https://github.com/rvben/qnap-cli
cd qnap-cli
make install

Quick Start

# Save connection settings and password
qnap login --host nas.local --username admin

# Inspect the NAS
qnap info
qnap status
qnap volumes
qnap shares
qnap files ls /Public

# Structured output for automation
qnap status --json
qnap files stat /Public/example.txt --json

Commands

Command Description
login Save credentials and verify connectivity
info Model, firmware, hostname, serial, uptime
status CPU, RAM, temperature, uptime
volumes Storage volumes and installed disks
shares Shared folders
network Network adapters, IPs, MACs, DNS (--json)
config Show saved host, username, TLS settings, and file paths (--json)
files ls <PATH> List files and directories (--all, -r recursive, --json)
files stat <PATH> Normalized metadata plus raw QNAP fields (--json)
files find <PATH> <PATTERN> Recursive glob search (*.txt, backup*) (--json)
files mkdir <PATH> Create a directory
files rm <PATH>... Delete one or more files or directories
files mv <SRC> <DST> Move or rename a file or directory
files cp <SRC> <DST> Copy a file or directory (--overwrite)
files upload <LOCAL> <REMOTE_DIR> Upload a file or directory (--overwrite, -r recursive)
files download <REMOTE> [LOCAL] Download a file or directory (-r recursive)
dump [DIR] Save raw API responses for debugging
schema Print full command schema
completions <SHELL> Print shell completion script (bash, zsh, fish)

Global Flags

These flags work on every authenticated command, including login.

Flag Description
--host <HOST> Override the NAS host for one command. HTTPS only.
--username <USERNAME> Override the username for one command.
--insecure Skip TLS certificate verification for one command.
--secure Force TLS certificate verification for one command.
--password-stdin Read the password from stdin.

Examples:

printf '%s\n' 'secret-password' | qnap --password-stdin info
qnap --host https://nas.local --username admin status
qnap --secure volumes --json

Authentication

qnap login [--host <HOST>] [--username <USERNAME>] [--insecure | --secure]

qnap login verifies the credentials before saving anything. Host, username, and the saved TLS verification preference are stored in config.toml. The password is stored separately in credentials.toml.

The CLI requires HTTPS. Plain http:// targets are rejected. If your NAS uses a self-signed certificate, use --insecure or QNAP_INSECURE=1 explicitly.

If you do not want local password persistence, skip qnap login and provide QNAP_HOST, QNAP_USERNAME, and QNAP_PASSWORD directly when running commands.

JSON Output

The following commands support --json with stable, typed output:

  • info
  • status
  • volumes
  • shares
  • files ls
  • files stat

Highlights:

  • status --json uses numeric fields such as cpu_usage_pct, mem_total_mb, and temp_c.
  • volumes --json includes status_code, pool_id, and per-disk temp_c.
  • shares --json uses items_count as a number.
  • files ls --json uses size_bytes and modified_epoch.
  • files stat --json returns normalized fields plus a raw object for unnormalized QNAP metadata.

Use qnap schema for the full machine-readable command and output contract.

Environment Variables

Environment variables override local files.

Variable Description
QNAP_HOST NAS host, for example https://nas.local or nas.local
QNAP_USERNAME Username
QNAP_PASSWORD Password
QNAP_INSECURE 1/true/yes to skip TLS verification, 0/false/no to force verification
NO_COLOR Disable colored output

Stored Files

config.toml stores host, username, and TLS verification preference. credentials.toml stores the password separately in plaintext on the local machine.

Platform Config file Credentials file
macOS ~/Library/Application Support/qnap/config.toml ~/Library/Application Support/qnap/credentials.toml
Linux ~/.config/qnap/config.toml ~/.config/qnap/credentials.toml

Security

  • Passwords are never accepted as CLI flags.
  • HTTPS is required for NAS connections.
  • TLS verification is enabled by default.
  • credentials.toml is written atomically.
  • On Unix, credentials.toml is restricted to owner-only (0600) permissions.
  • On Unix, the config directory is tightened to owner-only (0700) permissions.
  • Symlink and non-regular-file credential targets are rejected.
  • If you do not want local password persistence, use environment variables or --password-stdin.

Shell Completions

Generate and install completions for your shell:

# Zsh — add to ~/.zshrc or drop in a $fpath directory
qnap completions zsh > ~/.zfunc/_qnap
echo 'fpath=(~/.zfunc $fpath)' >> ~/.zshrc
echo 'autoload -Uz compinit && compinit' >> ~/.zshrc

# Bash
qnap completions bash > /etc/bash_completion.d/qnap
# or for a user install:
qnap completions bash > ~/.local/share/bash-completion/completions/qnap

# Fish
qnap completions fish > ~/.config/fish/completions/qnap.fish

Compatibility

Tested against QTS 5.1.x and 5.2.x. The core authentication and file manager APIs have been stable since QTS 4.3, but qnap dump is the recommended way to capture compatibility issues from older or unusual firmware builds.

License

MIT

Releasing

Vership owns versioning, changelog generation, release commits, and tags. See the release runbook for the verified workflow and recovery policy.

Metadata

Release files for qnap-cli 0.1.15

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for qnap-cli 0.1.15
File Size Uploaded Provenance Actions
qnap_cli-0.1.15.tar.gz 75.7 kB Without provenance Details for qnap_cli-0.1.15.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for qnap-cli 0.1.15
File Actions
qnap_cli-0.1.15-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for qnap_cli-0.1.15-py3-none-win_amd64.whl
qnap_cli-0.1.15-py3-none-manylinux_2_28_x86_64.whl Python 3 none Linux glibc 2.28+ x86-64 Details for qnap_cli-0.1.15-py3-none-manylinux_2_28_x86_64.whl
qnap_cli-0.1.15-py3-none-manylinux_2_28_aarch64.whl Python 3 none Linux glibc 2.28+ ARM64 Details for qnap_cli-0.1.15-py3-none-manylinux_2_28_aarch64.whl
qnap_cli-0.1.15-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for qnap_cli-0.1.15-py3-none-macosx_11_0_arm64.whl
qnap_cli-0.1.15-py3-none-macosx_10_12_x86_64.whl Python 3 none macOS 10.12+ x86-64 Details for qnap_cli-0.1.15-py3-none-macosx_10_12_x86_64.whl

Total release size: 15.6 MB

Release files / qnap_cli-0.1.15.tar.gz

Download URL qnap_cli-0.1.15.tar.gz
Size 75.7 kB
Tags Source
SHA-256 checksum
How to use checksums
504364ca537d99f20e7b15018311f2268d4a68f4882d57168167da5483b7e3fa
BLAKE2b-256 checksum
How to use checksums
0ead58502cc08f09ab9a67b9db4f2690d1a037177272ce09e4bee540a2aaa887
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / qnap_cli-0.1.15-py3-none-win_amd64.whl

Download URL qnap_cli-0.1.15-py3-none-win_amd64.whl
Size 3.0 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
5efcee441ac2c9d093d04a8cfa02d5276c94856cbd4926f76a4c31e85a2bdc87
BLAKE2b-256 checksum
How to use checksums
f921b08f78f893f21f3bc293b9c1c4e0b695d0bfd1ab9f8c4b2f3c10bae0863f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / qnap_cli-0.1.15-py3-none-manylinux_2_28_x86_64.whl

Download URL qnap_cli-0.1.15-py3-none-manylinux_2_28_x86_64.whl
Size 3.2 MB
Tags Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
2e0edab89bfa62c2ba37718ee746b6ecd1b48e132e85e3ea23f731802372838e
BLAKE2b-256 checksum
How to use checksums
fb295cfe9ed875ad20128f99486052bad9cc5d0632a4bc04e9170d88d930e789
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / qnap_cli-0.1.15-py3-none-manylinux_2_28_aarch64.whl

Download URL qnap_cli-0.1.15-py3-none-manylinux_2_28_aarch64.whl
Size 3.1 MB
Tags Linux glibc 2.28+ ARM64 Python 3
SHA-256 checksum
How to use checksums
0b165a6cf9e9de9ee03408fe4858e4567555d9bb96034e028dbba3271073c2fd
BLAKE2b-256 checksum
How to use checksums
37007d6fc06d1a7327df0f81dc9fbfb27b01c0f86962c84c54fc87e5600a9164
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / qnap_cli-0.1.15-py3-none-macosx_11_0_arm64.whl

Download URL qnap_cli-0.1.15-py3-none-macosx_11_0_arm64.whl
Size 3.0 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
bee2d0d02bed3e7479707bdadbde071db2577ca164c41728ef5f7a1b21eb24ac
BLAKE2b-256 checksum
How to use checksums
0591cc55d6dd2196d79eb176d242e6954be332106b75f07fe34a349390bed742
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / qnap_cli-0.1.15-py3-none-macosx_10_12_x86_64.whl

Download URL qnap_cli-0.1.15-py3-none-macosx_10_12_x86_64.whl
Size 3.1 MB
Tags Python 3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
cc6bc936905c604b286c2ac0cbeeed46cfcd02764c62920a32915c75b9f5c4dc
BLAKE2b-256 checksum
How to use checksums
cef6e6e564e89c4a1a66219a8be42e87376fbd9933f577f5ce5ce10dae11435b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for qnap-cli 0.1.15

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page