Skip to content

New file helper #77

Open
Open

Description

@mindsocket

To complement template-sync command there could be a new-node command or something that creates a boilerplate file given enough params to do so. This should be a plugin point complementary to parse, that is a parse-capable plugin would typically support writing a new file to the same source space, starting with markdown.

eg:sctx new-node <space> <node-type> {<path>|--stdout} [--include-optional] [--values {object}] [--body {content}]

Alternatives to consider

(to be explored/decided)

Embracing templates as a thing:

sctx template apply ... # apply a template to a new or existing node - fills in blanks for existing nodes
sctx template sync ... # new home for existing templates-sync

Embracing node types as a thing

As above but s/template/type/ and see what that feels like conceptually

sctx type apply ...
sctx type template-sync ...

[!note] on deriving location for a new node
Issue #73 talks about content type inference from structure. It might be better to extend that to being a content structure signal more broadly, used for type inference, but also for working out where to put a new file. eg "flat" structure puts everything in one folder, "by-type" would find a matching directory by type for new files.

Activity

  1. mindsocket commented on Apr 7, 2026

    @mindsocket
    OwnerAuthor

    The type inference work (folder-based type inference from #1c94898) opens a path for this — a new-node command could use the same inference logic to determine the correct type or placement for a new file given a target location, reducing what the user needs to specify explicitly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions