目录
Pete Tanton

Make the CLI drivable without a terminal (#36)

Every parameter of create was 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 37 fails 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. archive falls back to archiving on age alone in that case instead of dying on its confirmation prompt.

Also:

  • --json writes 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.
  • --due and --notes on 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.
  • snooze takes –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.
  • version prints 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

2个月前57次提交

reclaim-cli

A CLI for reclaim.ai

Set RECLAIM_API_KEY to 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-interactive forces 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 --json output is safe to pipe.

create

reclaim create --title "Review the auth migration" \
  --mins 30 --min-chunk 30 --priority P3 \
  --start "in 1 week" --due 2026-08-14 --json
Flag
--title required
--notes free text; a better home for links than the title
--mins total length: 15, 30, 45, 60, 90, 120, 180, 240
--min-chunk shortest block it may be split into: 15, 30, 45, 60
--priority P1, P2, P3, P4
--start when to start working on it; snoozes the task until then
--due when it is due; omit for no due date
--json write the created task to stdout as one line of JSON
--non-interactive never prompt

--mins and --min-chunk are 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

reclaim snooze --id 13354745 --until "in 3 days"
reclaim snooze --title "auth migration" --until 2026-09-01

--id and --title both skip the picker; --title matches on a case-insensitive substring of an open task’s title and fails if more than one task matches. --until defaults to in 1 day.

Time values

--start, --due and --until all accept:

Form Example
now --start now
in <n> hours|days|weeks --until "in 3 days"
a date --due 2026-08-14
an RFC3339 timestamp --due 2026-08-14T17:30:00Z

Bare dates are read in the local timezone. A bare --start or --until date begins at midnight; a bare --due date is due at 23:59, since a task due at midnight would be overdue for the whole of its due date.

Other commands

reclaim dedupe merge tasks sharing a title, and delete tasks for GitLab MRs that are closed or merged. Needs GITLAB_URL and GITLAB_TOKEN.
reclaim archive archive completed tasks. --auto-archive-age archives anything finished more than that many days ago without asking; --max-count bounds how many you are asked about. --non-interactive archives on age alone.
reclaim meeting book a meeting through a scheduling link
reclaim version print the version
关于
365.0 KB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9 京公网安备 11010802047560号