Make the CLI drivable without a terminal (#36)
Every parameter of
createwas answered through an interactive survey picker, so a script or an agent had to allocate a pseudo-terminal and send arrow-key escape sequences. Those sequences are positional offsets into the option lists, so reordering any list silently changed what got selected.Each picker now has a matching flag and is only reached when its flag is absent. Passing no flags behaves exactly as before, same prompts in the same order. Flag values are validated against the same option lists the pickers offer, so
--mins 37fails loudly instead of becoming an odd chunk count.Prompting is skipped when stdin is not a terminal, or on –non-interactive, and a missing flag then becomes an immediate error rather than a prompt nobody can answer.
archivefalls back to archiving on age alone in that case instead of dying on its confirmation prompt.Also:
--jsonwrites the created or snoozed task to stdout, so callers no longer have to regex the task id out of a colour-coded logrus line on stderr.--dueand--noteson create. Due dates were previously unreachable: only snoozeUntil was, via the start prompt, and “review this in a week” and “this is due in a week” are not the same thing.snoozetakes –id, –title and –until. It was previously picker-only and always snoozed exactly 24h, which remains the –until default. An ambiguous –title lists the candidates rather than guessing.- –start, –due and –until accept “in hours|days|weeks”, a bare date or an RFC3339 timestamp, not just the four hardcoded presets.
versionprints to stdout, since it is data rather than a diagnostic.Request bodies are now built with json.Marshal rather than fmt.Sprintf into a JSON string literal. Any quote, backslash or newline in a title produced malformed JSON and an opaque API error, which matters much more once titles are machine-generated. Failed requests also report the response body.
Due and SnoozeUntil are added to Task as pointers, so an unset value is omitted on write rather than sent as the zero time. Verified against all 1781 tasks on the account: every non-null due parses as RFC3339, so the “strange format” comment this replaces no longer holds.
CI built
go build main.go, which compiles only that one file; package main is no longer a single file. Switched to ./… and added a test step.Co-authored-by: Claude Opus 5 (1M context) noreply@anthropic.com
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802047560号
reclaim-cli
A CLI for reclaim.ai
Set
RECLAIM_API_KEYto a personal Reclaim API key before use.Interactive or not
Every command still prompts for anything you do not pass as a flag, so running
reclaim create --title "..."behaves exactly as it always has.Pass the flags instead and nothing is prompted for, which is what makes the CLI usable from a script or an agent. Prompting is skipped automatically when stdin is not a terminal, and
--non-interactiveforces the same behaviour when it is. In either case a missing flag is an immediate error rather than a prompt nobody can answer.Data goes to stdout and diagnostics to stderr, so
--jsonoutput is safe to pipe.create--title--notes--mins--min-chunk--priority--start--due--json--non-interactive--minsand--min-chunkare validated against the lists above, so a value the interactive picker would not have offered is rejected rather than turned into an odd chunk count.snooze--idand--titleboth skip the picker;--titlematches on a case-insensitive substring of an open task’s title and fails if more than one task matches.--untildefaults toin 1 day.Time values
--start,--dueand--untilall accept:now--start nowin <n> hours|days|weeks--until "in 3 days"--due 2026-08-14--due 2026-08-14T17:30:00ZBare dates are read in the local timezone. A bare
--startor--untildate begins at midnight; a bare--duedate is due at 23:59, since a task due at midnight would be overdue for the whole of its due date.Other commands
reclaim dedupeGITLAB_URLandGITLAB_TOKEN.reclaim archive--auto-archive-agearchives anything finished more than that many days ago without asking;--max-countbounds how many you are asked about.--non-interactivearchives on age alone.reclaim meetingreclaim version