@harborppm/cli 0.2.0 → 0.4.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 +22 -6
- package/bin/harbor.mjs +22 -5
- package/dist/app.mjs +4672 -1356
- package/lib/app.mjs +11 -3
- package/lib/cli.mjs +64 -10
- package/lib/config.mjs +7 -4
- package/lib/logo.mjs +174 -0
- package/lib/plain.mjs +47 -0
- package/lib/update.mjs +73 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -12,14 +12,30 @@ Needs Node 22 or later.
|
|
|
12
12
|
|
|
13
13
|
## The full-screen app
|
|
14
14
|
|
|
15
|
-
`harbor` on its own takes over the terminal, like `htop` or `lazygit`, and gives it back when you press `q
|
|
15
|
+
`harbor` on its own takes over the terminal, like `htop` or `lazygit`, and gives it back when you press `q`. It opens on Harbor's mark (the teal tile, the H and three boats, drawn in half blocks) while your harbor loads, and keeps a small one at the foot of the sidebar when the terminal is tall enough (21 rows or more; the larger one from 110 columns). Then:
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
1. **Today**: what's on you, late first; who's waiting on you; your risks and issues.
|
|
18
|
+
2. **Inbox**: the same pings as the website: waiting on you, sign-offs, mentions. Enter opens one; it's marked read.
|
|
19
|
+
3. **Projects**: every portfolio, program and project with its health. A project opens on its board (columns side by side), its list, or its budget and spend ledger (`v`); `e` changes its details: lead, dates, budget, health by hand with a note.
|
|
20
|
+
4. **Programs**: a program's projects and milestones side by side (`m` adds a milestone, space ticks one), its next move and health.
|
|
21
|
+
5. **Risks**: the register, worst first. Enter changes one (status, owner, likelihood, impact, mitigation); `n` logs a risk, issue or decision.
|
|
22
|
+
6. **People**: open and late work and the next four weeks against each person's capacity; Enter changes their capacity, role, or the time they're promised to a program.
|
|
23
|
+
7. **Roadmap**: a portfolio's programs and projects across the months, in their health's colour, ◆ for milestones.
|
|
24
|
+
8. **History**: who changed what, for a portfolio, program or project (`s` picks which).
|
|
21
25
|
|
|
22
|
-
|
|
26
|
+
A task changes in place too: title, status, owner, due date (`2026-10-14`, `today`, `+3`), priority, project, notes, checklist steps, comments.
|
|
27
|
+
|
|
28
|
+
Keys: `↑↓` (or `j k`) and `←→` (or `h l`) move, Enter opens, Esc goes back, `:` finds anything (a screen, "new project", a project or program by name), `/` finds a task by its key or words, `n` makes something new, `e` changes what's open, `[` `]` move a card a column, `x` marks it done, `d` deletes (it asks first), `u` undoes your last change, `H` switches harbor, `?` lists them all.
|
|
29
|
+
|
|
30
|
+
`harbor help` shows the mark too, in a terminal with colour; piped, or with `NO_COLOR` set, it's plain text. `harbor --version` says which version you have.
|
|
31
|
+
|
|
32
|
+
## Staying up to date
|
|
33
|
+
|
|
34
|
+
npm doesn't update a global install by itself, so once a day `harbor` asks npm whether a newer version is out, alongside whatever command you ran, and says so in one line when there is (`npm install -g @harborppm/cli@latest` updates it). It says nothing in scripts, pipes or CI; set `HARBOR_NO_UPDATE_CHECK=1` (or `NO_UPDATE_NOTIFIER=1`) to turn it off.
|
|
35
|
+
|
|
36
|
+
## Text from others
|
|
37
|
+
|
|
38
|
+
Task titles, names and notes can come from an intake form, a GitHub pull request or anyone in a harbor. Before the commands or the app show them, `harbor` takes out the control characters a terminal would act on (escape sequences, backspaces, text-direction overrides), so a title can't set your clipboard, retitle the window or hide what's around it. `--json` keeps the data exact, with those characters written as `\u` escapes.
|
|
23
39
|
|
|
24
40
|
It runs on the same engine as the website: health, task keys, limits and undo work the same way, changes save as you go (the header says when, and holds them while you're offline), and changes anyone makes on the website or elsewhere show up within a couple of seconds. It needs full access, which `harbor login` asks for by name; an older sign-in is asked again the first time.
|
|
25
41
|
|
package/bin/harbor.mjs
CHANGED
|
@@ -1,16 +1,33 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { run } from "../lib/cli.mjs";
|
|
2
|
+
import { VERSION, run } from "../lib/cli.mjs";
|
|
3
3
|
import { HarborError } from "../lib/mcp.mjs";
|
|
4
|
+
import { plain } from "../lib/plain.mjs";
|
|
5
|
+
import { updateNotice } from "../lib/update.mjs";
|
|
4
6
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
const argv = process.argv.slice(2);
|
|
8
|
+
// Asked alongside the command, so it costs nothing extra (see update.mjs).
|
|
9
|
+
const notice = argv.includes("--json")
|
|
10
|
+
? Promise.resolve(null)
|
|
11
|
+
: updateNotice({ version: VERSION }).catch(() => null);
|
|
12
|
+
const tell = async () => {
|
|
13
|
+
const line = await notice;
|
|
14
|
+
if (line) process.stderr.write(`\n${line}\n`);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
run(argv).then(
|
|
18
|
+
async (code) => {
|
|
19
|
+
await tell();
|
|
20
|
+
process.exit(code);
|
|
21
|
+
},
|
|
22
|
+
async (err) => {
|
|
8
23
|
const known =
|
|
9
24
|
err instanceof HarborError ||
|
|
10
25
|
/^(Unknown option|--\S+ (needs|takes|is))/.test(err?.message ?? "");
|
|
26
|
+
// Harbor's refusals can quote a task's title; print them plain.
|
|
11
27
|
process.stderr.write(
|
|
12
|
-
`${known ? err.message : `Something went wrong: ${err?.message ?? err}`}\n`,
|
|
28
|
+
`${plain(known ? err.message : `Something went wrong: ${err?.message ?? err}`)}\n`,
|
|
13
29
|
);
|
|
30
|
+
await tell();
|
|
14
31
|
process.exit(1);
|
|
15
32
|
},
|
|
16
33
|
);
|