# imdone ls Examples

## Display Variations

### Compact vs Long Format

**Compact** (default):
```bash
$ imdone ls
- Listing issues...
✔ Issues:

   SCRUM-161  backlog/current-sprint/SCRUM-161-Create_Getting_Started/issue-SCRUM-161.md
★  SCRUM-138  backlog/current-sprint/SCRUM-138-Launch_imdone_1.0.0!/issue-SCRUM-138.md
   SCRUM-171  backlog/current-sprint/SCRUM-171-Get_a_monthly_license/issue-SCRUM-171.md
```

**Long format** (-l):
```bash
$ imdone ls -l
- Listing issues...
✔ Issues:

   Key        Status       Assignee       Type   Filename
   SCRUM-161  To Do        Jesse Piascik  Story  backlog/current-sprint/SCRUM-161-Create_Getting_Started/issue-SCRUM-161.md
★  SCRUM-138  In Progress  Jesse Piascik  Story  backlog/current-sprint/SCRUM-138-Launch_imdone_1.0.0!/issue-SCRUM-138.md
   SCRUM-171  In Progress                 Story  backlog/current-sprint/SCRUM-171-Get_a_monthly_license/issue-SCRUM-171.md
```

**Note:** The ★ symbol in the first column indicates favorited issues.

## Sorting Examples

### Time-Based Sorting

**Most recent first**:
```bash
imdone ls -t
```

**Oldest first**:
```bash
imdone ls -tr
```

**Long format, time-sorted**:
```bash
imdone ls -lt
```

## Filtering Examples

### Favorites Only

```bash
# Show favorites (compact)
imdone ls --fav

# Show favorites (long format)
imdone ls --fav -l

# Show 3 most recent favorites
imdone ls --fav -t --limit 3
```

### Limited Results

```bash
# Top 10 issues
imdone ls --limit 10

# Top 5, long format, time-sorted
imdone ls -lt --limit 5
```

## Jira JQL Query Examples

### By Status

```bash
# All In Progress
imdone ls -q "project = PROJ AND status = 'In Progress'"

# Not done
imdone ls -q "project = PROJ AND status != 'Done'"

# Multiple statuses
imdone ls -q "project = PROJ AND status IN ('To Do', 'In Progress')"
```

### By Assignment

```bash
# My issues
imdone ls -q "project = PROJ AND assignee = currentUser()"

# Specific user
imdone ls -q "project = PROJ AND assignee = 'jdoe'"

# Unassigned
imdone ls -q "project = PROJ AND assignee is EMPTY"
```

### By Priority

```bash
# High priority only
imdone ls -q "project = PROJ AND priority = 'High'"

# High and Highest
imdone ls -q "project = PROJ AND priority IN ('High', 'Highest')"

# Not low priority
imdone ls -q "project = PROJ AND priority != 'Low'"
```

### By Time

```bash
# Created in last week
imdone ls -q "project = PROJ AND created >= -7d"

# Updated in last day
imdone ls -q "project = PROJ AND updated >= -1d"

# Created this month
imdone ls -q "project = PROJ AND created >= startOfMonth()"
```

### By Sprint/Epic

```bash
# Current sprint
imdone ls -q "project = PROJ AND sprint in openSprints()"

# Specific sprint
imdone ls -q "project = PROJ AND sprint = 'Sprint 23'"

# Specific epic
imdone ls -q "project = PROJ AND 'Epic Link' = PROJ-100"
```

### By Labels

```bash
# Single label
imdone ls -q "project = PROJ AND labels = 'urgent'"

# Multiple labels (any)
imdone ls -q "project = PROJ AND labels IN ('urgent', 'blocker')"

# Multiple labels (all)
imdone ls -q "project = PROJ AND labels = 'urgent' AND labels = 'backend'"
```

### Complex Queries

```bash
# My high priority issues in current sprint
imdone ls -q "project = PROJ AND assignee = currentUser() AND priority IN ('High', 'Highest') AND sprint in openSprints()"

# Recent bugs not done
imdone ls -q "project = PROJ AND type = Bug AND status != Done AND created >= -7d"

# Unassigned stories in backlog
imdone ls -q "project = PROJ AND type = Story AND assignee is EMPTY AND sprint is EMPTY"
```

## GitHub Query Examples

### By State

```bash
# Open issues
imdone ls -q "is:open"

# Closed issues
imdone ls -q "is:closed"
```

### By Assignment

```bash
# My open issues
imdone ls -q "assignee:@me is:open"

# Specific user
imdone ls -q "assignee:jdoe is:open"

# Unassigned
imdone ls -q "no:assignee is:open"
```

### By Label

```bash
# Bug label
imdone ls -q "label:bug is:open"

# Enhancement
imdone ls -q "label:enhancement is:open"

# Multiple labels
imdone ls -q "label:bug label:urgent is:open"
```

### By Milestone

```bash
# Specific milestone
imdone ls -q "milestone:v1.0 is:open"

# Any milestone
imdone ls -q "is:open milestone:*"

# No milestone
imdone ls -q "is:open no:milestone"
```

### Combined Filters

```bash
# My bug issues in v1.0
imdone ls -q "assignee:@me label:bug milestone:v1.0 is:open"

# Urgent enhancements
imdone ls -q "label:enhancement label:urgent is:open"

# Closed issues from last week
imdone ls -q "is:closed closed:>2025-02-20"
```

## Output Format Examples

### JSON Output

```bash
# Get all issues as JSON
imdone ls --format json

# Get favorites as JSON for scripting
imdone ls --fav --format json

# Custom query with JSON output
imdone ls -q "project = PROJ AND status = 'In Progress'" --format json
```

### CSV Output

```bash
# Export to CSV
imdone ls --format csv > issues.csv

# Export favorites to CSV
imdone ls --fav --format csv > favorites.csv
```

### YAML Output

```bash
# Get issues as YAML
imdone ls --format yaml

# Useful for configuration or data transfer
imdone ls --limit 10 --format yaml
```

## Combining Options

### Real-World Workflows

**Daily standup prep**:
```bash
# My 5 most recent issues
imdone ls -q "project = PROJ AND assignee = currentUser()" -t --limit 5
```

**Sprint planning**:
```bash
# High priority unassigned stories
imdone ls -q "project = PROJ AND type = Story AND priority IN ('High', 'Highest') AND assignee is EMPTY" -l
```

**Bug triage**:
```bash
# Recent bugs sorted by priority
imdone ls -q "project = PROJ AND type = Bug AND status != Done AND created >= -7d" -l
```

**Focus on favorites**:
```bash
# My favorite issues, most recent first
imdone ls --fav -t
```

**Export for reporting**:
```bash
# All in-progress issues to CSV
imdone ls -q "project = PROJ AND status = 'In Progress'" --format csv > in-progress.csv
```

## Verbose Mode Examples

See what query is actually running:

```bash
# Show default query
imdone ls --verbose

# Show custom query before execution
imdone ls -q "project = PROJ AND assignee = currentUser()" --verbose
```

Output includes:
```
Query: project = PROJ AND assignee = currentUser() AND status != Done ORDER BY rank ASC
Fetching issues from Jira...
```
