bob capture-task-id¶
Write a block ID onto an open capture task
bob capture-task-id --help
Assign a user-authored Obsidian block ID to one open task in a Bob note.
The command is the write half of task completion: callers first discover a missing-ID task with `bob capture-complete --all-tasks` (or the `&` dependency and `*` blocked-task picker), then pass that candidate's stale-safe --task-ref together with the authored --block-id. Validation uses the same route grammar, block-ID grammar, task scan, and duplicate-ID rules as `bob capture`. The selected task must still be open and must not already have an ID. An ID already used anywhere in the target note is rejected, including non-task anchors.
Use --route for a routable root note, or --note-path for the exact vault-relative path of any task-bearing note (nested, case-sensitive, or quoted paths round-trip exactly; the lowercasing route parser is never consulted). --allow-closed additionally permits Done/Cancelled tasks without reopening them, for dependency candidates that name completed history; it never reopens the task and never applies to non-task lines. The previous daily snapshot stays read-only and fails with a guarded refusal.
On success the command appends ' ^<id>' to the resolved physical task line, preserves that line's ending and every unrelated byte, and replaces the note with one same-directory temporary file rename. The JSON success shape additionally carries the exact `note_path` (in --note-path mode) and the backend-formatted `dependency_replacement` (`¬e:id`, quoted when the locator needs it) so the app can resume the picker without losing quoting or case, plus `blocked_task_replacement` (`*note:id`, quoted when the locator needs it, in both modes) so the blocked-task picker can splice the new ID, plus `complete_replacement` (`!note:id`, quoted when the locator needs it, in both modes) so the Complete picker can splice the new ID, plus `relation_to_replacement` (`~note:block-id`) and `relation_from_replacement` (`~~note:block-id`), quoted when the locator needs it, so either relation picker can splice the new ID, plus `parent_replacement` (`@route+block-id`) in routable `--route` mode. Dry-run plans the same mutation and returns the same success shape without writing. Stale, ambiguous, terminal, already-identified, duplicate, missing, unreadable, or read-only-snapshot tasks fail without touching the note.
Usage: bob capture-task-id [OPTIONS] --block-id <ID> --task-ref <REF> <--route <NAME>|--note-path <PATH>>
Options:
-a, --allow-closed
Assign to a Done/Cancelled task without reopening it
-i, --block-id <ID>
Block ID to assign; letters, numbers, and hyphens
-b, --bob-dir <DIR>
Bob vault root; defaults to BOB_DIR or ~/bob
-d, --dry-run
Plan and report without writing the note
-f, --format <FORMAT>
Output format: human or json
[default: human]
[possible values: human, json]
-h, --help
Show help
-n, --note-path <PATH>
Exact vault-relative path of the note (nested and case-sensitive names round-trip)
-r, --route <NAME>
Route/name of the note that contains the task
-t, --task-ref <REF>
Stale-safe task ref from capture-complete or capture-tasks
Examples:
bob capture-task-id -r file -t 3:1f3a9c2b -i report-id
bob capture-task-id --route cash --task-ref 12:abcd1234 --block-id goog-exit -f json
bob capture-task-id -r file -t 3:1f3a9c2b -i report-id --dry-run
bob capture-task-id -b ~/bob -r notes -t 8:deadbeef -i inbox-item
bob capture-task-id -n projects/shopping.md -t 4:1f3a9c2b -i grocery-run
bob capture-task-id -n archive/old.md -t 9:abcd1234 -i kept-id --allow-closed
Environment:
BOB_DIR Bob vault root when --bob-dir is omitted