@motir/cli 0.1.1 → 0.3.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 +28 -13
- package/dist/index.js +49875 -424
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,10 +1,22 @@
|
|
|
1
1
|
# `@motir/cli` — the `motir` command-line tool
|
|
2
2
|
|
|
3
|
-
Terminal dispatch of the Motir work loop. The CLI is
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
Terminal dispatch of the Motir work loop. The CLI is a client of **Motir's
|
|
4
|
+
public REST API** (`/api/v1`): every command is an ordinary HTTPS request
|
|
5
|
+
carrying a personal access token (PAT) as its bearer. There is no private
|
|
6
|
+
channel — the CLI uses the same documented endpoints, the same credential and
|
|
7
|
+
the same permissions any third-party integration gets, and if it needs a capability
|
|
8
|
+
that capability lands on `/api/v1` first, where everyone can reach it.
|
|
9
|
+
|
|
10
|
+
That is the point rather than an implementation detail: nothing this tool does
|
|
11
|
+
is unavailable to a script you write yourself. The reference is at
|
|
12
|
+
[`/docs/api`](https://app.motir.co/docs/api) and the machine-readable spec at
|
|
13
|
+
[`/api/openapi/v1.json`](https://app.motir.co/api/openapi/v1.json) — the same
|
|
14
|
+
document this package's types are generated from.
|
|
15
|
+
|
|
16
|
+
> It was an MCP client until Story 11.5 (`docs/decisions/cli-v1-client.md`).
|
|
17
|
+
> Motir still SERVES the Model Context Protocol at `/api/mcp`, for agents; the
|
|
18
|
+
> CLI is simply no longer one of its clients, and no longer ships an
|
|
19
|
+
> agent-protocol SDK to everyone who installs it.
|
|
8
20
|
|
|
9
21
|
> **Status (Subtask 7.9.1):** this is the scaffold + auth + link layer. Read
|
|
10
22
|
> commands (`ready` / `status` / `open` — 7.9.2), single dispatch (`next` /
|
|
@@ -56,8 +68,8 @@ construction** — the code and URL are printed whether or not a browser opens,
|
|
|
56
68
|
an SSH session or a container uses the same command; `--no-browser` skips the
|
|
57
69
|
launch attempt outright.
|
|
58
70
|
|
|
59
|
-
The approval mints a CLI-scoped PAT:
|
|
60
|
-
`
|
|
71
|
+
The approval mints a CLI-scoped PAT: permissions `project:browse`, `work_item:edit`,
|
|
72
|
+
`comment:add`, `ai:plan` (fixed — the grant can neither widen nor narrow them), 90-day
|
|
61
73
|
expiry, labelled `CLI · <hostname>`. It lands in `~/.config/motir/config.json`,
|
|
62
74
|
`chmod 600`, keyed by server URL.
|
|
63
75
|
|
|
@@ -73,7 +85,7 @@ There are three credential tiers, and `motir login` is the middle one:
|
|
|
73
85
|
there is no `.motir.json` to walk up to) and outranks a stored credential.
|
|
74
86
|
|
|
75
87
|
**Disconnecting** is two different things: `motir logout` forgets the local copy
|
|
76
|
-
on this machine, while **revoking the token in Settings → Account →
|
|
88
|
+
on this machine, while **revoking the token in Settings → Account → Tokens**
|
|
77
89
|
is the server-side kill switch. Full guide: [`docs/cli.md` §
|
|
78
90
|
Authenticate](../../docs/cli.md#authenticate).
|
|
79
91
|
|
|
@@ -500,10 +512,10 @@ pnpm vitest run tests/cli/ # the story suite — the BUILT binary,
|
|
|
500
512
|
```
|
|
501
513
|
|
|
502
514
|
**The package suite** (`packages/cli/test/**`) covers each module in isolation.
|
|
503
|
-
Where a module talks to a server it is pointed at a REAL
|
|
504
|
-
starts in-process (`test/helpers/
|
|
505
|
-
the
|
|
506
|
-
scripted. `test/auto.test.ts` drives the whole `motir auto` loop against a
|
|
515
|
+
Where a module talks to a server it is pointed at a REAL HTTP server the test
|
|
516
|
+
starts in-process (`test/helpers/testServer.ts`) with canned `/api/v1`
|
|
517
|
+
responses — the framing, status handling and URL building are the real ones,
|
|
518
|
+
only the data is scripted. `test/auto.test.ts` drives the whole `motir auto` loop against a
|
|
507
519
|
scripted server, agent and git, because its load-bearing properties — that it
|
|
508
520
|
re-queries every iteration, that an integrated item unlocks its dependents
|
|
509
521
|
mid-run, that `main` is never advanced, and that the pull request opens even when
|
|
@@ -511,7 +523,7 @@ the run ended badly — are not visible in any single function.
|
|
|
511
523
|
|
|
512
524
|
**The story suite** (`tests/cli/cli-story.test.ts`, in the root Vitest lane where
|
|
513
525
|
Postgres is) spawns the BUILT binary as a child process against the real
|
|
514
|
-
`/api/
|
|
526
|
+
`/api/v1` routes, with a scripted fake agent and a recorded fake `gh`. It is what
|
|
515
527
|
proves the assembled tool works: repo routing into real checkouts, the
|
|
516
528
|
session-branch cascade, one pull request per touched repo, a `main` nobody
|
|
517
529
|
advanced, and the help surface of the binary a user actually runs.
|
|
@@ -526,6 +538,9 @@ uses; the story suite rides the sharded Vitest job.
|
|
|
526
538
|
|
|
527
539
|
## Releasing
|
|
528
540
|
|
|
541
|
+
What each version changed, for the person who installs it, is
|
|
542
|
+
[`CHANGELOG.md`](./CHANGELOG.md). Below is how one gets published.
|
|
543
|
+
|
|
529
544
|
Releases publish to the **public npm registry** via CI — the
|
|
530
545
|
`.github/workflows/release-cli.yml` workflow, triggered by a package-scoped git
|
|
531
546
|
tag. There is no manual `npm publish` in the normal path.
|