Describe the bug
After the access token expires (~2 hours), lark-cli requires re-authorization via device code flow, even though the refresh token is still valid (~7 days). The CLI appears to store the refresh token (as evidenced by auth status returning refreshExpiresAt) but never uses it to silently renew the access token.
To Reproduce
lark-cli auth login --recommend
- Complete device code authorization in browser
- Wait ~2 hours for access token to expire
- Run any command (e.g.
lark-cli auth status)
- Observe
tokenStatus: needs_refresh and auth login demanding a new device code
Expected behavior
When the access token expires but the refresh token is still valid, lark-cli should:
- Automatically exchange the refresh token for a new access token, OR
- Provide an
auth refresh subcommand to do so manually
Without this, users must re-authorize every 2 hours, which defeats the purpose of having a refresh token.
Environment
- OS: macOS Sequoia (arm64)
- lark-cli version: 1.0.23
- Brand: feishu
- Scope includes:
offline_access
Additional context
The offline_access scope is already requested during login, so the refresh token should be available. The auth subcommands currently are: login, logout, status, check, scopes, list — there is no refresh command.
Describe the bug
After the access token expires (~2 hours),
lark-clirequires re-authorization via device code flow, even though the refresh token is still valid (~7 days). The CLI appears to store the refresh token (as evidenced byauth statusreturningrefreshExpiresAt) but never uses it to silently renew the access token.To Reproduce
lark-cli auth login --recommendlark-cli auth status)tokenStatus: needs_refreshandauth logindemanding a new device codeExpected behavior
When the access token expires but the refresh token is still valid,
lark-clishould:auth refreshsubcommand to do so manuallyWithout this, users must re-authorize every 2 hours, which defeats the purpose of having a refresh token.
Environment
offline_accessAdditional context
The
offline_accessscope is already requested during login, so the refresh token should be available. Theauthsubcommands currently are:login,logout,status,check,scopes,list— there is norefreshcommand.