ADDING-TASKS-CLI.md•6.51 kB
# Adding Tasks to TickTick via CLI
This guide shows how to add tasks to TickTick from the command line using the `tt` CLI tool.
## Prerequisites
1. **Install the TickTick CLI tool** (one-time setup):
```bash
# The tt command should be installed at ~/bin/tt
# If not, follow the setup instructions in TICKTICK-QUICKSTART.md
```
2. **Ensure authentication is working**:
```bash
cd /Users/kevinbadinger/Projects/ticktick-api-client
python test_ticktick_auth.py
```
This will create OAuth token files (`.token-oauth` and `.ticktick-token.json`) that the CLI uses.
## Basic Usage
### Simple Task
```bash
~/bin/tt "Task title here"
```
### Task with Project
```bash
~/bin/tt "Task title" --project "💼Work"
```
**Available projects** (use exact names with emojis):
- `📖Study`
- `🏃Exercise`
- `🏡Memo`
- `💼Work`
- `👋Welcome`
- `GetTo`
- `Marriage`
- `Health`
- `Milestones`
### Task with Priority
```bash
~/bin/tt "Important task" --priority 5
```
**Priority levels:**
- `5` = High (red)
- `3` = Medium (yellow)
- `1` = Low (blue)
- `0` = None (no color)
### Task with Due Date
```bash
# Specific date (YYYY-MM-DD format)
~/bin/tt "Complete report" --due "2025-11-20"
# Relative dates (if supported by your CLI)
~/bin/tt "Call someone" --due today
~/bin/tt "Weekly meeting" --due tomorrow
```
### Task with Description/Content
```bash
~/bin/tt "Task title" --content "Detailed description here"
```
## Advanced: Multi-line Content
For tasks with long descriptions or checklists, use a heredoc:
```bash
~/bin/tt "Morning Workout Routine" \
--project Health \
--priority 5 \
--due today \
--content "$(cat <<'EOF'
Warm-up (5 min):
- Light stretching
- Arm circles
Main workout (20 min):
- Squats: 3 sets of 10
- Plank: 3 x 30 seconds
- Push-ups: 3 sets of 8
Cool down (5 min):
- Stretch major muscle groups
EOF
)"
```
## Real-World Example: Badcoin Explorer Deployment
This example shows how to create a complex task with all phases documented:
```bash
~/bin/tt "Deploy Badcoin Block Explorer" \
--project "💼Work" \
--priority 5 \
--due "2025-11-18" \
--content "$(cat <<'EOF'
Deploy Iquidus Explorer at badcoin.kbadinger.com
**Total Time:** 3-4 hours (1-3 hours unattended database sync)
**Prerequisites:**
- badcoin1 VPS synced to block 1,773,011+
- Access to kbadinger.com DNS settings
- $12/month for 2GB VPS upgrade
**Phases:**
1. VPS Preparation (30 min)
- Shutdown node safely
- Resize VPS to 2GB RAM
- Configure DNS: badcoin.kbadinger.com
- Add RPC credentials to badcoin.conf
2. Software Installation (30 min)
- Install MongoDB 7.0
- Install Node.js 18.x
- Clone & install Iquidus Explorer
3. Explorer Configuration (30 min)
- Setup MongoDB database & user
- Get genesis block/transaction info
- Configure settings.json with Badcoin details
4. Database Sync (1-3 hours - UNATTENDED)
- Start explorer: npm start
- Run sync script: node scripts/sync.js index update
- Monitor progress: mongo explorerdb --eval "db.txes.count()"
5. Web Server Setup (20 min)
- Install Nginx reverse proxy
- Get free SSL certificate (Let's Encrypt)
- Setup systemd service for auto-start
6. Verification & Customization (30 min)
- Test https://badcoin.kbadinger.com
- Upload Badcoin logo
- Customize branding
- Setup hourly sync cron job
**Documentation:**
- Complete guide: EXPLORER_SETUP.md
- Timeline with checkpoints: EXPLORER_TIMELINE.md
**After Deployment:**
- Test all features (search, addresses, transactions)
- Take screenshots for promotion
- Update STATUS.md and README.md
- Announce to community (Telegram, BitcoinTalk)
- Recruit miners with live explorer proof!
**Cost:** $12/month (VPS upgrade), SSL is free
EOF
)"
```
## Common Patterns
### Daily Task to Work Project
```bash
~/bin/tt "Review emails" \
--project "💼Work" \
--priority 3 \
--due today
```
### Weekly Recurring Task (if using Python script)
```bash
# For recurring tasks, use the Python script instead:
cd /Users/kevinbadinger/Projects/ticktick-api-client
python add_task.py "Weekly team meeting" \
--project "💼Work" \
--priority 3 \
--repeat "RRULE:FREQ=WEEKLY;BYDAY=MO"
```
### Health Tracking Task
```bash
~/bin/tt "Daily Weigh-in" \
--project Health \
--priority 3 \
--due today \
--content "Record weight and body measurements"
```
### Marriage Check-in
```bash
~/bin/tt "Sunday Marriage Check-in" \
--project Marriage \
--priority 5 \
--due "2025-11-17" \
--content "$(cat <<'EOF'
6 Questions Framework:
1. Connection Score (1-10)
2. What Made Me Feel Loved
3. What Hurt or Frustrated Me
4. Body/Aging Struggle This Week
5. Intimacy Check
6. What I Need Next Week
Process:
- Both write answers (10 min)
- Share and listen (15 min)
- Connect physically (5 min)
EOF
)"
```
## Tips
1. **Use quotes** around task titles with spaces
2. **Include emoji** in project names exactly as shown
3. **Date format** must be `YYYY-MM-DD` (not "Tuesday" or other formats)
4. **Heredoc syntax** (`cat <<'EOF'...EOF`) preserves formatting for multi-line content
5. **Check available projects** by looking at the error message if you use a wrong project name
## Troubleshooting
### Error: "Project 'X' not found"
The project name must match exactly, including emoji. Available projects:
- `📖Study`, `🏃Exercise`, `🏡Memo`, `💼Work`, `👋Welcome`, `GetTo`, `Marriage`, `Health`, `Milestones`
### Error: "Invalid date format"
Use `YYYY-MM-DD` format:
```bash
# ❌ Wrong
--due Tuesday
--due "Nov 18"
# ✅ Correct
--due "2025-11-18"
```
### Task created but content is cut off
Make sure to close the heredoc properly:
```bash
--content "$(cat <<'EOF'
Your content here
EOF
)" # <-- Don't forget the closing parenthesis and quote
```
## Success Indicators
When a task is created successfully, you'll see:
```
✅ Task created: Your Task Title
ID: 6919f8908f08e2ebad3daf84
```
You can then verify in your TickTick app:
1. Open TickTick (web or mobile)
2. Navigate to the specified project
3. Find the task with the title you created
4. Verify due date, priority, and content
## Next Steps
- For recurring tasks: Use `add_task.py` with `--repeat` flag
- For bulk task creation: Write a bash script with multiple `tt` commands
- For advanced automation: Use the Python API directly (see `ticktick_rest_api.py`)
---
**Created:** 2025-11-16
**Last Updated:** 2025-11-16
**Tested With:** ~/bin/tt CLI tool + TickTick OAuth authentication