Skip to content

Make create command work without Obsidian open & expand CLI configuration #83

@Yakitrak

Description

@Yakitrak

Context

notesmd-cli currently relies on Obsidian URI for some operations. While the URI scheme is useful for interacting with Obsidian directly, the CLI should provide value on its own — users should be able to manage their markdown vaults without needing Obsidian running.

Most commands already work this way. delete, list, print, frontmatter etc. are pure filesystem operations. Commands like search, search-content, and move do their core work on the filesystem and only use the URI as a convenience to open the result in Obsidian (with --editor as a fallback).

However, create is completely non-functional without Obsidian open — it delegates entirely to obsidian://new for file creation. The CLI should handle file creation directly and optionally open the result afterward.

Changes

1. create command — filesystem-first

  • Write the file to disk directly using filesystem operations instead of obsidian://new
  • Handle append, overwrite, and content logic in Go (currently these are URI parameters)
  • After creation, open the note based on the user's configured default (see below)

2. Expand CLI configuration

Currently configuration only supports setting a default vault. This should be extended to also support a default open type:

  • obsidian — open notes via Obsidian URI (current behaviour)
  • editor — open notes via $EDITOR / system default

This removes the need to pass --editor on every command and lets users who don't use Obsidian (or prefer their own editor) set it once. Commands that open notes (open, search, search-content, move, create) would all respect this setting, with flags available to override per-invocation.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions