onlywrite
v0.1.0
Published
Local-first personal writing resources from the command line.
Maintainers
Readme
OnlyWrite CLI
OnlyWrite is a local-first personal writing resource system. It stores Notes and References in a
SQLite database under ~/.onlywrite and exposes the same commands to humans, scripts, and external
AI agents.
Install
npm install -g onlywrite
onlywrite doctorOr run it without a global install:
npx onlywrite --helpThe package installs one binary: onlywrite.
Quick Start
Create a Note from stdin:
printf 'Draft opening paragraph' | onlywrite note create --title "Opening" --stdinImport a Reference from a URL:
onlywrite reference import https://example.com/articleSearch and read resources:
onlywrite resource search "opening"
onlywrite resource list --type reference
onlywrite resource read <resource-id>Start the read-only local web viewer:
onlywrite webCheck the local installation:
onlywrite doctorJSON Mode
Add --json to commands when another program or agent needs stable machine-readable output.
onlywrite resource list --json
onlywrite resource read <resource-id> --jsonJSON responses include schemaVersion: 1.
Resource Model
Note: user-authored or saved Markdown content.Reference: external material with a local text snapshot, URL, and optional note.Resource Link: a structured link from a Note to a Reference.Trash: deleted resources go here until restored or purged.
Common Commands
onlywrite note create --title "Idea" --text "Body"
onlywrite note create --title "From file" --file ./note.md
onlywrite reference create --title "Paper" --url https://example.com --snapshot "Text"
onlywrite reference import https://example.com/articleonlywrite resource list
onlywrite resource list --trash
onlywrite resource search "query" --type note
onlywrite resource read <id>
onlywrite resource update <id> --title "New title" --text "New body"onlywrite resource link <note-id> <reference-id>
onlywrite resource unlink <note-id> <reference-id> --yes
onlywrite resource delete <id> --yes
onlywrite resource restore <id>
onlywrite resource purge <id> --yes
onlywrite doctorLocal Store
OnlyWrite uses ~/.onlywrite/onlywrite.sqlite by default. Set ONLYWRITE_HOME to use another local
store:
ONLYWRITE_HOME=/tmp/onlywrite-demo onlywrite resource listSafety
reference import only accepts http and https URLs and rejects localhost/private-network hosts
before fetching. delete, unlink, and purge require --yes.
