Skip to main content

Syntax

tracer import [OPTIONS]

Options

--input
path
Input file path (defaults to stdin if not specified)Short flag: -i
--skip-existing
boolean
Skip existing issues instead of updating them
--dry-run
boolean
Show what would be imported without making changes

Examples

# Import issues from a file
tracer import --input issues.jsonl

Behavior

The import command:
  1. Reads JSONL format (one JSON object per line)
  2. For each issue:
    • If issue ID exists:
      • Default: Updates the existing issue with new data
      • With --skip-existing: Leaves the existing issue unchanged
    • If issue ID doesn’t exist: Creates a new issue
  3. Imports dependencies, avoiding duplicates
  4. Reports statistics on created, updated, and skipped issues

Output

Standard Import

✓ Import complete:
  Created: 5
  Updated: 12

Import with Skip Existing

✓ Import complete:
  Created: 5
  Updated: 0
  Skipped: 12

Dry Run

Dry run: would import 17 issue(s)

Input Format

The import command expects JSONL (JSON Lines) format, where each line is a complete JSON object:
{"id":"bd-1","title":"Implement authentication","description":"Add OAuth support","status":"open","priority":1,"issue_type":"feature","assignee":"","created_at":"2025-03-01T10:00:00Z","updated_at":"2025-03-01T10:00:00Z","dependencies":[]}
{"id":"bd-2","title":"Design auth schema","description":"","status":"open","priority":1,"issue_type":"task","assignee":"[email protected]","created_at":"2025-03-01T09:00:00Z","updated_at":"2025-03-01T09:00:00Z","dependencies":[{"issue_id":"bd-2","depends_on_id":"bd-1","type":"parent-child","created_at":"2025-03-01T09:05:00Z","created_by":"system"}]}
Empty lines in the input file are skipped. Malformed JSON will cause the import to fail with an error message.
Use --dry-run first to verify the import will work as expected before making changes to your database.

Use Cases

Backup and Restore

# Backup
tracer export --output backup-$(date +%Y%m%d).jsonl

# Restore
tracer import --input backup-20250304.jsonl

Migration Between Systems

# On source system
tracer export --output migration.jsonl

# Transfer file to destination system
# On destination system
tracer import --input migration.jsonl

Selective Import

# Import only specific issues using jq
tracer export --status closed | \
  jq 'select(.priority <= 1)' | \
  tracer import

Build docs developers (and LLMs) love