Subsystem Search

Part 5 of 6 The command line

Your own list

By the end of this chapter, a week of Laurence's work is in Subroutine: what is due, what he has put off until it matters, what comes round every month, and how to ask for one day rather than all of it.

This is the first chapter about using Subroutine rather than setting it up, and it is back on your own machine, where Install it, and tell your agent left one. Everything here works the same against an instance somebody else runs.

The work so far

Subroutine installed, an instance, and a project for the team's work:

$ uv tool install subroutine
Resolved … packages in …
Prepared … packages in …
Installed … packages in …
…
Installed 2 executables: subr, subroutine
$ subroutine init --workspace metacortex --instance-name MetaCortex
Ready. Try: subroutine add "something to do"
$ subroutine project create web "Website rebuild"
Created web - Website rebuild
…

One line becomes a task

$ subroutine add 'Rewrite the home page copy by Friday !3/2 ~2h +web'
Added: Rewrite the home page copy  (due Fri 9 Oct)  (read +web !3/2 ~2h)
  Tip: subroutine agenda

Single quotes, not double. ! is history expansion in an interactive shell, so !3 inside double quotes is replaced by an earlier command before Subroutine ever sees it. It fails loudly on an empty history and silently rewrites your title on a real one, which is the case that costs you an afternoon. Single quotes are safe in every shell, so the habit is worth having for the whole line.

The second bracket is the important one. It is Subroutine saying what it took out of your sentence, so you find out now rather than when something does not turn up where you expected it.

Four pieces of grammar in one line, and each is optional:

Anything it does not understand stays in the title, exactly as typed:

$ subroutine add 'Email Bob re: 3pm'
Added: Email Bob re: 3pm
  Left as written: 3pm - a time is read after 'at', or straight after a day, as in 'Dentist on Monday at 2pm'.
  Tip: subroutine agenda

It saw the time, decided it was not one, and told you which. That is the rule that makes the shorthand safe to use without thinking: the worst case is a task whose title is what you wrote, and a line saying what it nearly took.

Your week

$ subroutine add 'Ask Gloria about the vase'
Added: Ask Gloria about the vase
  Tip: subroutine agenda
$ subroutine add 'Fix the leak on the third floor from friday'
Added: Fix the leak on the third floor  (deferred until Fri 9 Oct)
  Tip: subroutine agenda

from is the opposite of by. A deadline says when something must be finished; from says there is no point looking at it before then, and hides it until that day.

$ subroutine agenda
Nothing due today.
Next 7 days
   #1  !3/2  2h  web    Rewrite the home page copy  (due Fri 9 Oct)

Next
   #2            inbox  Email Bob re: 3pm
   #3            inbox  Ask Gloria about the vase
…

subroutine agenda is today first, then the week, then everything else. The leak is in none of those, because it is deferred.

Ask for another day and you get that day's version of the same thing:

$ subroutine agenda friday
Fri 9 Oct

Today
   #1  !3/2  2h  web    Rewrite the home page copy  (due Fri 9 Oct)

Next
   #2            inbox  Email Bob re: 3pm
   #3            inbox  Ask Gloria about the vase
   #4            inbox  Fix the leak on the third floor  (deferred until Fri 9 Oct)
…

The copy is now Today rather than Next 7 days, and the leak has appeared, because on Friday it is no longer put off. That is the quickest way to answer what does Friday look like, and it is the same command with a day after it.

The whole list, and what it holds back

$ subroutine list
   #3            inbox  Ask Gloria about the vase
   #2            inbox  Email Bob re: 3pm
   #1  !3/2  2h  web    Rewrite the home page copy  (due Fri 9 Oct)
      1 thing deferred until later. 'subroutine list --deferred' to include them.
…

subroutine list is everything you could start, newest first. Asking it for what is ready, or for an order of your own, is the next chapter's. The line at the bottom is the point. Something hidden is a thing you have to be told about, or a list that quietly leaves work out is worse than no list: it says so, counts them, and gives you the flag.

Finding one

$ subroutine search vase
   #3  Ask Gloria about the vase
…

subroutine search reads titles and what has been written on a task. On PostgreSQL it can use the database's own full-text search instead, which stems words and ranks results, as PostgreSQL, and when to switch sets up in one line.

Moving something

Putting a thing off after you have written it down is subroutine defer, which takes the same words the capture line does:

$ subroutine defer 2 tomorrow
Deferred until Tue 6 Oct: Email Bob re: 3pm
…

and subroutine plan says when you mean to start something, which is a different claim from when it is due:

$ subroutine plan 3 friday
Starts Fri 9 Oct: Ask Gloria about the vase
…

A deadline is a fact about the work and a plan is a fact about you. Keeping them apart is what lets a list tell you that you have planned four things for Thursday that will not fit.

Something that comes round

$ subroutine add 'Renew the domain by Friday every month'
Added: Renew the domain  (every month, due Fri 9 Oct)
  Tip: subroutine agenda

Put the repeat at the end of the sentence. Words after it are read as part of the title rather than as a repeat, and Subroutine says so rather than guessing:

$ subroutine add 'Renew the certificate every month starting Friday'
Added: Renew the certificate every month starting Friday
…

A repeat it cannot read is left in the title and reported the same way, which is the same rule as the rest of the shorthand: nothing is guessed at, and nothing is lost.

When one comes round and you do not need it this time, subroutine skip moves to the next occurrence without marking anything done, because a month you skipped is not a month you did.

Where the rest of the grammar is

Everything the capture line understands is one command away, and it is worth reading once:

$ subroutine explain capture
One line becomes a task. Anything not understood stays in the title.
…

subroutine explain dates does the same for every way of writing a day. They are built into the program rather than kept here, so they describe the copy you have installed.

With that, a week is in one list: what is due, what is waiting, what is coming round, and one command for any day you want to look at. The next chapter gives that work somewhere to live, and a way to ask what can actually be started.