CipherCLI is a local command-line client for the Cipher service. It can create Fernet keys, encrypt or decrypt files through the loopback HTTP API, and query the service health endpoint with cip health.
CipherCLI is designed to run on the same machine as Cipher. It talks to 127.0.0.1 for both the Cipher API and the DiskIdentifier service used to resolve ultimate paths. The ports are read from resources/configuration.json.
CipherCLI is a client for the web-service Cipher (https://www.github.com/LorenBll/Cipher).
- Install the Python dependencies with
pip install -r requirements.txt. - Make sure the Cipher service is running locally before using
c,d, orhealth. - DiskIdentifier is optional — CipherCLI works without it. If you want to use ultimate paths, run DiskIdentifier locally so CipherCLI can resolve them via the configured
diskidentifierPort. - Keep the project structure intact so the CLI can find
resources/andsrc/.
- Windows: run
scripts\cip.bat. - Unix-like systems: run
bash scripts/cip.sh. - Manual: run
python src/main.pyfrom the project root.
Create a new Fernet key file through POST /api/key.
pathcan be either:- an absolute file path for the new key, or
- an absolute directory path when
file_nameis provided.
file_namemust be a simple file name with no path components.
Example:
cip ck C:\Cipher\keys mykey.keycip c <key_path> <file_path...> [--encrypt-file-name] [--overwrite-file] [--output-file-path|--output-file-paths|--output-dir] [--files-list <path>]
Encrypt one or more files through POST /api/encrypt.
key_pathmust reference an existing key file.file_pathaccepts one or more absolute file paths. Cannot be combined with--files-list.--files-listpath to a text file listing absolute file paths to encrypt. Items can be separated by newlines, commas, or semicolons. Cannot be combined with positionalfile_patharguments.--encrypt-file-nameencrypts output file names. Applies to all input files. Cannot be combined with--output-file-pathor--output-file-paths.--overwrite-filewrites encrypted content into the source file (in-place). Applies to all input files. Cannot be combined with--output-file-path,--output-file-paths, or--output-dir.--output-file-pathis a single absolute output path for one input file. Cannot be combined with--encrypt-file-name,--overwrite-file, or--output-dir.--output-file-pathsis a list of absolute paths, one per input file. Cannot be combined with--encrypt-file-name,--overwrite-file, or--output-dir.--output-diris an output directory; the CLI generatesoutput_dir / input_file.namefor each input file and sends them asoutput_file_paths. Cannot be combined with--overwrite-file,--output-file-path, or--output-file-paths. Compatible with--encrypt-file-name.- Note: when none of
--encrypt-file-name,--overwrite-file,--output-file-path,--output-file-paths, or--output-dirare provided and--encrypt-file-name/--overwrite-fileare false, you must supply one of the output path options per the Cipher API requirements. - All of the flags above (
--encrypt-file-name,--overwrite-file,--output-dir) apply globally to every file in the batch, whether specified as positional arguments or via--files-list. - After the task is queued, the CLI polls
GET /api/task/<task_id>until the job finishes.
cip d <key_path> <file_path...> [--decrypt-file-name] [--overwrite-file] [--output-file-path|--output-file-paths|--output-dir] [--files-list <path>]
Decrypt one or more files through POST /api/decrypt.
key_pathmust reference an existing key file.file_pathaccepts one or more absolute file paths. Cannot be combined with--files-list.--files-listpath to a text file listing absolute file paths to decrypt. Items can be separated by newlines, commas, or semicolons. Cannot be combined with positionalfile_patharguments.--decrypt-file-namedecrypts output file names. Applies to all input files. Cannot be combined with--output-file-pathor--output-file-paths.--overwrite-filewrites decrypted content into the source file (in-place). Applies to all input files. Cannot be combined with--output-file-path,--output-file-paths, or--output-dir.--output-file-pathis a single absolute output path for one input file. Cannot be combined with--decrypt-file-name,--overwrite-file, or--output-dir.--output-file-pathsis a list of absolute paths, one per input file. Cannot be combined with--decrypt-file-name,--overwrite-file, or--output-dir.--output-diris an output directory; the CLI generatesoutput_dir / input_file.namefor each input file and sends them asoutput_file_paths. Cannot be combined with--overwrite-file,--output-file-path, or--output-file-paths. Compatible with--decrypt-file-name.- Note: when none of
--decrypt-file-name,--overwrite-file,--output-file-path,--output-file-paths, or--output-dirare provided and--decrypt-file-name/--overwrite-fileare false, you must supply one of the output path options per the Cipher API requirements. - All of the flags above (
--decrypt-file-name,--overwrite-file,--output-dir) apply globally to every file in the batch, whether specified as positional arguments or via--files-list. - The CLI polls task status until the job completes or fails.
Query GET /api/health on the local Cipher service and print the returned data.
This is useful for checking the configured port, task counts, host information, and other health metadata exposed by the service.
The CLI reads resources/configuration.json for these settings:
cipherPort: port used for the Cipher API.diskidentifierPort: port used for DiskIdentifier.
-
Paths may be provided as raw absolute paths or as ultimate paths when DiskIdentifier is available.
-
The CLI is local-only and expects services to be reachable on the loopback interface.
-
DiskIdentifier is not required for CipherCLI to function. When DiskIdentifier is running and reachable on the loopback interface (see
diskidentifierPortin resources/configuration.json), CipherCLI can resolve "ultimate" paths by querying DiskIdentifier.