Command-line interface to Microsoft To Do

Overview

This is a hackathon project with no official support or quality guarantee

Hackathon 2022

tdi

The command-line interface, for some, is the natural way to work on a computer. The "To Do" app is the standard, simple interface to a simple problem. Microsoft has a wonderful desktop/GUI application for doing such things - https://todo.microsoft.com/tasks/. tdi (short for To Do Interface) intends to create a CLI app and interface to Microsoft Graph, the store for Microsoft To Do's managed tasks. The app will be built in and released through Github - hoping for Windows, macOS and Linux builds.

License

MIT

Development

There is an "official" application registration in Azure for the client. But if you're wanting to use your own for development you can follow these steps:

https://learn.microsoft.com/en-us/azure/healthcare-apis/register-application

You will need both the CLIENT_ID and CLIENT_SECRET. In addition you'll need to add the appropriate API permissions for user.read and tasks.readwrite in order for the application to access the Graph API. With the credentials in hand you will then add them into the source code before building - here: https://github.com/microsofthackathons/tdi/blob/develop/src/tasks.rs#L17

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.

Comments
  • Admin grant required for Enterprise accounts

    Admin grant required for Enterprise accounts

    ...but shouldn't be according to the MS Graph docs on perms per API.

    https://stackoverflow.com/questions/61258791/admin-consent-required-with-only-delegated-permissions https://learn.microsoft.com/en-us/graph/permissions-reference

    We're only using Tasks and User.ReadBasic which show as not requiring admin grant on login.

    opened by kitplummer 5
  • If auth token doesn't exist locally, handle smartly

    If auth token doesn't exist locally, handle smartly

    Currently:

    PS C:\Users\kitplummer\Code\tdi> cargo run me    
        Finished dev [unoptimized + debuginfo] target(s) in 0.77s
         Running `target\debug\tdi.exe me`
    thread 'main' panicked at 'tdi: unable to read access token configuration.: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }', src\auth.rs:85:10
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
    error: process didn't exit successfully: `target\debug\tdi.exe me` (exit code: 101)
    
    opened by kitplummer 1
  • Implement authentication/authorization to Microsoft Graph/Azure...

    Implement authentication/authorization to Microsoft Graph/Azure...

    As a tdi user, I need to be able to login with my Microsoft credentials in order to gain access to my To Do tasks.

    DoD: when a user can run a tdi login command and capture an authentication token locally - requiring the full authentication loop to/from the browser.

    enhancement 
    opened by kitplummer 1
  • update: move auth to own module

    update: move auth to own module

    • moves auth functions into own module
    • removes need for CLIENT_SECRET
    • including the actual app ID
    • exit gracefully from successfully logging in
    • logout support
    opened by kitplummer 0
  • Commands are not closing, hanging the CLI and not exiting.

    Commands are not closing, hanging the CLI and not exiting.

         Running `target\debug\tdi.exe login`
    tdi: authenticating, a browser window will open.
    tdi: creating directory path for access token config.
    tdi: logged in, and stored token for future use.
    

    Sits there and not exiting.

    opened by kitplummer 0
  • Add help doc for

    Add help doc for "tasks" action

    tdi 0.0.1
    Simple CLI for Microsoft's To Do tasks
    
    USAGE:
        tdi.exe [SUBCOMMAND]
    
    OPTIONS:
        -h, --help       Print help information
        -V, --version    Print version information
    
    SUBCOMMANDS:
        add         Create a new task in ToDo
        complete    Complete the given task
        delete      Delete the given task
        help        Print this message or the help of the given subcommand(s)
        intr        Repl todo shell
        lists       Show the lists in the user's ToDo
        login       Login to Microsoft's Graph database
        logout      Logout of Microsoft's SSO
        me          Show user details
        reopen      Reopen the given task
        show        Display the kanban board
        tasks
    
    opened by kitplummer 0
  • Handle case where token has expired...

    Handle case where token has expired...

         Running `target\debug\tdi.exe me`
    Error: Graph error:
    GraphError {
        headers: Some(
            GraphHeaders {
                url: "https://graph.microsoft.com/v1.0/me",
                status: 401,
                header_map: {
                    "transfer-encoding": "chunked",
                    "content-type": "application/json",
                    "strict-transport-security": "max-age=31536000",
                    "request-id": "1740feb8-b33a-4c08-a6ee-ab5cfc5a18c4",
                    "client-request-id": "1740feb8-b33a-4c08-a6ee-ab5cfc5a18c4",
                    "x-ms-ags-diagnostic": "{\"ServerInfo\":{\"DataCenter\":\"South Central US\",\"Slice\":\"E\",\"Ring\":\"5\",\"ScaleUnit\":\"003\",\"RoleInstance\":\"SN4PEPF0000050E\"}}",
                    "www-authenticate": "Bearer realm=\"\", authorization_uri=\"https://login.microsoftonline.com/common/oauth2/authorize\", client_id=\"00000003-0000-0000-c000-000000000000\"",
                    "date": "Fri, 23 Sep 2022 11:57:49 GMT",
                },
            },
        ),
        code: 401,
        error_message: ErrorMessage {
            error: Some(
                ErrorStatus {
                    code: Some(
                        "InvalidAuthenticationToken",
                    ),
                    message: Some(
                        "Access token has expired or is not yet valid.",
                    ),
                    inner_error: Some(
                        InnerError {
                            code: None,
                            request_id: Some(
                                "1740feb8-b33a-4c08-a6ee-ab5cfc5a18c4",
                            ),
                            date: Some(
                                "2022-09-23T11:57:50",
                            ),
                        },
                    ),
                },
            ),
        },
    }
    
    opened by kitplummer 3
  • Test loop that includes an

    Test loop that includes an "auth" cycle

    In order to add to the functional tests suite, need to be able to short-circuit the auth loop, or somehow include it. Requires some serious investigation.

    opened by kitplummer 0
  • add todos to graph-rs library (upstream)

    add todos to graph-rs library (upstream)

    this is a question, as much as a task. need to determine if adding the ToDos API to the graph-rs library is worth the effort, versus implementing the select REST API calls required to support it within this app.

    opened by kitplummer 1
Owner
Microsoft Hackathons
A set of unsupported, temporary hackathon projects from Microsoft
Microsoft Hackathons
Small command-line tool to switch monitor inputs from command line

swmon Small command-line tool to switch monitor inputs from command line Installation git clone https://github.com/cr1901/swmon cargo install --path .

William D. Jones 5 Aug 20, 2022
Low-level Rust library for implementing terminal command line interface, like in embedded systems.

Terminal CLI Need to build an interactive command prompt, with commands, properties and with full autocomplete? This is for you. Example, output only

HashMismatch 48 Jul 30, 2022
Crunch is a command-line interface (CLI) to claim staking rewards every X hours for Substrate-based chains

crunch · crunch is a command-line interface (CLI) to claim staking rewards every X hours for Substrate-based chains. Why use crunch To automate payout

null 36 Aug 27, 2022
Command line interface for Solana Metaplex programs.

Metaplex Command Line Interface This is a command line interface for creating and managing non-fungible tokens on the Solana blockchain through the Me

Caleb Everett 26 Jul 12, 2022
Railway CLI - This is the command line interface for Railway.

Railway CLI This is the command line interface for Railway. Use it to connect your code to Railways infrastructure without needing to worry about envi

Nebula 4 Mar 20, 2022
Command line interface as a function.

Command line interface as a function. fncmd fncmd is an opinionated command line parser frontend that wraps around clap. The functionality is mostly i

Yu Shimura 62 Aug 2, 2022
A silly program written in Rust to output nonsensical sentences in the command line interface.

A silly program written in Rust to output nonsensical sentences in the command line interface.

Rachael Ava 1 Dec 13, 2021
Scouty is a command-line interface (CLI) to keep an eye on substrate-based chains and hook things up

scouty is a command-line interface (CLI) to keep an eye on substrate-based chains and hook things up

TurboFlakes 15 Aug 6, 2022
A standalone Command Line Interface debugging tool for The Witcher 3 written in Rust

A standalone Command Line Interface debugging tool for The Witcher 3 written in Rust. This tool is intended for Witcher 3 modders who make mainly scri

Przemysław Cedro 5 Apr 20, 2022
A command line interface meant to bridge the gap between Rust and shell scripting

clawbang A command line interface meant to bridge the gap between Rust and shell scripting. Intended for use with HEREDOCs and shebangs: $ clawbang <<

Chris Dickinson 52 Mar 25, 2022
Gix is a command-line interface (CLI) to access git repositories

gix is a command-line interface (CLI) to access git repositories. It's written to optimize the user-experience, and perform as good or better than the

Sebastian Thiel 4.2k Sep 28, 2022
The official command-line interface for the makedeb Package Repository

mpr-cli This is the repository for the MPR CLI, the official command-line interface for the makedeb Package Repository. Installation Users have a few

makedeb 7 Sep 3, 2022
A command line interface for trash written in Rust (WIP)

trashctl A command line interface for trash Features Add file to trash List files Permanently delete a file Restore file Empty the trash Documentation

0xMRTT 3 Aug 10, 2022
A command-line interface for Trane

trane-cli This repository contains the code for the command-line interface to Trane. Documentation The latest documentation for trane-cli can be found

The Trane Project 25 Sep 25, 2022
A full featured, fast Command Line Argument Parser for Rust

clap Command Line Argument Parser for Rust It is a simple-to-use, efficient, and full-featured library for parsing command line arguments and subcomma

null 9.6k Sep 28, 2022
Docopt for Rust (command line argument parser).

THIS CRATE IS UNMAINTAINED This crate is unlikely to see significant future evolution. The primary reason to choose this crate for a new project is if

null 743 Sep 25, 2022
Parse command line arguments by defining a struct.

StructOpt Parse command line arguments by defining a struct. It combines clap with custom derive. Documentation Find it on Docs.rs. You can also check

Guillaume P. 2.5k Sep 19, 2022
A command line progress reporting library for Rust

indicatif Documentation A Rust library for indicating progress in command line applications to users. This currently primarily provides progress bars

Armin Ronacher 3k Sep 22, 2022
⚡️ Lightning-fast and minimal calendar command line. Written in Rust 🦀

⚡️ Lightning-fast and minimal calendar command line. It's similar to cal. Written in Rust ??

Arthur Henrique 29 Sep 26, 2022