larksuite / larksuite/cli

task +get-my-tasks: omitting --complete returns all tasks instead of defaulting to false

Open Beginner friendly
#164 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug domain/task
Dominant language
Go
Stars
17.3k
Forks
1.4k
Avg merge
2d 4h
Merged PRs (30d)
105

Description

Bug Description

lark-cli task +get-my-tasks returns both completed and incomplete tasks when the --complete flag is omitted, despite the help text stating default is false.

Expected Behavior

When --complete is not specified, only incomplete tasks should be returned (equivalent to --complete=false).

Actual Behavior

When --complete is omitted, all tasks (completed + incomplete) are returned.

Reproduction

# Returns ALL tasks (completed + incomplete)
lark-cli task +get-my-tasks --format json | jq '.data.items | length'
# Result: 279

# Explicit false — returns only incomplete tasks (correct)
lark-cli task +get-my-tasks --complete=false --format json | jq '.data.items | length'
# Result: 18

# Explicit true — returns only completed tasks (correct)
lark-cli task +get-my-tasks --complete=true --format json | jq '.data.items | length'
# Result: 261

Verification

Cross-checked individual tasks returned (without the flag) against the raw API:

lark-cli api GET /open-apis/task/v2/tasks/{task_id} --as user

Confirmed that 14 out of 15 sampled tasks had status: done and a completed_at timestamp — yet they were included in the default (no flag) result set.

Help Text

--complete    if true, query completed tasks; default is false

Environment

  • lark-cli version 1.0.1
  • macOS (Darwin 25.3.0)
  • User OAuth identity

Root Cause Guess

Looks like the boolean flag treats "unset" as neither true nor false (i.e., no filter applied), rather than defaulting to false as documented.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the documented task +get-my-tasks reproduction and locating its command implementation and boolean flag handling. Compare omitted, --complete=false, and --complete=true behavior. Done means omitting the flag returns only incomplete tasks, matching the explicit false result, while explicit true still returns completed tasks.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
62/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.