You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This reference is grounded in the repository's source code and generated API spec files. It covers the implemented Python SDK, REST API, gRPC API, GraphQL adapter surface, CLI commands, and runtime configuration model.
The GraphQL surface in this repository is client-side only. The adapter in src/adapters/graphql_adapter/graphql_client.py expects a server at src.api.graphql_api, but no server-side GraphQL schema file was present in the repository at the time of writing.
Python SDK
The primary SDK entry point is KeyCrypt from src/sdk/python_sdk_complete.py. It exposes a stateful KeyCryptSDK facade and a module-level singleton.
Public Types
Type
Purpose
KeyCryptSDK
Main SDK facade for file encryption, decryption, batch encryption, stream encryption, policy selection, and provider selection.
Encrypt resolves a key from either inline key material, key_id, or generated defaults.
Decrypt accepts either inline key material or key_id lookup.
GenerateKey returns key metadata and raw key material.
StreamEncrypt accepts a stream of numbered chunks, sorts them by chunk_id, encrypts each chunk separately, and returns a concatenated payload plus JSON metadata.
The server installs authentication, logging, and error-handling interceptors.
gRPC auth
The server expects bearer token metadata in authorization.
Missing or invalid tokens produce UNAUTHENTICATED responses.
Execute multiple queries as a batch when the transport supports it.
query_async(graphql_query, variables=None)
Async query execution.
mutation_async(graphql_mutation, variables=None)
Async mutation execution.
batch_query_async(queries)
Async batch execution.
subscribe(subscription, variables=None)
Async subscription stream.
close() / aclose()
Close pooled sessions and clear cache.
Client capabilities
Supports HTTP and WebSocket transports when gql transports are installed.
Maintains pooled query and subscription sessions.
Applies TTL-based query caching.
Supports Authorization headers via access_token.
Falls back to per-request execution when batch transport support is unavailable.
GraphQL scope limitation
No schema, query, mutation, or subscription definitions were found under src/api/ for a server implementation. For that reason, this reference documents the adapter contract only.
CLI Reference
The CLI entry point is src/cli/main.py. It registers the core commands plus the advanced and interactive extensions.
Global options
Option
Description
--verbose
Enable verbose logging.
--json
Emit machine-readable JSON output.
Core commands
Command
Description
encrypt
Encrypt a file and write ciphertext plus a metadata sidecar.
decrypt
Decrypt a file using metadata or --key-id.
keygen
Generate a new key entry and print non-secret metadata.
status
Show security state, active keys, and runtime metrics.