I’v put a demo up here with a bit more functionality (mostly up and down arrow keystrokes to navigate a “history” of command entered - just to eliminate some typing when checking out the demo so far)
Let’s keep it simple at first. Let’s start with one command line function and work from there. I was originally thinking of starting with a useful export function, but realise that it may be a little further down the road.
How about tagging a tiddler? The syntax could be straightforward such as tag-tiddler tag="[[CLI]] [[Done]] [[Review and Check]]" tiddler="[[Tiddler-A]] [[Tiddler-B]]".
At some point we might want to get a sub-group together to discuss this topic. I could even host a TiddlyWiki if you like? Correct me if this is faux-pas or not doable. I don’t really know what the conventions are here.
And you simply need to ctrl+shift+P (this works in Tiddlywiki Desktop and TidGi desktop, in browser it is crtl+shift and type $ manually), and type open comm and press Enter, to open this example command.
Action tiddler have access to variables like <<storyTiddler>>, so you can add tag to it. Use log action widget in it to find more variable available to use.
Sounds good - I think there are examples of community projects on this discussion forum - so I would check a few out to see what they do and then go from there.
Yes - this is a good starting use case - I’ll modify the demo to see if this can be done entirely in WikiText & existing widgets…
I had a quick play around with this but it felt a bit clunky for me (for example the pallette disappeared after each command - so you need to keep opening it up each time to use it) .. But its definately worth another look to understand its mechansims - maybe the UI’s of our approaches could differ but the underlying commands could be consistent (and hence shared)
If you just accept a line of text you can give this to the listops parameter to add and remove tags eg -tag1 -[[tag 2]] +tag3 tag4.
In fact if you look closely at the tiddlywiki syntax there are plenty of places where someone with tiddlywiki knowledge can type in filters, parameters, values that are given to widgets and triggered by a button.
One could also create a kind of meta language where what is entered is first parsed from shortcut terms to generate actions.
Please forgive me: if it seems I’m trying to revive this old post. I am. And I am not. But, yes, I am. Please let me outline my reasons why:
WARNING!: GROVELLING FOLLOWS:
BEGIN: GROVELLING
I don't think I need to tell you that TW is one of the most ground-breaking applications of HTML5.
As I recall, Jeremy Ruston once said that a coder at Google couldn't wrap his head around the idea
that TW would be a single page. I think I speak for many when I say that TiddlyWiki's
pulled me deeper and deeper into the world of computing and coding. -TW user since 2016.
END: GROVELLING
So, here is why I am posing this. Big picture: A CLI could be a unique addition to a future of the TW interface. Could it be bigger? In short: I think so. TiddlyWiki could be the launch pad for an interface with a “page” not yet applied anywhere else. Imagine a script you run on a travel booking website that includes all your requests in one go so that you don’t need to keep scrolling and selection things like calendars, dates etc.
Back to Earth. I believe that a CLI for TiddlyWiki would be a game changer. We could integrate the work of so many contributors who’ve created plug-ins and code snippets.
I may be over the top, but I will be welcoming all input be it positive or negative.
I think the closest thing to this that we have now is action widgets. I think action widgets and messages are probably the closest thing to this that we have already, and they are quite powerful. The problem is that it seems like people don’t really see the possibilities immediately. Most of the things you propose in your initial post are things that can already be done, if I’m not mistaken.
Sorry for a delay in getting back to this topic… but I came up with a idea today that could be straight forward to implement and possibly very familiar to most TW users… The idea is to use an extension of filter syntax to execute one or more modification steps… So to tag a tiddler you would enter the following into a Command Line :
[[Task Tiddler A]addtag[Done]]
The addtag operator would be a new operator that takes in the input of tiddlers (via any filter steps already available) and a parameter that is the tag to add. Just like filter operators you could chain multiple “modifier operators” together into a run …
Ultimately there would be a modifier operator similar to the function filter operator that would call any defined procedure with the parameters supplied in the filter syntax. Those procedures would then use action-widgets to modify tiddlers.
From an implementation POV - its possible to do this now using what is available in the core ( so enabling indirect parameters, variable parameters etc…) by simply adding a tiddler with module-type: filteroperator … The one catch is to ensure the modifiers don’t execute when used in a standard list widget or others that render with regular filters - but again there is a means to do that in the core using the parameters supplied to the filter functions. If needed it may be possible to split these into a seperate module-type.
Let me know if the syntax works … I think it should be familiar enough to be very user friendly.
While I mostly like this, I wonder if we could include a syntactic convention to note that this is not a typical filter operator, none of which, I believe, ever modify the tiddler store. (Are there exceptions?) Perhaps a convention I’ve seen in Ruby and LISP of appending a “!” on such a modifier:
[[Task Tiddler A]addtag![Done]]
I would prefer that the mark comes up front, but we can’t do that with the bang (exclamation mark), as it’s already in use as the Boolean “not”. What about #? Would that be backwardly compatible?
[[Task Tiddler A]#addtag[Done]]
I think so. We should be easily able to separate those operators which only work in this sort of command situation from our more typical query ones.
I’m not a developer. I have used DOS batch files & Powershell for decades because they have “simple overall control”. Used them to get precision for my needs.
That seems right. Innerwiki is super-cool, relatively simple to use and offers a great way to test and create new things.
Rather than a command line tool I did build a process for what I called at the time “action tiddlers”. You could drop an action tiddler on a “drop bar” and it would sit there until clicked to action or X to remove. On click it would trigger the actions stored there in which could do anything you wanted to one or more tiddlers. An example may be exporting the trash to a wiki acting as an archive.
It could be useful to modify rather than replace one or more tiddlers.
Although I did not continue this when I established how useful bookmarklets are see https://bookmarklets.tiddlyhost.com/ because they can add (basic) and change / delete tiddlers on any wiki if needed with a little Javascript.
Other prior ideas;
Some time ago I created a kind of command line where I allowed a user to edit a text field that was then fed to the action list ops widgets “” to action the filter, subfilter or tags. eg you could type +tagname +[[tag name]] or -tag2name, I belive there is a full set of posibilities that could be developed to add a whole suite of text driven actions (with an enter or go button) this way.
If you look in detail at tiddlyhost bookmarklets, if you use advanced search filter tab to list some tiddlers, there are two icons like bookmarks. One can be used to drag a bookmarklet of all tiddlers to the browser bookmarks, the other creates a tiddler containing the bookmarklet allowing sharing as a tiddler.
The advantage being its well established how to share tiddlers, thus bookmarklets.
The current bookmarklets solution uses TiddlyWiki’s $tw.wiki.addTiddlers function to basicaly pack tiddlers into a bookmarklet.
This points us to the fact that any JS function in tiddlywiki, or added via plugin can be executed in an interactive wiki via bookmarklets or JavaScript “links”.
I would like to make a tool that lets a user look inside the bookmarklet to see what changes it will apply, because if we share bookmarks publicaly we need to add some security.
This is in part why I published https://bookmarklets.tiddlyhost.com/ so users can create their own bokmarklets and not rely on those created by third parties.