Manage local SSH config alongside a remote key repository.
Project description
keywharf
keywharf is a Python 3.11+ CLI for selecting remote SSH host definitions into a local desired state, then materializing only manager-owned SSH artifacts.
It manages only:
- one explicit local state file
- one managed SSH config fragment
- one managed key directory
It does not take over the user's whole ~/.ssh/config. Only install-include may minimally append one Include block to the main SSH config.
Recommended Workflow
keywharf --data-root ~/keywharf init
keywharf --data-root ~/keywharf pull
keywharf --data-root ~/keywharf remote host list
keywharf --data-root ~/keywharf remote host show demo
keywharf --data-root ~/keywharf remote host add demo --hostname demo.example.com --user fox --identity-file keys/id_demo
keywharf --data-root ~/keywharf select demo --endpoint public --auth home
keywharf --data-root ~/keywharf validate
keywharf --data-root ~/keywharf render
keywharf --data-root ~/keywharf apply
keywharf --data-root ~/keywharf install-include
If the manager config lives outside the default workspace root, use --config <path> instead of --data-root.
Ownership Boundary
keywharf manages:
state_pathmanaged_config_pathmanaged_keys_dir
keywharf does not manage:
- unrelated
Hostentries in the main SSH config Matchblocks- other
Includelines - user comments and ordering in the main SSH config
Workspace Discovery
Workspace resolution is explicit and predictable:
--data-rootKEYWHARF_DATA_ROOT- current directory, if it already contains both the
KEYWHARF_DATA_ROOTmarker andconfig.json - nearest ancestor workspace marker
~/keywharf- fail with the checked candidate paths listed
keywharf init creates the marker, config.json, state/state.json, directory skeleton, and small workspace text files from package resources.
Formal Config And Templates
Manager config is a formal runtime config:
- defaults come from
pkg://keywharf/config_defaults/manager.json - file or mapping input is override only
- defaults and overrides are deep-merged before Pydantic v2 validation
- runtime path resolution is separate from raw config loading
Resource roles are intentionally split:
config_defaults/*.json: formal defaults for manager configtemplates/*.json: structured starter data such as the empty state filetemplates/*.j2: human-facing text templates such as workspaceREADME.md, workspace.gitignore, and the include block text
Remote Host CRUD
remote host edits only the local checkout copy of the remote repository config:
remote host listremote host showremote host addremote host updateremote host remove
These commands do not commit, push, or mutate git metadata. They perform structured JSON reads/writes, preserve array order, and revalidate the resulting host set before writing.
This round only adds Host-level CRUD. ExtraConfig is preserved and rendered, but it is not exposed as a CLI editor yet.
--sudo
Mutating commands support --sudo:
initpullselectdeselectapplyinstall-includeremote host addremote host updateremote host remove
Privilege handling is centralized:
- normal writable paths run without sudo
- unwritable paths fail fast with concrete path-based reasons
--sudore-execs the full command throughsudo
Installation
python3.11 -m venv .venv
. .venv/bin/activate
python -m pip install -e '.[dev]'
pytest
Runtime requirements:
- Python 3.11+
- system
git
Documentation
Project details
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 keywharf-1.0.1.tar.gz.
File metadata
- Download URL: keywharf-1.0.1.tar.gz
- Upload date:
- Size: 46.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f88e15d6dbdc45cf86be9fb80edba67b1c52a7525ad7dfeb37c610a73c529e8c
|
|
| MD5 |
dabf67fe43bdf4a1f3702e130e344941
|
|
| BLAKE2b-256 |
f868b9b3d14e13cb7717494c0b890ea3fa1ff02852d5873046226273a95ec751
|
Provenance
The following attestation bundles were made for keywharf-1.0.1.tar.gz:
Publisher:
publish.yml on eserie-fox/keywharf
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
keywharf-1.0.1.tar.gz -
Subject digest:
f88e15d6dbdc45cf86be9fb80edba67b1c52a7525ad7dfeb37c610a73c529e8c - Sigstore transparency entry: 1261973153
- Sigstore integration time:
-
Permalink:
eserie-fox/keywharf@a828413fa50943e5a056e3ef924798c93d4d2bfa -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/eserie-fox
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a828413fa50943e5a056e3ef924798c93d4d2bfa -
Trigger Event:
push
-
Statement type:
File details
Details for the file keywharf-1.0.1-py3-none-any.whl.
File metadata
- Download URL: keywharf-1.0.1-py3-none-any.whl
- Upload date:
- Size: 60.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
af75523fbf6d73ff15befc5d07197564e4fce418fb7a9bf726f40b780abf9c32
|
|
| MD5 |
0b0e227b1b1ad8d9589504a29aa78eab
|
|
| BLAKE2b-256 |
e4d7b085ac59a58a8f9018647ee888f0c7c4742d74ae2e1d3b599fce2ba3ab47
|
Provenance
The following attestation bundles were made for keywharf-1.0.1-py3-none-any.whl:
Publisher:
publish.yml on eserie-fox/keywharf
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
keywharf-1.0.1-py3-none-any.whl -
Subject digest:
af75523fbf6d73ff15befc5d07197564e4fce418fb7a9bf726f40b780abf9c32 - Sigstore transparency entry: 1261973184
- Sigstore integration time:
-
Permalink:
eserie-fox/keywharf@a828413fa50943e5a056e3ef924798c93d4d2bfa -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/eserie-fox
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a828413fa50943e5a056e3ef924798c93d4d2bfa -
Trigger Event:
push
-
Statement type: