<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Diya Vijay</title>
    <description>The latest articles on DEV Community by Diya Vijay (@diyavj).</description>
    <link>https://dev.to/diyavj</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F718175%2F76cbede9-62fa-4199-902c-fefea9af0d1d.png</url>
      <title>DEV Community: Diya Vijay</title>
      <link>https://dev.to/diyavj</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/diyavj"/>
    <language>en</language>
    <item>
      <title>I Built an AI That Wants You to Stop Using It 🌱</title>
      <dc:creator>Diya Vijay</dc:creator>
      <pubDate>Sat, 10 Oct 2026 12:53:25 +0000</pubDate>
      <link>https://dev.to/diyavj/i-built-an-ai-that-wants-you-to-stop-using-it-40gh</link>
      <guid>https://dev.to/diyavj/i-built-an-ai-that-wants-you-to-stop-using-it-40gh</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/hacktoberfest-week1-2026-10-05"&gt;Hacktoberfest Open-Source AI Challenge Week 1: Touch Grass&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  What I Built
&lt;/h1&gt;

&lt;h3&gt;
  
  
  GrassQuest — an AI app that wants you to stop using it.
&lt;/h3&gt;

&lt;p&gt;Most AI apps try to keep you on your screen.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GrassQuest does the opposite.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It is an offline AI-powered nature scavenger hunt. The app gives you a real-world challenge like:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;🍃 Find a leaf.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You go outside, find one, take a photo, and GrassQuest uses a &lt;strong&gt;local open-weight vision model&lt;/strong&gt; to check whether you've completed the challenge.&lt;/p&gt;

&lt;p&gt;If you succeed:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;🎉 Challenge Complete!&lt;br&gt;
+10 XP&lt;/p&gt;

&lt;p&gt;📱 &lt;strong&gt;Now put your phone away.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The idea is simple: &lt;strong&gt;AI should sometimes help you leave the screen, not spend more time on it.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It's designed for anyone who wants a small excuse to step outside — especially people who spend most of their day working or studying in front of a screen.&lt;/p&gt;

&lt;p&gt;The game includes XP, levels, streaks, milestones, and different challenges to make going outside feel a little more fun.&lt;/p&gt;

&lt;h1&gt;
  
  
  Demo
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fg2eqtr0yempx5t0z4i08.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fg2eqtr0yempx5t0z4i08.png" alt=" " width="799" height="434"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;GrassQuest works in one simple loop:&lt;/p&gt;

&lt;p&gt;Get a challenge → Go outside → Find it → Take a photo → Local AI verifies it → Earn XP → Put your phone away.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fk8obip1slzh6egictxf1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fk8obip1slzh6egictxf1.png" alt=" " width="800" height="423"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the demo, I complete a real challenge by finding a leaf and having the local vision model verify it.&lt;/p&gt;

&lt;p&gt;The AI runs locally using SmolVLM2 + MLX, so the core image analysis doesn't depend on a cloud vision API. I also tested the local version with the internet disconnected after the model was downloaded.&lt;/p&gt;

&lt;p&gt;The best part of the demo is what happens after the AI does its job:&lt;/p&gt;

&lt;p&gt;“Challenge Complete 🎉 Now put your phone away.”&lt;/p&gt;

&lt;p&gt;I also tested the application with the internet disconnected after the AI model had been downloaded.&lt;/p&gt;

&lt;h1&gt;
  
  
  Code
&lt;/h1&gt;

&lt;p&gt;💻 &lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/DiyaVj/grass-quest" rel="noopener noreferrer"&gt;https://github.com/DiyaVj/grass-quest&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The project is intentionally small and easy to run locally. There is no database, no user account, and no cloud AI API involved in the core experience.&lt;/p&gt;

&lt;h1&gt;
  
  
  How I Built It
&lt;/h1&gt;

&lt;p&gt;GrassQuest uses &lt;strong&gt;SmolVLM2-2.2B-Instruct&lt;/strong&gt;, an open-weight vision-language model, running locally through &lt;strong&gt;MLX&lt;/strong&gt; and &lt;code&gt;mlx-vlm&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The architecture is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                 GrassQuest
                     │
                     ▼
              Next.js PWA
                     │
              Take a photo
                     │
                     ▼
             Local FastAPI API
                     │
                     ▼
          SmolVLM2-2.2B-Instruct
                + MLX
                     │
              Visual perception
                     │
                     ▼
          Deterministic Python
              validation
                     │
                     ▼
             Challenge result
                     │
                     ▼
             XP / Milestone
                     │
                     ▼
             📱 Put it away
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The important part is that &lt;strong&gt;the AI is not just an optional feature added on top of the application.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It is the mechanism that makes the scavenger hunt work.&lt;/p&gt;

&lt;h3&gt;
  
  
  A problem I ran into
&lt;/h3&gt;

&lt;p&gt;My first implementation asked the vision model something like:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Does this image satisfy the challenge?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That sounded reasonable.&lt;/p&gt;

&lt;p&gt;It wasn't.&lt;/p&gt;

&lt;p&gt;The model could see the image correctly but still hallucinate that the required object was present because the challenge itself was influencing its answer.&lt;/p&gt;

&lt;p&gt;For example, an image containing a person could be incorrectly judged as containing a rock when the challenge was "Find a rock."&lt;/p&gt;

&lt;p&gt;So I changed the architecture.&lt;/p&gt;

&lt;p&gt;Instead of asking the model to make the final decision:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;VLM → "Yes/No, did they complete the challenge?"&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I now use:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;VLM → "What target object is visibly present, and how many can you see?"&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Then deterministic Python code makes the final decision.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Challenge:
Find two leaves.

AI perception:
leaf → count: 1

Python validation:
1 &amp;gt;= 2 → false

Result:
Challenge failed
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This separation makes the system much more reliable and gives the AI a clearly defined role: &lt;strong&gt;visual perception, not business logic.&lt;/strong&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Why Does Open Innovation Matter?
&lt;/h1&gt;

&lt;p&gt;I could have built this using a closed vision API.&lt;/p&gt;

&lt;p&gt;But that would miss an important part of the idea.&lt;/p&gt;

&lt;p&gt;GrassQuest is specifically designed around &lt;strong&gt;local AI&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Once the model has been downloaded, the image analysis can happen without sending the user's photos to a third-party AI service.&lt;/p&gt;

&lt;p&gt;That gives the project several advantages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🔒 &lt;strong&gt;Privacy&lt;/strong&gt; — photos don't need to leave the local environment for AI analysis.&lt;/li&gt;
&lt;li&gt;📡 &lt;strong&gt;Offline capability&lt;/strong&gt; — the core AI inference doesn't depend on an internet connection.&lt;/li&gt;
&lt;li&gt;💰 &lt;strong&gt;No per-image API cost&lt;/strong&gt; — there is no cloud inference bill for every challenge.&lt;/li&gt;
&lt;li&gt;🧩 &lt;strong&gt;Model freedom&lt;/strong&gt; — the open-weight model can be replaced, optimized, or experimented with.&lt;/li&gt;
&lt;li&gt;🔍 &lt;strong&gt;Transparency and control&lt;/strong&gt; — I can inspect and change how the AI is used rather than treating a closed API as a black box.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For this particular project, open AI also makes the product concept stronger.&lt;/p&gt;

&lt;p&gt;The whole point is to &lt;strong&gt;disconnect from the screen&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;It felt contradictory to build an app encouraging people to go outside while requiring a constant connection to a cloud AI service.&lt;/p&gt;

&lt;p&gt;Local inference makes that contradiction much smaller.&lt;/p&gt;

&lt;h2&gt;
  
  
  The idea behind GrassQuest
&lt;/h2&gt;

&lt;p&gt;The easiest way to describe GrassQuest is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;What if the best AI app was one you were supposed to stop using?&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;AI is becoming very good at helping us do more things on our screens.&lt;/p&gt;

&lt;p&gt;I wanted to build something that used AI for the opposite purpose.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Go outside. Find something real. Take one photo. Let AI verify it. Then put the phone away.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That's GrassQuest.&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>hf26challenge</category>
    </item>
    <item>
      <title>How Can Power Virtual Agents Transform Your Customer Engagement?</title>
      <dc:creator>Diya Vijay</dc:creator>
      <pubDate>Fri, 03 Nov 2023 15:48:46 +0000</pubDate>
      <link>https://dev.to/diyavj/how-can-power-virtual-agents-transform-your-customer-engagement-1c5f</link>
      <guid>https://dev.to/diyavj/how-can-power-virtual-agents-transform-your-customer-engagement-1c5f</guid>
      <description>&lt;p&gt;Are you a student with a groundbreaking startup idea or an entrepreneur aiming to elevate your business to new heights? In today's fast-paced digital landscape, effective customer engagement is the key to success. But how can you stay ahead in this ever-evolving world of innovation?&lt;/p&gt;

&lt;p&gt;Introducing Power Virtual Agents (PVA) – a true game-changer in the realm of conversational AI (Artificial Intelligence). Whether you're a student start-up with a vision or a seasoned entrepreneur seeking to revolutionize your project, this is an opportunity you won't want to miss.&lt;/p&gt;

&lt;p&gt;With PVA, you'll embark on an exciting journey into the world of conversational AI, where the possibilities are limitless. Discover how this revolutionary technology can help you engage your customers more effectively, drive growth, and take your business to the next level.&lt;/p&gt;

&lt;p&gt;Ready to explore the future of customer engagement? Click the link below to dive into our article and empower your business with the magic of Power Virtual Agents: &lt;a href="https://techcommunity.microsoft.com/t5/educator-developer-blog/revolutionize-customer-engagement-empowering-your-business-with/ba-p/3952502?wt.mc_id=studentamb_150623" rel="noopener noreferrer"&gt;Read Now&lt;/a&gt; 🌟&lt;/p&gt;

</description>
      <category>microsoft</category>
      <category>productivity</category>
      <category>powerplatform</category>
    </item>
    <item>
      <title>Introduction to Stack</title>
      <dc:creator>Diya Vijay</dc:creator>
      <pubDate>Tue, 08 Feb 2022 13:49:00 +0000</pubDate>
      <link>https://dev.to/diyavj/introduction-to-stack-1833</link>
      <guid>https://dev.to/diyavj/introduction-to-stack-1833</guid>
      <description>&lt;p&gt;Stack is a linear data structure in which data can be added or removed only at one end. This end is generally known as "TOP" of the stack.&lt;br&gt;
let's take one example for better understanding. It is like stack of plates in cafe, where every new plate is added to the top of the stack and removed from the top as well. This simply means that the last plate added to a stack is the first plate to be removed. Hence stacks are also called Last in First Out (LIFO)structure.&lt;br&gt;
Let's take another example. Look in this picture, it looks yummy right? haha....it's a stack of oreo. Now if you want to build the Eiffel Tower then you have to add another Oreo on top of this Oreo stack. And now imagine you want to eat an Oreo (read the second word after "and" again, just imagine or buy your own Oreo cause obviously I won't share it with you, LOL) then you have to take it from the top of the Oreo stack.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsmq254ld6163olxi41en.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsmq254ld6163olxi41en.png" alt=" " width="800" height="1200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now let's talk about implementation of stack. well, stack can be implemented in two ways.&lt;br&gt;
1) Static implementation&lt;br&gt;
2) Dynamic implementation&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Static implementation&lt;/strong&gt; : static implementation uses array to creat stack.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Dynamic implementation&lt;/strong&gt; : It uses linked list that uses pointers to implement the stack.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;# Terminology of Stack&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;PUSH&lt;/strong&gt;: when an item is added or inserted in a stack, the operation is known as push.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;POP&lt;/strong&gt;: when an item is removed or deleted from a stack, the operation is known as pop.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;TOP&lt;/strong&gt;: this term refers to the top of stack. top is used to check stack's overflow or underflow condition. top is initialized by -1.&lt;br&gt;
&lt;code&gt;if TOP = -1   // indicates the stack is empty&lt;br&gt;
if TOP = MAXSIZE-1   // indicates the stack is full&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>dsa</category>
      <category>stack</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>Docket – A CLI application</title>
      <dc:creator>Diya Vijay</dc:creator>
      <pubDate>Sun, 30 Jan 2022 10:51:33 +0000</pubDate>
      <link>https://dev.to/diyavj/docket-a-cli-application-1o2a</link>
      <guid>https://dev.to/diyavj/docket-a-cli-application-1o2a</guid>
      <description>&lt;p&gt;Let's build a docket cli application. A docket is just a list of tasks that must be done. It functions similarly to a to-do application in that you may add tasks, browse a list of tasks, and mark them as completed once they are completed.&lt;br&gt;
You must first install Python on your machine. Python is generally installed by default on most current systems. Open a terminal and type the following command to see which version of Python is installed on your machine.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;python3 –version&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;It will give you information about the Python version that is currently installed. You can also install Python by visiting this website: &lt;a href="https://installpython3.com/" rel="noopener noreferrer"&gt;https://installpython3.com/&lt;/a&gt;.&lt;br&gt;
To begin, make an empty folder in which to save our project's files.&lt;br&gt;
Now, open your favorite code editor and begin developing our program. Open the empty folder we made for our project. Now, activate the Python environment; if you have Python 3.4 or higher, execute the following command.&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ python -m venv [directory]&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Bingo! Our Python environment is now active. Now, let's create our python file and name it "'docket.py"', but it's not required to use the same name; you're smart, and I know you can come up with a better one.&lt;br&gt;
Before we begin coding in our Python file, we must first generate four other files. Wait! I know you're excited, but let me explain you what kind of files we'll be making and why. So, we'll need to make two text files: one for entering our tasks (task.txt) and another for keeping completed tasks (completed.txt). Let us now discuss the last two files. We must write one “.bat” (docket.bat) file (which will allow us to run the software on Windows) and one “.sh” (docket.sh) file (helps us to run the program on Linux). However, you must include the following code in these files.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;docket.bat&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@echo off

Python3 docket.py %1 %2 %3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;docket.sh&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!/usr/bin/env bash

Python3 docket.py “$@”
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finally! Now take off!!!!  for our python file, which will be used to code our fantastic program. For constructing our application's CLI interface, we will use Python's argparse module. The argparse module simplifies the creation of user-friendly command line interfaces. The argparse module also generates help and usage messages automatically and generates errors when users provide invalid arguments to the program. You may install argparse on your terminal by typing "' pip install argparse"'.&lt;/p&gt;

&lt;p&gt;Import argparse and use the code below to open our txt files.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import argparse

task = open("task.txt","r+")
completed_task = open("completed.txt", "r+")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create some variables to read lines from and the length of our txt files.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;task_data = task.readlines()
completed_data = completed_task.readlines()
c=len(completed_data)
t= len(task_data)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's begin our argparse module now.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;parser= argparse.ArgumentParser()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We need to add arguments to the CLI in order to accept user input. We basically need two arguments. One is input1 for writing instructions, and the other is input2 for writing assignments. This is how you use argparse to declare variables and take input from the cli.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;parser.add_argument('input1',
action='store', type=str, nargs='?', default='default')

parser.add_argument('input2', action = 'store',
                    nargs='?',
                    default='-1')

args = parser.parse_args()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's get started on the conditions for our commands now. First, we specify whether we want to use the default mode or enter the command "'./docket help"', which will display the application's usage.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if(args.input1 == 'default' or args.input1 == 'help'):
    print('''Usage :-
$ ./docket add "hello world"    # Add a new item with priority 2 and text "hello world" to the list
$ ./docket ls                   # Show incomplete list items
$ ./docket del INDEX            # Delete the incomplete item with the given index
$ ./docket done INDEX           # Mark the incomplete item with the given index as complete
$ ./docket help                 # Show usage
$ ./docket report               # Statistics''')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, we'll define our program for adding new items. Put a condition that says if our input1 is "add" and our input2 is default (which is -1 for input2, which helps us write our task), then write and store the input2 string in our task.txt file. The task's text should be enclosed by double quotations (otherwise only the first word is considered as the item text, and the remaining words are treated as different arguments).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Add a new item

elif(args.input1 == 'add' and args.input2 != '-1'):
    task.write(str(args.input2) +"\n")
    print('Added task: '+ (args.input2))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The following step is to write code to display a list of all pending items. If input1 is "ls" (which represents a list) and the length of our line in task.txt is larger than 0, then read each line in task.txt with relevant indexes. If your input1 is ls but the length of the line in task.txt is not defined or 0 then print the no pending task message.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# List all pending items

elif(args.input1 == 'ls'and t&amp;gt;0):
    for i in range(t,0,-1):
        line = task_data[i-1].strip()
        print(str(i)+'. '+line)

elif(args.input1 == 'ls'):
    print("There are no pending tasks!")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We've reached the halfway.  Bingo!! Begin by defining our condition for removing an item from a list. Put a condition that says if our input1 is del (which means delete) and our input2 is not default but is an integer larger than 0 and less than the length of the line in task.txt, then delete that index line from task.txt. If the index does not exist, an error message is displayed.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Delete an item

elif(args.input1 == 'del' and args.input2 != '-1' and int(args.input2) &amp;lt;= t and int(args.input2)&amp;gt;0):
    task_data.remove(task_data[int(args.input2)-1])
    task.truncate(0)
    task.seek(0)
    for line in task_data:
        line = line.strip()
        task.write(line+"\n")
    print('Deleted item with index '+(args.input2))

elif(args.input1 == 'del'):
    print("Error: item with index "+str(int(args.input2))+" does not exist. Nothing deleted.")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Its time to mark our task as completed.  Lets put a condition if input1 is done and input2 is not default but it is integer greater than 0 and less than equal to the length of line present in task.txt then mark that line as done and remove it from task.txt and store it in completed.txt file, use relevant index to remove and store line. And if index does not exist then show error.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Mark a task as complete

elif(args.input1 == 'done' and args.input2 != '-1' and int(args.input2) &amp;lt;= t and int(args.input2)&amp;gt;0):
    line = task_data[int(args.input2)-1]
    completed_task.write(task_data[int(args.input2)-1])
    task_data.remove(task_data[int(args.input2)-1])
    task.truncate(0)
    task.seek(0)
    for line in task_data:
        line = line.strip()
        task.write(line+"\n")
    print('Marked item as done.')

elif(args.input1 == 'done'):
    print("Error: no incomplete item with index "+str(int(args.input2))+" exists.")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finally! We are now ready to generate our report. Huhhh…&lt;br&gt;
Put a condition that says if our input1 is a report, then show all the data in task.txt and completed.txt.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Generate a Report 

elif(args.input1 == 'report'):
    print("Pending tasks: "+ str(t))
    for i in range(t,0,-1):
        line = task_data[i-1].strip()
        print(str(i)+'. '+ line )
    print("Completed tasks: "+ str(c))
    for i in range(c,0,-1):
        line = completed_data[i-1].strip()
        print(str(i)+'. '+ line )
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Tada!! Our cli application is now ready to use. You did it, and I'm delighted it came in handy. The complete source code is available on &lt;a href="https://github.com/DiyaVj/Docket" rel="noopener noreferrer"&gt;my github repo&lt;/a&gt;. Visit it Once.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fspwoieqp5awd4qn3f0sf.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fspwoieqp5awd4qn3f0sf.gif" alt="party gif" width="500" height="226"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>programming</category>
      <category>python</category>
      <category>github</category>
    </item>
  </channel>
</rss>
