Proposal: WikiShell / TiddlyCLI - A Command Console for TiddlyWiki

So still experimenting here and learning alot about the keyboard widget !!

It turns out its surprisingly easy to run <action... widgets that are typed into a edit field. Here is a brief version of the code to do just this:

\procedure onEnter()
		{{temp!!command}}
\end

<$keyboard key="enter" actions=<<onEnter>> >
<$edit-text field="command" placeholder="Enter commands here..." />
</$keyboard>

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)

3 Likes

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.

@AlfieA Hi, have you tried https://tiddly-gittly.github.io/tw-command-palette/

If you read Command palette plugin v1.0 , powerful context search bar, search under filter, etc
You will find you can add command with tag

caption: Tiddler Commander
tags: $:/tags/Actions
title: $:/plugins/kookma/commander/buttons/ActionOpenCommander

<$action-navigate $to="$:/Commander"/>

like Create ActionOpenCommander.tid by linonetwo · Pull Request #36 · kookma/TW-Commander · GitHub

Then it works:

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.

And in TidGi desktop environment, you can use https://tiddly-gittly.github.io/zx-script to run any JS like in a browser JS console.

TidGi desktop is an electron wrapper of Nodejs wiki that provides additional features like this.

Yes.

It is still very obscure to a newbie user!

Who (your targets) need which competence to use it?

Anyone?

Just asking, TT

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.