Bike 2.0 extension code (upcoming breakage)

As I continue to work on CLI I’m offering various output options. For example when you get and outline the results can be .bike, .markdown, .json, etc. Easy enough.

The problem is I also want the CLI to be able to get an outline. Examine it, and then update a specific row. The easy way to do this is by using IDs, but there’s a terminology problem between Bike’s file formats and the current extension API. In the file formats “id” is a “persistent id”, and only assigned to some rows.

On the other hand in the extension API “id” is a temporary session id. All rows have them. And there is also “persistentId”, some rows have them. So “id” is being used multiple different ways.

I think the clean fix is:

  1. File formats stay the same
  2. Extension API “id” → “sid”
  3. Extension API “persistentId” → “id”

I haven’t totally committed to this yet, but I think it’s what I’ll do. So heads up, and feedback welcome.


And sids will be returned by the CLI when using the JSON output option. Giving the CLI direct access to any row.

And 15m later… I think I’m changing my mind!

I had thought that the AppleScript API and Shortcuts API were already mapping “id” to “persistent id”, but they are not. I don’t want to change all of that, so ignore this post and carry on!

It will continue to be a little confusing that document formats “id” maps to runtime API “persistentId”. But not all that confusing!

2 Likes