Skip to main content

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.

  1. Install/prepare the CLI (komainu-sync).
  2. Create a .komainu.json file in your repo (or a parent folder).
  3. Push one or more files to initialize/verify mapping.
  4. 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_TOKEN environment variable (recommended).
  • Optional fallback: access_token in .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 Cursor flow), 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.
  • 401/403 from backend:
    • KOMAINU_ACCESS_TOKEN is missing/expired/invalid.
  • 404/5xx from backend:
    • check api_base_url and backend availability.

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

komainu_sync-0.1.0.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

komainu_sync-0.1.0-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

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

Hashes for komainu_sync-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7736b506790a7025e781963ad24f7522c263796b2300243fad1c942e0ba1d49b
MD5 21c86aecc339c91b3972a46aa471f065
BLAKE2b-256 be0a6a11fba02160149062777028bbea14f6785fde61122ca63047ec1cb7bc29

See more details on using hashes here.

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

Hashes for komainu_sync-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c01dde1a2086a8e72da77cc808e13b2aa5503fed35857e6f177b60be01d27eee
MD5 f69c29c41a625387593473ea04579454
BLAKE2b-256 d31e7ed72b980d1b184c136fabdae90f9e358b93e4fc6283a807f3436ee200e8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page