orgstar command-line tool !524

merged merged by cmc on 2026-11-27 06:56 UTC · krz/orgstar:174-command-line-tool into main

Discussion

cmc 2026-11-27 06:55 UTC

orgstar command for the download version: agenda [view] [--json], capture <key> [text] [--set Prompt=value], clock in|out|status, export <file> --to html|md|pdf|latex|odt|txt|reveal [-o path|-], tangle <file>, open <file>[::heading|id:ID], --help, --version, exit codes 0/1/2/3/4. Manual: docs/manual/guide/17-command-line.org.

  • New OrgstarCLI executable (Contents/Helpers/orgstar, signed by build-app.sh) linking OrgConfig, OrgDocument, OrgWorkspace and OrgCore only: no AppKit, SwiftUI or WebKit.
  • New OrgConfig library: UserConfig, OrgPreferences, KeyBarLayout, AgendaViews (minus AgendaBlockResult), CaptureTemplates and CapturePlacement, AgendaFiles.resolve, RefileSettings, TangleWriter, UserFile and Perf moved out of OrgApp unchanged apart from access levels; the theme, PDF and image-drop parts stay in OrgApp as extensions. OrgApp re-exports it (@_exported import OrgConfig), so no other target changes. ThemeSpec.typeKeys/isThemeTable now forward to OrgCore.ThemeTables.
  • Settings come from config.toml applied to an in-memory UserDefaults, folders from roots.json in the data folder plus ORGSTAR_ROOT, config folder by UserConfig.defaultDirectory (ORGSTAR_CONFIG_DIR, ORGSTAR_DATA_DIR, XDG_CONFIG_HOME).
  • Writes go through Saver with CoordinatedFileSystem and the app's Recovery folder, as for a closed file in the app. No cross-process unsaved-buffer check exists; an open buffer merges the change as it does Emacs's.
  • Clock: the CLI writes only the CLOCK line and never clock.json (the app keeps it in memory and rewrites it). The app already follows open CLOCK lines through ClockModel.sync; it now also picks up a clock started in another entry of the same file in the change that stopped its running clock (also fixes clocking in on another heading in Emacs).
  • PDF from the CLI goes through the LaTeX export and latexmk/pdflatex, since the app's PDF export needs WebKit. HTML has no code colouring (OrgHighlight pulls in OrgPresentation/AppKit).
  • Settings ▸ General ▸ Install Command-Line Tool… (download build only): open panel, symlink into the chosen folder; refuses to replace a non-link; on a folder it can't write it shows the sudo ln -sf line. Strings in DeveloperID.xcstrings with de, es, fr, ja, pt-BR.

Homebrew cask (krz/homebrew-tap), add:

binary "#{appdir}/orgstar.app/Contents/Helpers/orgstar"

Closes #174

Keyboard shortcuts

Global

⌘K
Command palette & jump
/
Focus search
?
Show this help
g d
Dashboard
g e
Explore repositories
g n
Notifications

Repository & editor

t
Find file in repository
y
Copy immutable SHA permalink
g c
Code tab
g i
Issues tab
g m
Merge requests tab
g b
Builds tab
⌘↵
Submit active form