@aliaksandarpratashchyk/kickcat 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Aliaksandar Pratashchyk <aliaksandarpratashchyk@gmail.com>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,95 @@
1
+ # ⚙️ KickCat – GitHub metadata IaC CLI
2
+
3
+ ![Tests](https://github.com/aliaksandarpratashchyk/kickcat/actions/workflows/unit-tests.yml/badge.svg)
4
+ [![Coverage](./coverage.svg)](./COVERAGE.md)
5
+ ![E2E](https://github.com/aliaksandarpratashchyk/kickcat/actions/workflows/e2e-tests.yml/badge.svg)
6
+
7
+ KickCat keeps GitHub metadata (milestones, labels, issues) as YAML and syncs it with a GitHub repository or a file-based store. It preserves schema-driven ordering and hash comments so you can review changes as code.
8
+
9
+ ## What it does
10
+
11
+ - Manage milestones, labels, and issues as YAML with `$schema` + `hash` comments.
12
+ - Sync between local YAML and GitHub: new entities are created, remote-only entities delete the local copy, matching hashes are skipped, conflicts pull remote data back locally.
13
+ - Two-pass push resolves references (issue → milestone/label/issue) to primary keys, then syncs the final state back to local.
14
+ - Delete entities locally with optional dependency cleanup and repair storages by recalculating hashes/ordering.
15
+ - Works with a single YAML file or a folder; falls back to `hub.yml`/`shared.yml` when entity files are missing.
16
+ - Ships reusable GitHub Actions workflows (install via the `setup` command).
17
+
18
+ ## Install & build
19
+
20
+ - `npm install`
21
+ - `npm run build` (outputs `dist/bundle.js`)
22
+ - Run via `npx kickcat …` or `npx kickcat …` after building.
23
+
24
+ ## Configuration
25
+
26
+ - **Logging:** `--log-level [debug|info|warn|error|off]` (default: `off`)
27
+ - **Local storage:** `--local-storage` or `KICKCAT_LOCAL_STORAGE` (YAML file/folder, defaults to the current working directory).
28
+ - **Remote storage:**
29
+ - GitHub (default): set `GITHUB_TOKEN` (or pass `--git-hub-token`) and repo/owner derived from the current git remote or `GITHUB_REPOSITORY`.
30
+ - File-based: `--remote-storage` or `KICKCAT_REMOTE_STORAGE` to point at another YAML file/folder.
31
+
32
+ Registered entity types: `milestone`, `label`, `issue`.
33
+
34
+ ## Commands
35
+
36
+ - `help [--command=<path>]` — list commands or show details.
37
+ - `setup [--rewrite]` — copy bundled workflows from `templates/workflows` into `.github/workflows` (skips existing files unless `--rewrite`).
38
+ - `entity pull --of=<entity> --key=<field> --value=<value> [--local-storage=…] [--remote-storage=…]` — pull one entity from remote into local.
39
+ - `entity push all [--of=<entity>] [--local-storage=…] [--remote-storage=…] [--force]` — push everything (or one type) from local to remote with hash-aware conflict handling; `--force` always pushes local data.
40
+ - `entity delete --of=<entity> --key=<field> --value=<value> [--local-storage=…] [--correct-dependencies=<true|false>]` — delete locally and optionally clean references.
41
+ - `repair [--local-storage=…]` — rewrite local storage to refresh hashes/ordering.
42
+
43
+ ### Examples
44
+
45
+ - Pull milestone `number: 1` into local:
46
+ `npx kickcat entity pull --of=milestone --key=number --value=1 --local-storage=./hub.yml`
47
+ - Push all labels to GitHub with verbose logs:
48
+ `npx kickcat entity push all --of=label --log-level=info`
49
+ - Force-push issues even when hashes match:
50
+ `npx kickcat entity push all --of=issue --force`
51
+ - Delete a local label named `chore` and clean dependents:
52
+ `npx kickcat entity delete --of=label --key=name --value=chore --local-storage=./hub.yml`
53
+ - Install bundled workflows into your repo:
54
+ `npx kickcat setup --rewrite`
55
+ - Normalize hashes/formatting in your local store:
56
+ `npx kickcat repair --local-storage=./hub.yml`
57
+
58
+ ## Storage format
59
+
60
+ Entities are stored as separate YAML documents with schema/hash metadata and schema-driven ordering:
61
+
62
+ ```yaml
63
+ # type: milestone
64
+ # yaml-language-server: $schema=../schemas/milestone.schema.yml
65
+ # hash: 4fa572887b9ba72d4e9dc8d9b9f1ddc4
66
+ number: 1
67
+ title: Planning
68
+ dueDate: 2024-01-05
69
+ state: closed
70
+ description: |
71
+
72
+
73
+ ---
74
+ # type: label
75
+ # yaml-language-server: $schema=../schemas/label.schema.yml
76
+ # hash: f2cdb191e760308bcda9a7be56d83c51
77
+ name: priority:high
78
+ color: d73a4a
79
+ description: High priority work
80
+
81
+ ---
82
+ # type: issue
83
+ # yaml-language-server: $schema=../schemas/issue.schema.yml
84
+ # hash: 2b88953d87ea3a49de9591c1173ccf8c
85
+ number: 12
86
+ title: Implement milestone sync
87
+ milestone: 1
88
+ labels:
89
+ - priority:high
90
+ dependencies: []
91
+ description: |
92
+ Sync GitHub milestones with local YAML state.
93
+ ```
94
+
95
+ KickCat preserves these comments and uses hashes to decide whether to update local or remote entries during sync.\*\*\*