Local CLI for syncing test files from disk to KomAInu backend.
Project description
komainu-sync
komainu-sync is the local CLI that sends your local test files to KomAInu backend.
Think of it this way:
- your machine reads files from disk,
- KomAInu backend stores/snapshots them,
- MCP can trigger this CLI, but does not read file contents itself.
User Story (first-time setup)
You are a user with local tests in a folder and want KomAInu to keep a synced server copy.
- Install/prepare the CLI (
komainu-sync). - Create a
.komainu.jsonfile in your repo (or a parent folder). - Push one or more files to initialize/verify mapping.
- Continue syncing only changed files after edits.
1) Configure .komainu.json
komainu-sync searches for .komainu.json from your current directory upward.
Example:
{
"api_base_url": "https://your-komainu-api.example.com",
"tests_root": "./tests"
}
Fields:
api_base_url: URL of your KomAInu backend.tests_root: local root folder used to compute relative paths.
Token source (same as komainu-mcp):
KOMAINU_ACCESS_TOKENenvironment variable (recommended).- Optional fallback:
access_tokenin.komainu.json.
komainu-sync and komainu-mcp both use the same token variable:
KOMAINU_ACCESS_TOKEN
How to obtain it:
- From KomAInu web app MCP page (
Add to Cursorflow), or - by creating an MCP token via backend (
/mcp/tokens/...) and reusing it.
Important:
- You do not provide backend storage paths.
- Backend path is always derived from local path relative to
tests_root.
Example mapping:
- local file:
./tests/smoke/login.xml - sent as backend
relative_path:smoke/login.xml
2) Sync commands
- Push one file:
komainu-sync push-file tests/smoke/login.xml
- Push multiple files:
komainu-sync push-files tests/smoke/login.xml tests/regression/order.xml
- Delete one file remotely:
komainu-sync delete-file tests/legacy/old_case.xml
Each command calls backend endpoint:
POST /workspace/tests/sync
3) Typical workflow after setup
- You edit local test files.
- You push only changed files (
push-file/push-files). - If a file is removed locally and should be removed server-side, run
delete-file.
This keeps sync incremental and fast (no full re-upload each time).
Troubleshooting
Missing .komainu.json:- create it in your repo (or run command from a child directory).
Path is outside tests_root:- file must be inside configured
tests_root.
- file must be inside configured
401/403from backend:KOMAINU_ACCESS_TOKENis missing/expired/invalid.
404/5xxfrom backend:- check
api_base_urland backend availability.
- check
Notes for MCP users
When called through MCP tools, the same CLI is used under the hood.
MCP passes only file paths; file reading is still done locally by komainu-sync.
Project details
Release history Release notifications | RSS feed
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 komainu_sync-0.1.0.tar.gz.
File metadata
- Download URL: komainu_sync-0.1.0.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7736b506790a7025e781963ad24f7522c263796b2300243fad1c942e0ba1d49b
|
|
| MD5 |
21c86aecc339c91b3972a46aa471f065
|
|
| BLAKE2b-256 |
be0a6a11fba02160149062777028bbea14f6785fde61122ca63047ec1cb7bc29
|
File details
Details for the file komainu_sync-0.1.0-py3-none-any.whl.
File metadata
- Download URL: komainu_sync-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c01dde1a2086a8e72da77cc808e13b2aa5503fed35857e6f177b60be01d27eee
|
|
| MD5 |
f69c29c41a625387593473ea04579454
|
|
| BLAKE2b-256 |
d31e7ed72b980d1b184c136fabdae90f9e358b93e4fc6283a807f3436ee200e8
|