@harborppm/cli 0.119.0 → 0.121.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 +9 -1
- package/bin/harbor.mjs +9 -2
- package/dist/app.mjs +202 -96
- package/lib/args.mjs +35 -1
- package/lib/cli.mjs +116 -35
- package/lib/format.mjs +9 -2
- package/lib/paint.mjs +137 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -50,6 +50,8 @@ It runs on the same engine as the website: health, task keys, limits and undo wo
|
|
|
50
50
|
|
|
51
51
|
It has colours for dark terminals and for light ones, and picks by asking the terminal for its background (or reading `COLORFGBG`); a terminal that doesn't say gets the dark ones. `harbor theme light` or `harbor theme dark` settles it, `harbor theme auto` goes back to asking, and `HARBOR_THEME` overrides it for one run.
|
|
52
52
|
|
|
53
|
+
The commands' answers are coloured on a terminal: a task's key stands out, the details in brackets step back, and late work, off track and at risk are the only warm words. They use your terminal's own colours, so they follow its theme. Piped, redirected or with `--json` the text is plain, and `--no-color` or `NO_COLOR=1` keeps it plain on a terminal too.
|
|
54
|
+
|
|
53
55
|
`harbor help` starts with the dozen commands most people need; `harbor help all` lists every one. It 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.
|
|
54
56
|
|
|
55
57
|
## On the website
|
|
@@ -115,6 +117,8 @@ Task titles, names and notes can come from an intake form, a GitHub pull request
|
|
|
115
117
|
|
|
116
118
|
`harbor signup` is for a first visit: the same sign-in, with the page opened on making an account. `harbor login` registers the CLI with Harbor and opens the same page Claude and other apps use: it names "Harbor CLI" and asks what to allow. Choose **Allow reading only** (or run `harbor login --read-only`) if it shouldn't change anything. The sign-in is saved in `~/.config/harbor/credentials.json`, readable only by you, and refreshes itself for 30 days.
|
|
117
119
|
|
|
120
|
+
A new harbor starts with First voyage, a short project of practice tasks. They tick themselves off from the terminal as they do on the website: `harbor add "Call the printer"` puts your first task there (it's the only project you have) and ticks "Add a task of your own" and "Try Harbor in your terminal", and the answer says so.
|
|
121
|
+
|
|
118
122
|
`harbor logout` forgets it on this machine. To end its access everywhere, disconnect **Harbor CLI** under **Connected apps** in Harbor's menu.
|
|
119
123
|
|
|
120
124
|
## Commands
|
|
@@ -177,7 +181,11 @@ harbor add "TITLE" --project P [--assignee me|NAME] [--also "NAME, NAME"] [--due
|
|
|
177
181
|
away, what it waits on, how long their similar tasks
|
|
178
182
|
took); it needs an owner, and an empty queue gives
|
|
179
183
|
their next working day. A date that won't hold says so
|
|
180
|
-
harbor start TASK | submit TASK | done TASK [--confirm] [--over-limit]
|
|
184
|
+
harbor start TASK | submit TASK | done TASK [--confirm] [--over-limit] [--comment TEXT]
|
|
185
|
+
--comment leaves a note on the task as it moves;
|
|
186
|
+
several keys at once (harbor done RR-4 RR-7) move
|
|
187
|
+
each in turn; one that can't move says why and the
|
|
188
|
+
rest carry on
|
|
181
189
|
harbor edit TASK [--title T] [--assignee me|none|NAME] [--also "NAME, NAME"|none]
|
|
182
190
|
[--due DATE|pilot|none] [--starts DATE|none]
|
|
183
191
|
[--priority P] [--status S] [--notes TEXT]
|
package/bin/harbor.mjs
CHANGED
|
@@ -2,10 +2,17 @@
|
|
|
2
2
|
import { VERSION, run } from "../lib/cli.mjs";
|
|
3
3
|
import { exitWhenWritten } from "../lib/exit.mjs";
|
|
4
4
|
import { HarborError } from "../lib/mcp.mjs";
|
|
5
|
+
import { paint, wantsColour, withoutColourFlags } from "../lib/paint.mjs";
|
|
5
6
|
import { jsonText, plain } from "../lib/plain.mjs";
|
|
6
7
|
import { updateNotice } from "../lib/update.mjs";
|
|
7
8
|
|
|
8
|
-
const
|
|
9
|
+
const typed = process.argv.slice(2);
|
|
10
|
+
// Colour on a terminal only, and never in what a script reads (paint.mjs).
|
|
11
|
+
const colour = wantsColour({ argv: typed });
|
|
12
|
+
const argv = withoutColourFlags(typed);
|
|
13
|
+
const help =
|
|
14
|
+
argv[0] === "help" || argv.includes("--help") || argv.includes("-h") || argv.length === 0;
|
|
15
|
+
const io = colour ? { out: (s) => process.stdout.write(`${paint(s, { help })}\n`) } : {};
|
|
9
16
|
// Asked alongside the command, so it costs nothing extra (see update.mjs).
|
|
10
17
|
// Not for the shell prompt, which draws on every Enter and must never wait.
|
|
11
18
|
const notice =
|
|
@@ -17,7 +24,7 @@ const tell = async () => {
|
|
|
17
24
|
if (line) process.stderr.write(`\n${line}\n`);
|
|
18
25
|
};
|
|
19
26
|
|
|
20
|
-
run(argv).then(
|
|
27
|
+
run(argv, io).then(
|
|
21
28
|
async (code) => {
|
|
22
29
|
await tell();
|
|
23
30
|
await exitWhenWritten(code);
|