Keeper Secrets Manager CLI
The Keeper Secrets Manager command line interface
For more information see our official documentation page https://docs.keeper.io/secrets-manager/secrets-manager/secrets-manager-command-line-interface
Change History
1.5.0
- Breaking / Security: KSM-1168 -
ksm sync --type awswith--record,--folder, or--folder-recursivenow requires a--prefixargument. The prefix is prepended to every AWS secret name derived from a record title, confining the sync to a named namespace and preventing a Keeper user who can add records to a synced folder from targeting arbitrary secrets in the operator's AWS account. Users upgrading from 1.4.x must add--prefix <value>to existing sync commands (e.g.--prefix keeper/). Additionally,--dry-runoutput no longer includes the live destination secret value; it now reportsdstExistsanddstDiffersonly. - Fix: KSM-929 - CLI keyring detection silently returned no profiles when the OS keyring (e.g. gnome-keyring) was running but locked with no interactive session available to unlock it (e.g. over SSH). Now raises an actionable error naming the cause and pointing at
--ini-file/KSM_CONFIGas a fallback. - Fix: KSM-1155 - Every keyring storage failure path in
KeyringUtilityStoragecrashed withTypeError: KeeperError.__init__() takes 2 positional arguments but 3 were giveninstead of reporting the actual storage error, because the internal error helper passed the original exception as a second argument toKeeperError. The helper now raisesKeeperErrorwith the message and chains the original exception as the cause. - Fix: KSM-1113 - Windows config search looked for
%APPDIR%\Keeper(a Linux AppImage variable, not a Windows one), sokeeper.iniplaced in%APPDATA%\Keeperwas never found; on Linux, the/etcsearch entry also resolved relative to the current working directory instead of/etc. Both paths are now resolved correctly. - Fix: KSM-1107 -
ksm secret add cloneexited 0 even when the source UID did not exist, masking the failure from scripts. Now exits non-zero with an error message. - Dependency: KSM-1114 - Removed the unmaintained
coloramapackage. Terminal coloring now usesclick(already a direct dependency viaclick-help-colors), so no new dependency is introduced. The Windows-only config-permission warning (which duck-types its color argument against colorama'sFore/Styleshape) is now colored via a smallclick.style()-backed shim instead. - Fix: KSM-1018 - The macOS installer crashed on every
ksmcommand (ImportError: Symbol not found: _SSL_get0_group_name) because the bundledlibssl.3.dylibpredated OpenSSL 3.2.0, whichcryptographynow requires. Both x64 and arm64 macOS builds now bundle an up-to-date libssl, and thecryptographyversion pin used as a stopgap is no longer needed. - Fix: KSM-1156 -
ksm shellcrashed at startup withUnicodeEncodeError: 'charmap' codec can't encode characterswhen stdout could not represent the Unicode box-drawing banner — e.g. cp1252 when output is piped or redirected on Windows, or a C-locale pipe on Linux. The shell now checks the active stdout encoding first and falls back to a plain-text banner, so it starts on any stdout encoding; UTF-8 terminals keep the full logo. - Fix: KSM-1157 -
ksm shelldid not apply session global options to commands run inside the shell: every inner line re-resolved configuration from scratch, soksm --ini-file custom.ini shellfollowed bysecret listinside the shell ignored the ini file (and--profile-name,--output,--color/--no-color,--cache/--no-cache,--log-levelwere likewise dropped). Inner commands now inherit the session's global options; options typed on an inner line still override them, for that line only. Requires click >= 8.0 (now declared ininstall_requires). - Fix: KSM-1105 - Windows installer's post-install launch of
ksm.exewas blocked by endpoint security (EDR/AV) because InnoSetup's extracted Setup engine parent process in%TEMP%was unsigned. The post-install launch no longer trips endpoint security. - Fix: KSM-1106 - macOS PKG installer ignored the Keyring and Cloud Sync component checkboxes in GUI mode, always installing both regardless of what the user selected. The installer now respects the selected components.
- Fix: KSM-1116 - Windows installer placed the CLI in
Program Files (x86)on 64-bit systems instead ofProgram Files. The installer now correctly targets the 64-bit program directory. - Fix: KSM-1118 -
ksm secret add clonecrashed with "list index out of range" when the source record contained any unpopulated complex field (name, address, host, etc.) — fields the server legitimately returns asvalue: []. Empty-value fields are now skipped before the create payload is assembled, so the clone completes correctly. Root cause in the Python helper library is tracked as KSM-1119. - Fix: KSM-1126 -
ksm secret add file(andksm secret add editor) crashed with "list index out of range" on the same class of input: a record script containing an unpopulated complex field withvalue: []. Empty-value fields are now stripped before the create payload is assembled. Root cause in the Python helper library is tracked as KSM-1119. - Fix: KSM-1135 -
ksm secret downloadcrashed with "Invalid URL 'None'" when called immediately afterksm secret uploadin automation, because the vault may not yet have propagated the file download URL by the time the SDK returns. Now raises a clear error with a prompt to retry in a few seconds. Root cause in the Python SDK is tracked as KSM-1131. - Fix: KSM-1136 - The empty-value field skip introduced for KSM-1118 also removed custom fields with
value: []fromksm secret add clone, so empty custom fields were silently missing from the cloned record — unlike standard fields, custom fields are not part of the record type schema and are not recreated. Empty custom fields are now re-attached to the clone payload with their type, label and flags preserved, keeping the clone field-faithful. Regression within this release only; no shipped version affected. - Fix: KSM-1162 -
ksm shellon Windows corrupted backslash paths typed at the shell prompt before click ever parsed them.click-replcallsshlex.split()in POSIX mode, where backslash is an escape character, so a path likeC:\dir\file.iniwas silently reduced toC:dirfile.ini. The shell now replacesclick-repl's tokenizer on Windows for the duration of the REPL session with one that treats backslash as a literal character while still stripping quotes normally, so quoted paths with spaces also work. - Fix: KSM-1163 - When
KSM_INI_DIRwas set and akeeper.inialso existed in the current working directory, the CWD file silently loaded instead of the operator-specified location. The CLI now emits a warning on stderr naming both paths and suggesting--ini-filewhen the conflict is detected; the CWD file continues to load to avoid breaking existing setups that rely on the current behavior. SetKSM_INI_DIR_SKIP_CONFLICT_WARNING=TRUEto suppress the warning. - Fix: KSM-1163 -
keeper.inidiscovery probed relative_NOTSET_/…/keeper.inipaths when Windows environment variables (USERPROFILE,APPDATA, etc.) were unset on POSIX hosts, so a literal_NOTSET_/directory in the working directory could be accidentally loaded. Discovery now skips any search entry whose environment variable is unset. - Behavior: When
KSM_CONFIGis set and a keyring profile also exists that would otherwise take precedence, the CLI now warns on stderr naming the active config source. The warning is suppressed when the keyring is unavailable or empty, so CI/container environments usingKSM_CONFIGexclusively see no output. - Fix: KSM-1161 -
ksm secret add file(andksm secret add editor) silently dropped custom fields withvalue: []from the created record. The KSM-1126 workaround strips empty-value fields before passing to the helper to avoid a helper crash; custom fields stripped this way are now re-attached to the create payload with their type, label, and flags preserved, keeping the record field-faithful. Standard fields are not affected (they are recreated from the record type schema). Root cause in the Python helper library is tracked as KSM-1119. - Fix: KSM-1165 -
ksm shelltruncated any argument containing#at the#character on all platforms. The Windows-safe tokenizer introduced in KSM-1162 disabled the backslash escape character but left the defaultcommenterslist intact, so#and everything after it was silently dropped — notation references likeUID#field/pathfailed inside the shell.#is now treated as a literal character. - Fix: KSM-1158 - On Windows, upgrading from a 1.4.0 or earlier installation left the old x86 installation intact and still on
PATHalongside the new 64-bit install. The installer now detects and removes any pre-existing x86 installation before placing the 64-bit binary. - Fix: KSM-1159 - The Windows installer appended a duplicate
PATHentry for the install directory on every install or upgrade because the InnoSetup{app}constant was not expanded before the PATH check ran. No duplicate is added on clean installs; the uninstaller now also removes all duplicate entries left by prior versions. - Fix: KSM-1164 - The Windows PATH rewrite introduced by KSM-1159 wrote
REG_EXPAND_SZPATH entries back asREG_SZ, preventing Windows from expanding environment variable references (such as%SystemRoot%\System32) in those entries. The registry value type is now preserved when rewriting PATH. - Fix: KSM-1160 - The Linux tarball
install.shhad no platform-floor check and installed silently on hosts below the documented libc minima (musl < 1.2.5 / Alpine < 3.20, or glibc < 2.28), with the firstksminvocation crashing with a cryptic loader error. The script now checks the host libc version before installing and exits with an actionable error naming the detected version, the required minimum, and remediation steps. SetKSM_SKIP_PREFLIGHT=1to bypass. The shebang was also changed from#!/bin/bashto#!/bin/shfor compatibility with Alpine's defaultashshell. - Fix: KSM-1117 - The CLI Docker alpine image shipped a binary built against musl 1.2.5 while the image base was Alpine 3.19 (musl 1.2.4), so
ksmcrashed at load time in its own image. The alpine image now uses Alpine 3.22 (musl >= 1.2.5) as its base and the musl build stage is pinned topython:3.12-alpine3.23. Binary self-tests were added to the Docker build so a mismatched binary/base pairing fails the build instead of shipping silently. - Fix: KSM-1120 - The CLI Docker images are published as multi-arch (
linux/amd64,linux/arm64), but the mountable/cli/glibc/ksmand/cli/musl/ksmbinaries were always the same amd64 ELF on both platforms, making the documented init-container pattern non-functional on arm64 hosts. The arm64 image legs now ship native arm64 binaries. - Fix: KSM-1169 -
ksm syncdry-run output no longer includes the live destination value for Azure and GCP; it reports whether the destination exists and whether it would change (dstExists/dstDiffers), matching the AWS behavior. Azure and GCP destination names given via--mapare now validated against the Azure Key Vault and GCP Secret Manager naming rules before a write. - Fix: KSM-1170 -
ksm sync --record/--foldernow prints a warning on stderr when a token resolves by record title or folder name/path rather than by UID, naming the resolved UID, since those identifiers are mutable. Resolution behavior is otherwise unchanged (ambiguous matches still error); prefer UIDs to pin scheduled syncs. - Fix: KSM-1171 -
ksm init k8snow builds the Kubernetes Secret manifest with a YAML serializer instead of string formatting, so--nameand--namespaceare always emitted as properly encoded scalars and cannot inject additional manifest content. - Fix: KSM-1182 -
ksm sync --type aws|azure|gcpgave pip install advice on a missing cloud dependency even in a frozen binary install, where pip cannot fix anything; the correct remedy (re-run the installer and enable the "Cloud Sync" component) was never mentioned. The three cloud-dependency error handlers now detectsys.frozenand point frozen installs at the installer component instead of pip; non-frozen (pip) installs are unaffected. Also single-quotes the AWS extra (pip install 'keeper-secrets-manager-cli[aws]') since the unquoted form is a glob pattern in zsh and fails with "no matches found" on copy-paste. - Fix: KSM-1186 - On Windows, click's built-in argument expansion (default since click 8.0) silently corrupted secret values passed on the command line:
%VAR%/$VARwere expanded against the environment and$$was collapsed to$before the CLI ever parsed them, sopassword=a$$bwas stored asa$bandlogin=x%OS%yasxWindows_NTy. The same expansion also causedksm execto deliver raw, unresolved notation to the child process instead of the resolved secret. The CLI now disables this expansion; macOS and Linux are unaffected, since the expansion was always Windows-only. - Fix: KSM-1191 - Four AWS sync methods in
sync.pyused a mutable list (maps: list = []) as a default argument. Python evaluates that default once at function-definition time and shares it across every call that omits the argument, so state could leak between unrelated sync calls. The default is nowOptional[list] = None, normalized to an empty list per call. - Security: KSM-1183 -
ksm init k8s --applypassed--nametokubectlas a positional argument with no validation, so a value beginning with-was consumed bykubectlas one of its own flags rather than as the secret name.--nameis now validated against the RFC 1123 subdomain rule Kubernetes applies to Secret names (lowercase alphanumeric characters,-or., each.-separated label starting and ending alphanumeric, at most 253 characters total) before the one-time token is redeemed, and the check covers the manifest output as well as--apply. Names Kubernetes would have rejected anyway (uppercase, underscores, leading or trailing-) now fail immediately with a message naming the rule instead of reachingkubectl, the Kubernetes API, or burning the token on a typo. Names that are legal in Kubernetes but ambiguous in YAML 1.1 (y,n,1e5, etc.) are now always quoted in the manifest output sokubectl applyreads them as strings.
1.4.0
- Fix: KSM-975 - Binary install keyring warning gave pip install advice that does not apply to a frozen binary; bracket syntax in the pip advice also caused zsh glob errors. Now detects
sys.frozento show binary-appropriate help text and single-quotes the bracket expression for zsh compatibility. - Fix: KSM-1014 - The frozen-binary keyring-unavailable warning told users to download a non-existent
-keyringversion of the binary. Keyring ships as the selectable "OS Keyring Support" component inside the single installer on every OS, so the warning now directs users to re-run the installer and enable that component. - Fix: KSM-980 - Binary install created
keeper.iniin the current working directory instead of the user's home directory. Now detectssys.frozeninConfig.get_default_ini_file()and uses$HOME/%USERPROFILE%for binary installs, matching the existinglaunched_from_appbehaviour. - Fix: KSM-981 -
ksm secret getdid not surface linked records (PAM credential records were invisible). Now passesrequest_links=Trueto the server so linked record UIDs are returned, includes alinksarray in JSON output, and shows a Links table in text output. - Fix: KSM-1015 - links output made interpretable. Each link entry in JSON output gains a
decodedobject (plain link data parsed;ai_settings/jit_settingsdecrypted with the record key via the SDK'sKeeperRecordLink), while the rawrecordUid/data/pathfields are preserved untouched. The text Links table now shows three columns - Linked Record UID (self-links labeled(self)), Path, and decoded Link Data - so PAMmetasettings and AI/JIT configuration are distinguishable from links to other records. Requires keeper-secrets-manager-core >= 17.3.0. - Fix: KSM-1003 - Binary install wrote
ksm_cache.binto the current working directory when caching was enabled (sibling to KSM-980). The CLI now setsKSM_CACHE_DIRto the same directory it resolves forkeeper.inibefore loading the SDK core, so the cache co-locates with the ini in$HOME/%USERPROFILE%for binary installs; pip/source installs are unchanged. - Fix: KSM-1005 -
ksm shellcrashed on launch (UpdateChecker.check() takes 1 positional argument but 3 were given) on any fresh install after theupdate-checker1.0.0 release madecheck()keyword-only. The CLI now calls it with keyword arguments (compatible with both 0.18.0 and 1.0.0, no version pin needed), and theshellstartup update check is wrapped in try/except so a failed update check can never block the shell from starting.
1.3.0
- Feature: KSM-800 - OS-native keyring storage for CLI configuration
- New profiles store configuration in the OS keyring by default (macOS Keychain, Windows Credential Manager, Linux Secret Service)
- Existing
keeper.iniprofiles continue to work without migration - Added
--ini-fileflag to opt into explicit file-based storage - Added
keyringas an optional dependency:pip install keeper-secrets-manager-cli[keyring]
- Fix: KSM-814 -
--ini-fileflag now respected by all profile and config subcommands:profile list,profile active,profile export,profile import,profile init,profile setup;config show,config color,config cache,config record-type-dir,config editor - Fix: KSM-691 - keeper.ini now written with owner-only permissions (0600)
- Breaking: KSM-799, KSM-817 - Minimum Python raised from 3.7 to 3.10
- Breaking: KSM-817 - boto3 is now an optional dependency; AWS sync users must install the
[aws]extra:pip install keeper-secrets-manager-cli[aws] - Dependency: Updated keeper-secrets-manager-core to >=17.2.0 and keeper-secrets-manager-helper to >=1.1.0
- Security: KSM-761 - Fixed CVE-2026-23949 (jaraco.context path traversal vulnerability)
- Fix: Updated prompt-toolkit from ~=2.0 to >=3.0 (fixes dependency resolution conflicts)
- Fix: KSM-804 - Warn on stderr when keyring is active but empty and a keeper.ini file exists at CWD or standard locations, including hint to use
--ini-file - Fix: KSM-805 - SHA-256 integrity hash now persisted as a separate Keychain entry and verified on every load; tampered entries raise a
KsmCliIntegrityExceptionwith a clear recovery hint - Fix: KSM-810 - Added
ksm profile delete <name>command; fixed keyring storage to clear the active profile pointer when the active profile is deleted, preventing a broken state on subsequent invocations - Fix: KSM-702 - Record create payload now always includes
custom: []; previously the key was silently omitted when no custom fields were set - Fix: KSM-815 - Profile name is now validated before redeeming the one-time token; invalid names (containing whitespace or exceeding 64 characters) are rejected immediately, preventing the token from being consumed on a failed init
- Fix: KSM-818 -
ksm shellno longer crashes on any command when click>=8.2 is installed; pinned click-repl to <0.3.0 (0.3.0 incompatible with click>=8.2) - Fix: KSM-820 -
ksm secret get --jsonnow outputs custom fields under"custom"key (was"custom_fields"), matching the canonical V3 record format used by Commander and the Keeper Vault - Fix: KSM-828 - Unit tests no longer write mock data to the real system keyring; added
KeyringConfigStorage.is_availablemock to all tests that callProfile.init()as scaffolding (secret_test.py,exec_test.py,secret_inflate_test.py) - Fix: KSM-829 - Profile name validation before OTT redemption now uses the same strict pattern as keyring storage (
[a-zA-Z0-9_-]{1,64}); previously the early check allowed path-traversal characters and special characters through, consuming the one-time token before the stricter validator fired - Fix: KSM-831 -
--ini-fileno longer fails withMissing import dependencies: boto3for non-AWS profiles;AwsConfigProviderimport is now deferred to theawsstorage branch in_load_config, so users without the[aws]extra are unaffected - Fix: KSM-832 - removed lkru utility integration;
is_available()now correctly returnsFalsewhenkeyringis not installed or no Secret Service daemon is running, falling back tokeeper.inifile storage in both cases
1.2.0
- KSM-649 Added AWS KMS JSON support for sync command
- KSM-465 Implemented ksm interpolate command for shell built-in compatibility
1.1.7
- KSM-668 Restored ? command to cli
1.1.6
- KSM-558 Fixed crashes with mutually required options in shell mode
- KSM-567 Added KSM_CLI_TOKEN environment variable
- KSM-568 Removed dependency on legacy distutils
- KSM-644 Added delete-attachment option
- Bumping KSM SDK to 17.0.0 and helper module to 1.0.6
1.1.5
- Bumping KSM SDK to 16.6.5
1.1.4
- KSM-507: Added
ksm secret deletecommand - KSM-508: Added search by title to
ksm secret listcommand - KSM-509: Added
ksm folder ...commands
1.1.3
- KSM-496: Added upload file option
- KSM-495: Added query option to ksm secret list command
- KSM-494: Added folder support to secret list command
- KSM-493: Added CLI options to update title and notes
- KSM-492: Added clone option
- KSM-485: Added sub-folder support to ksm secret add command
1.1.1
- KSM-429 - Add
--profile-nametoksm profile importcommand
1.1.0
- KSM-395 - New feature to load configurations from AWS Secrets Manager
1.0.17
- KSM-392 - Ability to update fields where the label is a blank string (
"") - Pinned KSM Core version to 16.5.1
1.0.16
- KSM-362 - Synchronize secrets to GCP
- Dropped support for Python 3.6 (EOL 2021-12-23)
1.0.15
- Update pinned KSM SDK version. The KSM SDK has been updated to use OpenSSL 3.0.7 which fixes CVE-2022-3602, CVE-2022-3786.
1.0.14
- Accept JSON via the KSM_CONFIG environmental variable. K8S secrets will show up as JSON in the environmental variable.
- Add
--rawparameter tosecret getcommand. When using--querythis flag will remove the double quotes around the value, if a string. - Add
synccommand to sync Vault secrets to AWS and Azure secret managers.
1.0.13
- For the Windows and macOS application create the keeper.ini file in the user's "HOME" directory.
1.0.12
- Fix problem with the same temp file being opened when exporting profile. Was causing a
Permission deniederror.
1.0.11
- Fix missing linefeed when selecting
immutablefor k8s token init.
1.0.10
- Prevent keeper.ini from being created when using config from environment variables.
- Fixed problem with params that use '=' from converting the value to lowercase.
- Throw exception is record(s) do not exist for
get
1.0.9
- Fixed environment variables starting with "keeper", that are not notation, from throwing an error.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file keeper_secrets_manager_cli-1.5.0.tar.gz.
File metadata
- Download URL: keeper_secrets_manager_cli-1.5.0.tar.gz
- Upload date:
- Size: 98.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
13e2a6fc074a82d10aaeb0b2856291997ac2bcded09e80165e7d5d7288910b28
|
|
| MD5 |
1c365b4aa19bb21ed7233f4b27bb6b7c
|
|
| BLAKE2b-256 |
68984f01d04e3e492be294f6a1a37e43abb8b62565c33952532d6b05d2f3e591
|
Provenance
The following attestation bundles were made for keeper_secrets_manager_cli-1.5.0.tar.gz:
Publisher:
publish.ksm.cli.yml on Keeper-Security/secrets-manager-cli-binaries
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
keeper_secrets_manager_cli-1.5.0.tar.gz -
Subject digest:
13e2a6fc074a82d10aaeb0b2856291997ac2bcded09e80165e7d5d7288910b28 - Sigstore transparency entry: 2454736134
- Sigstore integration time:
-
Permalink:
Keeper-Security/secrets-manager-cli-binaries@daa840b3699c0e9ea21a30ee019fcb0203ee6f37 -
Branch / Tag:
refs/heads/cli-1.5.0 - Owner: https://github.com/Keeper-Security
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.ksm.cli.yml@daa840b3699c0e9ea21a30ee019fcb0203ee6f37 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file keeper_secrets_manager_cli-1.5.0-py3-none-any.whl.
File metadata
- Download URL: keeper_secrets_manager_cli-1.5.0-py3-none-any.whl
- Upload date:
- Size: 96.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab2bf4c348924a2f2e6718030d93cd4a05190e6741fdc0532c0673cd86bc12a4
|
|
| MD5 |
14882a5db42a8321ad237e85113432d4
|
|
| BLAKE2b-256 |
45e41ef5ec81ed5541855fa60c37b2665d21901c754592bf410bd751bbc450ad
|
Provenance
The following attestation bundles were made for keeper_secrets_manager_cli-1.5.0-py3-none-any.whl:
Publisher:
publish.ksm.cli.yml on Keeper-Security/secrets-manager-cli-binaries
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
keeper_secrets_manager_cli-1.5.0-py3-none-any.whl -
Subject digest:
ab2bf4c348924a2f2e6718030d93cd4a05190e6741fdc0532c0673cd86bc12a4 - Sigstore transparency entry: 2454736314
- Sigstore integration time:
-
Permalink:
Keeper-Security/secrets-manager-cli-binaries@daa840b3699c0e9ea21a30ee019fcb0203ee6f37 -
Branch / Tag:
refs/heads/cli-1.5.0 - Owner: https://github.com/Keeper-Security
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.ksm.cli.yml@daa840b3699c0e9ea21a30ee019fcb0203ee6f37 -
Trigger Event:
workflow_dispatch
-
Statement type: