Skip to content

obsidian-cli: silent flag no longer exists, and --copy/--json only work after the command #129

Description

@materemias

Summary

Two things in skills/obsidian-cli/SKILL.md don't match the current CLI (verified against Obsidian 1.12.7 on Arch Linux, plugin v1.0.1 / main):

  1. The silent flag no longer exists, and the default it describes has inverted.
  2. --copy / --json / --md / --tsv / --csv only work after the command, not before it — but "use --copy on any command" reads as though placement is free.

Both fail quietly, which is what makes them worth fixing: an agent following the skill gets no error, just no effect.

1. silent was removed; opening is now opt-in

SKILL.md mentions it three times (lines 25, 49, 60):

Use silent to prevent files from opening.

But obsidian help in 1.12.7 lists no silent on any command. For create it's now:

  create                Create a new file
    name=<name>         - File name
    path=<path>         - File path
    content=<text>      - Initial content
    template=<name>     - Template to use
    overwrite           - Overwrite if file exists
    open                - Open file after creating
    newtab              - Open in new tab

So creating no longer opens the note by default — open is the opt-in. Same shape on daily:append / daily:prepend.

Unknown flags are ignored rather than rejected, so obsidian create name="X" content="Y" silent exits 0 and looks correct. Nothing surfaces the fact that silent is a no-op, so the stale advice survives indefinitely.

Suggested fix: drop silent from the three spots and note that opening is opt-in via open / newtab.

2. Output-format and --copy flags must follow the command

Line 60 says "Use --copy on any command", which invites putting it up front, next to vault=. That fails:

$ obsidian --copy vault="MyVault" tasks todo total
Error: Command "--copy" not found. It may require a plugin to be enabled.

$ obsidian --md vault="MyVault" tasks todo total
Error: Command "--md" not found. Did you mean: read?

$ obsidian vault="MyVault" tasks todo total --copy
285

The double-dash flags are filtered out of argv but left in place, so whichever one comes first becomes the command name. vault= is genuinely position-sensitive (first, as documented) while these must come after the command — worth stating explicitly, since the two rules pull in opposite directions.

Related: list commands also accept format=json|tsv|csv as a parameter (tasks, search:context), which is easier to get right than --json and is currently undocumented in the skill:

$ obsidian vault="MyVault" tasks todo format=json
[
  {
    "status": " ",
    "text": "- [ ] Some task",
    "file": "Inbox.md",
    "line": "12"
  },

Not filing: vault targeting

I hit a third problem — with several registered vaults, omitting vault= targets the most-recently-focused vault, returns that vault's data, and makes Obsidian open a window for it to service the request. That's already #49, so I'll leave it there rather than split the discussion. (FWIW 1.12.7 does have the vaults command that proposal needs: vaults — List known vaults.)

Happy to send a PR for the two items above if useful.

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