Skip to content

ChrisJCraft/ToodledoConsole

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

57 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Toodledo Console

.NET Version Version License Platform

A lightweight, modern C# CLI tool for managing your Toodledo tasks directly from the terminal. Built with Spectre.Console for a beautiful, interactive command-line experience.

✨ Features

  • 🎨 Beautiful CLI Interface: Powered by Spectre.Console with rich colors, tables, and formatting
  • ⚑ Detailed Task Control: Set priority, folder, context, due dates, tags, and notes directly from the command line
  • 🏷️ Tag Support: Organize tasks with tags using #tag shorthand and a dedicated tag command
  • πŸ“ Note Management: Add detailed notes to tasks with n:"..." shorthand and a dedicated note command
  • πŸ” Powerful Filters & Search: Apply complex filters (priority, folder, context) or search by keyword
  • 🎯 Smart Random Selection: Intelligent task picking avoids repetition
  • πŸ” Secure OAuth2 Authentication: Industry-standard OAuth2 flow with automatic token refresh
  • πŸ’Ύ Persistent Sessions: Log in once, stay authenticated for 30 days via refresh tokens
  • πŸš€ Automatic Browser Launch: Seamless authentication flow with automatic browser handling
  • πŸ“¦ Modular Architecture: Service-based design for maintainability
  • πŸ–₯️ Standardized UI: Consistent 100-column width for all views
  • ✨ Modern Code: 100% clean build with zero warnings (Nullable Reference Types enabled)

πŸ“‹ Commands

Command Description
list Display all current tasks in a formatted table
stats Show productivity dashboard with charts and progress
add [text] [params] Create task. Params: p:[0-3], f:[name], @[name], !:[date], `*:[1
edit [id] Edit task using "Shadow Prompt" shorthand mode (supports same params as add)
view [id] View full task details (including notes)
tag [id]... [tags] Quickly update tags for one or more tasks
note [id]... [text] Quickly update note for one or more tasks
done [id]... Mark one or more tasks as completed
delete [id]... Permanently remove one or more tasks
star [id]... Star one or more tasks
unstar [id]... Unstar one or more tasks
find [text] Search for tasks by title or keyword
filter [params] List tasks matching parameters. Params: p:[0-3], f:[name], @[name], !:[date], `*:[1
folder [search] List all folders (optional search filtering)
folder-add [name] Create a new folder
`folder-edit [i n] [new]`
`folder-delete [i n]...`
context [search] List all contexts (optional search filtering)
context-add [name] Create a new context
`context-edit [i n] [new]`
`context-delete [i n]...`
location [search] List all locations (optional search filtering)
location-add [name] Create a new location
`location-edit [i n] [new]`
`location-delete [i n]...`
setup Run the API credential setup wizard
random [params] Pick a random task matching parameters. Params: p:[0-3], f:[name], @[name], !:[date], `*:[1
help Show available commands and usage information
exit Close the application

πŸ“¦ Prerequisites

πŸ”‘ Getting Toodledo API Credentials

Before you can use this application, you need to register it with Toodledo to get API credentials:

  1. Log in to Toodledo: Go to https://www.toodledo.com/

  2. Navigate to API Settings: Visit https://api.toodledo.com/3/account/doc_register.php

  3. Register Your Application:

    • Application Name: Choose any name (e.g., "My Toodledo Console")
    • Description: Brief description of your personal use
    • Redirect URI: http://localhost:5000/callback
    • Application Type: Select "Desktop Application" or "Other"
  4. Save Your Credentials: After registration, you'll receive:

    • Client ID: A unique identifier for your application
    • Client Secret: A secret key for authentication

    ⚠️ Keep these credentials secure! Never share them or commit them to version control.

πŸš€ Installation & Setup

1. Clone the Repository

git clone https://github.com/ChrisJCraft/ToodledoConsole.git
cd ToodledoConsole

2. Restore Dependencies

dotnet restore

3. Run the Application

dotnet run

4. Setup

On first run, if auth.txt is missing, the Setup Wizard will launch automatically:

  1. Follow the prompts to enter your Client ID and Client Secret.
  2. Credentials will be saved securely to auth.txt (which is ignored by Git).

Alternatively, you can manually create auth.txt in the root folder:

YOUR_CLIENT_ID
YOUR_CLIENT_SECRET

5. Authorize the Application

  1. A browser window will open automatically.
  2. If it doesn't open, manually navigate to http://localhost:5000.
  3. You'll be redirected to Toodledo to authorize the application.
  4. After authorization, you'll be redirected back and can close the browser.
  5. The application will save your access token for future use.

Note: The OAuth2 redirect URI is configured for http://localhost:5000/callback. Make sure this matches what you registered with Toodledo.

⚑ Power-User Shorthands

Use these shorthands with the add and edit commands for rapid task entry:

Shorthand Description Example
p:[0-3] Priority (0: Low, 1: Medium, 2: High, 3: Top) add Milk p:2
f:[name] Folder Name add Script f:Work
@[name] Context Name add Bread @Store
!:[shortcut] Due Date (today, tomorrow, next week) add Taxes !:today
s:[status] Status code (0: None, 1: Next Action, 2: Active, etc.) add Review s:1
#[tag] Add a tag (can be used multiple times) add Release #v0.1.0 #beta
n:"[text]" Add a note (best in quotes) add Jira n:"Fix bug"
* or *:1 Star the task add Urgent *

Pro Tip: You can combine multiple shorthands in a single command! add Buy milk p:3 @Store f:Personal !:today #groceries n:"Get whole milk"

πŸ”§ How It Works

OAuth2 Authentication Flow

  1. Initial Request: The app starts a local web server on port 5000 and opens your browser
  2. Authorization: You authorize the app on Toodledo's website
  3. Token Exchange: The app exchanges the authorization code for an access token and refresh token
  4. Token Storage: Tokens are securely stored in token.txt (ignored by Git)
  5. Automatic Refresh: When the access token expires, the app automatically refreshes it using the refresh token

Random Task Selection

The random command uses intelligent tracking to avoid showing the same tasks repeatedly:

  • Tracks previously shown tasks in random_state.json
  • Resets the pool when all tasks have been shown
  • Ensures a fresh experience each time

πŸ“ Project Structure

ToodledoConsole/
β”œβ”€β”€ Program.cs            # Entry point and command loop
β”œβ”€β”€ AuthService.cs        # OAuth2 authentication & token management
β”œβ”€β”€ TaskService.cs        # Task CRUD and retrieval
β”œβ”€β”€ ContextService.cs     # Context management
β”œβ”€β”€ FolderService.cs      # Folder management
β”œβ”€β”€ LocationService.cs    # Location management
β”œβ”€β”€ FilterService.cs      # Task list filtering logic
β”œβ”€β”€ TaskParserService.cs  # Shorthand parsing & task reconstruction
β”œβ”€β”€ UIService.cs          # Standardized UI rendering (Spectre.Console)
β”œβ”€β”€ InputService.cs       # Console input with history
β”œβ”€β”€ Models.cs             # Shared data models
β”œβ”€β”€ auth.txt              # API credentials (NOT in Git)
β”œβ”€β”€ token.txt             # OAuth tokens (NOT in Git)
β”œβ”€β”€ random_state.json     # Random task selection state (NOT in Git)
β”œβ”€β”€ README.md             # This file

πŸ› Troubleshooting

Browser Doesn't Open Automatically

If the browser doesn't launch automatically during authentication:

  • Manually navigate to http://localhost:5000 in your browser
  • Check if port 5000 is already in use by another application

"Invalid Client" Error

This usually means:

  • Your auth.txt file is missing or incorrectly formatted
  • Your Client ID or Client Secret is incorrect
  • Verify your credentials in the Toodledo API settings
  • Run setup command to re-enter credentials

"Redirect URI Mismatch" Error

  • Ensure your Toodledo app registration has the redirect URI set to: http://localhost:5000/callback
  • The URI must match exactly (including the protocol and port)

Token Expired / Authentication Failed

  • Delete token.txt and restart the application to re-authenticate
  • The app should automatically refresh tokens, but manual re-auth may be needed if the refresh token expires

Tasks Not Updating After "Done" Command

  • Try running the list command again to refresh the task list
  • Verify the task ID is correct
  • Check your internet connection

Port 5000 Already in Use

If you get an error that port 5000 is already in use:

  • Close any other applications using port 5000
  • Or modify the port in AuthService.cs (remember to update your Toodledo redirect URI accordingly)

πŸ“š Additional Resources

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

🀝 Contributing

Contributions are welcome! Feel free to:

  • Report bugs by opening an issue
  • Suggest new features
  • Submit pull requests
  • See CONTRIBUTING.md for details.

πŸ‘€ Author

Christopher Jay Craft


Enjoy managing your tasks from the terminal! πŸŽ‰

About

A lightweight, modern C# CLI tool for managing your Toodledo tasks directly from the terminal.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages