Command line
akamai-netstorage
The package installs a command for scripts and CI. It has no extra dependencies.
Credentials
The upload key comes from the environment, never from a flag, so it stays out of shell history and process lists. Host, key name and CP code can come from the environment or from --host, --key-name and --cp-code.
export NETSTORAGE_HOST=example-nsu.akamaihd.net
export NETSTORAGE_KEYNAME=upload-user
export NETSTORAGE_KEY=... # from your secret store
export NETSTORAGE_CPCODE=123456 # optional: relative paths go under /123456/
npx akamai-netstorage ls images
Commands
| Command | Does |
|---|---|
ls <path> | List a directory (--max-entries, --prefix, --start, --end) |
list <path> | List files recursively |
du <path> | File count and bytes used |
stat <path> | File or directory details |
upload <local> <remote> | Upload a file (a remote ending in / keeps the file name) |
download <remote> [local] | Download a file; written only when the request succeeds |
cat <remote> | Write a file to stdout |
mkdir / rmdir / rm <path> | Create a directory, remove an empty one, delete a file |
rename <from> <to> | Rename or move a file |
symlink <target> <link> | Create a symlink |
mtime <path> <unix-time> | Set the modification time |
quick-delete <path> --yes | Delete a directory and everything in it |
Options
| Option | Effect |
|---|---|
--json | Print the parsed response as JSON |
--host, --key-name, --cp-code | Override the environment variables (the key can only come from NETSTORAGE_KEY) |
--insecure-http | Use http instead of https |
NETSTORAGE_PROXY | Environment variable with a proxy URL |
Exit codes
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Request or HTTP error (the status is printed to stderr) |
| 2 | Usage error |