Skip to content

feat: add away status command#79

Merged
scottlovegrove merged 7 commits intomainfrom
feat/away-status
Mar 12, 2026
Merged

feat: add away status command#79
scottlovegrove merged 7 commits intomainfrom
feat/away-status

Conversation

@lmjabreu
Copy link
Contributor

@lmjabreu lmjabreu commented Mar 10, 2026

Summary

  • Add tw away command to view, set, and clear user away status
  • Supports away types: vacation, parental, sickleave, other with date ranges
  • Includes --json, --full, and --dry-run flags following existing patterns
  • Adds awayMode to user essential fields and updates skill documentation
  • Adds user:write to the OAuth scopes

Note: Existing users will need to re-authenticate with tw auth login to get the new user:write scope.

Test plan

  • npm run type-check passes
  • All 229 tests pass (8 new away tests)
  • npm run build compiles cleanly
  • node dist/index.js away --help shows correct subcommands
  • Manual test: tw away set vacation 2026-03-20 sets status
  • Manual test: tw away shows current status
  • Manual test: tw away clear clears status

🤖 Generated with Claude Code

Add `tw away` command to manage user away status via the Twist API.
Supports setting away type (vacation, parental, sickleave, other) with
date ranges, viewing current status, and clearing it.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@doistbot doistbot requested a review from nats12 March 10, 2026 16:13
lmjabreu and others added 2 commits March 10, 2026 16:28
Required by the Twist API to call POST /api/v3/users/update.
Existing users will need to re-authenticate with `tw auth login`.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link

@doist-bot doist-bot bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR introduces the new tw away command, allowing users to conveniently view, set, and clear their away status. The implementation integrates well with existing command patterns and includes solid test coverage. A few minor adjustments are needed to ensure dates are formatted using local timezones rather than UTC, and to accurately reflect in the tests that null is sent when clearing the status.

Share FeedbackReview Logs

lmjabreu and others added 2 commits March 10, 2026 18:26
- Use local date getters instead of toISOString() to avoid UTC timezone
  issues when computing today/tomorrow dates
- Send null (not undefined) when clearing away status so the backend
  correctly clears the field

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The Twist API accepts an empty string (not null) to clear the
away_mode field.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@lmjabreu lmjabreu requested review from gnapse and removed request for nats12 March 11, 2026 09:33
scottlovegrove and others added 2 commits March 12, 2026 13:13
Show a helpful message when users get a 403 due to missing OAuth scopes,
prompting them to re-authenticate with `tw auth login`. Also fix the help
usage line to show positional args before options and update examples.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@scottlovegrove scottlovegrove merged commit 9fd71e7 into main Mar 12, 2026
2 checks passed
@scottlovegrove scottlovegrove deleted the feat/away-status branch March 12, 2026 13:43
@scottlovegrove
Copy link
Collaborator

Nice addition @lmjabreu 👍🏻

github-actions bot pushed a commit that referenced this pull request Mar 12, 2026
# [2.11.0](v2.10.0...v2.11.0) (2026-03-12)

### Features

* add away status command ([#79](#79)) ([9fd71e7](9fd71e7))
@github-actions
Copy link

🎉 This PR is included in version 2.11.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants