@kanera/cli 1.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/README.md ADDED
@@ -0,0 +1,132 @@
1
+ # `kanera` CLI
2
+
3
+ Manage Kanera work from a terminal, or from any AI agent that can run shell commands.
4
+
5
+ ## Install
6
+
7
+ Requires Node 22 or newer. The package has no dependencies.
8
+
9
+ ```bash
10
+ npm install --global @kanera/cli
11
+ ```
12
+
13
+ ## Authenticate
14
+
15
+ You need a Kanera API key. Create one in the Kanera web app under **Settings → API keys**
16
+ (personal keys, scoped read-only or read-write), or in **workspace settings** for a key tied to a
17
+ workspace rather than a person. Choose **read-only** if the credential is for an AI agent that
18
+ should not change anything.
19
+
20
+ ```bash
21
+ kanera auth login # opens the API-keys page, then prompts for the key and stores it
22
+ kanera whoami # who am I, and what may this credential do?
23
+ ```
24
+
25
+ In CI or an agent sandbox, skip the stored profile and set `KANERA_API_KEY` instead. Self-hosting?
26
+ Point at your deployment with `--url https://api.your-kanera.example` during login (it is saved
27
+ with the profile) or via `KANERA_PUBLIC_API_URL`.
28
+
29
+ ## Use
30
+
31
+ ```bash
32
+ kanera commands # everything this CLI can do (works before login)
33
+ kanera work # your assignments across every accessible board
34
+ kanera card MKT-42 # a card, by key, id, or URL
35
+ kanera card done MKT-42 # mark it complete
36
+ kanera comment MKT-42 "Shipped."
37
+ kanera doctor # diagnose credentials and connectivity
38
+ ```
39
+
40
+ ## How it is built
41
+
42
+ The CLI does not re-implement the public API. It opens an **in-process MCP session** against the
43
+ same tool layer `@kanera/mcp` serves over HTTP and stdio, then exposes those tools as commands.
44
+ Nothing crosses a socket — `InMemoryTransport` links the two ends directly.
45
+
46
+ That choice is the point: card-reference resolution (`MKT-42`), cursor encoding, response size
47
+ caps, and every tool description already live in that layer, so the CLI's command surface cannot
48
+ drift from what agents see over MCP, and a newly added tool is callable from the shell the day it
49
+ ships.
50
+
51
+ - `src/aliases.ts` gives the high-traffic tools ergonomic names (`kanera card done MKT-42`). It is
52
+ a convenience layer, not the surface; a test asserts every alias targets a real tool and only
53
+ maps arguments that tool accepts.
54
+ - `kanera call <tool>` reaches anything the alias table does not cover.
55
+ - `kanera commands --json` is the machine-readable catalog agents use to discover the rest.
56
+
57
+ ## Credentials
58
+
59
+ Resolution order: `--api-key`, then `KANERA_API_KEY`, then a stored profile.
60
+
61
+ Profiles live in `~/.config/kanera/config.json` (mode `600`). Named profiles let one machine hold
62
+ several identities:
63
+
64
+ ```bash
65
+ kanera auth login --profile agent --api-key kanera_u_…
66
+ kanera --profile agent work --json
67
+ ```
68
+
69
+ The non-secret, committable per-repo profile selection goes in `.kanera/config.json`:
70
+
71
+ ```json
72
+ { "profile": "agent" }
73
+ ```
74
+
75
+ API origins are security-sensitive because they receive the bearer credential, so repository
76
+ configuration cannot set one. Use `--url`, `KANERA_PUBLIC_API_URL`, or the origin saved with a
77
+ profile during `auth login`. Non-loopback origins must use HTTPS.
78
+
79
+ ## Output
80
+
81
+ | Flag | Output |
82
+ | ---- | ------ |
83
+ | *(none)* | Human-readable tables and summaries |
84
+ | `--json` | `{ ok, tool, data }` envelope |
85
+ | `--quiet` | The bare result, for `jq` |
86
+
87
+ Failures always go to **stderr**, so redirecting stdout to a file never mixes an error envelope
88
+ into what the caller believes is result data.
89
+
90
+ Rate-limit and transient API failures include `retryable` and, when supplied by the server,
91
+ `retryAfter` fields in structured output.
92
+
93
+ ## Exit codes
94
+
95
+ | Code | Meaning |
96
+ | ---- | ------- |
97
+ | 0 | success |
98
+ | 1 | the request failed |
99
+ | 2 | bad usage |
100
+ | 3 | no valid credential |
101
+ | 4 | forbidden — often a read-only credential |
102
+ | 5 | not found |
103
+ | 6 | rate limited |
104
+
105
+ `4` is deliberately distinct from `1`: an agent holding a read-scoped key needs to tell "I may not
106
+ do this" apart from "this did not work", and stop rather than retry.
107
+
108
+ ## Arguments
109
+
110
+ Flags map onto tool arguments and are coerced using the tool's own JSON Schema, never by how the
111
+ value looks — a card key can look numeric and an id can look boolean.
112
+
113
+ Unknown flags, missing required arguments, malformed `--json-args`, and surplus positionals are
114
+ usage errors. The CLI never silently discards an operand.
115
+
116
+ ```bash
117
+ kanera card update MKT-42 --changes.title "Revised" # dots nest
118
+ kanera work --scope.boardIds[] abc --scope.boardIds[] def # repeat or [] for arrays
119
+ kanera call kanera_update_card --json-args '{"cardId":"MKT-42","changes":{"title":"Revised"}}'
120
+ ```
121
+
122
+ ## Agent setup
123
+
124
+ ```bash
125
+ kanera setup claude # writes .claude/skills/kanera/SKILL.md
126
+ kanera setup codex # appends Kanera instructions to AGENTS.md
127
+ kanera skill # print the portable Agent Skill document for another harness
128
+ kanera mcp # serve the same tools over stdio MCP, using the stored credential
129
+ ```
130
+
131
+ `kanera mcp` means a user who has already run `kanera auth login` does not configure a second
132
+ credential in a second place to use Kanera from an MCP client.
package/dist/LICENSE ADDED
@@ -0,0 +1,94 @@
1
+ # Elastic License 2.0 (ELv2)
2
+
3
+ ## Acceptance
4
+
5
+ By using the software, you agree to all of the terms and conditions below.
6
+
7
+ ## Copyright License
8
+
9
+ The licensor grants you a non-exclusive, royalty-free, worldwide,
10
+ non-sublicensable, non-transferable license to use, copy, distribute, make
11
+ available, and prepare derivative works of the software, in each case subject to
12
+ the limitations and conditions below.
13
+
14
+ ## Limitations
15
+
16
+ You may not provide the software to third parties as a hosted or managed
17
+ service, where the service provides users with access to any substantial set of
18
+ the features or functionality of the software.
19
+
20
+ You may not move, change, disable, or circumvent the license key functionality
21
+ in the software, and you may not remove or obscure any functionality in the
22
+ software that is protected by the license key.
23
+
24
+ Hosted mode, hosted billing, hosted entitlements, and any checks controlling
25
+ access to them are license key functionality for purposes of this license.
26
+
27
+ You may not alter, remove, or obscure any licensing, copyright, or other notices
28
+ of the licensor in the software. Any use of the licensor's trademarks is subject
29
+ to applicable law.
30
+
31
+ ## Patents
32
+
33
+ The licensor grants you a license, under any patent claims the licensor can
34
+ license, or becomes able to license, to make, have made, use, sell, offer for
35
+ sale, import and have imported the software, in each case subject to the
36
+ limitations and conditions in this license. This license does not cover any
37
+ patent claims that you cause to be infringed by modifications or additions to
38
+ the software. If you or your company make any written claim that the software
39
+ infringes or contributes to infringement of any patent, your patent license for
40
+ the software granted under these terms ends immediately. If your company makes
41
+ such a claim, your patent license ends immediately for work on behalf of your
42
+ company.
43
+
44
+ ## Notices
45
+
46
+ You must ensure that anyone who gets a copy of any part of the software from you
47
+ also gets a copy of these terms.
48
+
49
+ If you modify the software, you must include in any modified copies of the
50
+ software prominent notices stating that you have modified the software.
51
+
52
+ ## No Other Rights
53
+
54
+ These terms do not imply any licenses other than those expressly granted in
55
+ these terms.
56
+
57
+ ## Termination
58
+
59
+ If you use the software in violation of these terms, such use is not licensed,
60
+ and your licenses will automatically terminate. If the licensor provides you
61
+ with a notice of your violation, and you cease all violation of this license no
62
+ later than 30 days after you receive that notice, your licenses will be
63
+ reinstated retroactively. However, if you violate these terms after such
64
+ reinstatement, any additional violation of these terms will cause your licenses
65
+ to terminate automatically and permanently.
66
+
67
+ ## No Liability
68
+
69
+ *As far as the law allows, the software comes as is, without any warranty or
70
+ condition, and the licensor will not be liable to you for any damages arising
71
+ out of these terms or the use or nature of the software, under any kind of
72
+ legal claim.*
73
+
74
+ ## Definitions
75
+
76
+ The **licensor** is the entity offering these terms, and the **software** is the
77
+ software the licensor makes available under these terms, including any portion
78
+ of it.
79
+
80
+ **you** refers to the individual or entity agreeing to these terms.
81
+
82
+ **your company** is any legal entity, sole proprietorship, or other kind of
83
+ organization that you work for, plus all organizations that have control over,
84
+ are under the control of, or are under common control with that organization.
85
+ **control** means ownership of substantially all the assets of an entity, or the
86
+ power to direct its management and policies by vote, contract, or otherwise.
87
+ Control can be direct or indirect.
88
+
89
+ **your licenses** are all the licenses granted to you for the software under
90
+ these terms.
91
+
92
+ **use** means anything you do with the software requiring one of your licenses.
93
+
94
+ **trademark** means trademarks, service marks, and similar rights.