lumetas / trilium-notes
There is no license information available for the latest version (v0.0.1) of this package.
v0.0.1
2025-07-27 20:07 UTC
This package is not auto-updated.
Last update: 2025-09-08 18:48:45 UTC
README
Languages
Introduction
PHP client for Trilium Notes ETAPI. Allows programmatic management of notes, branches, attributes and attachments.
Installation
Install via composer:
composer require lumetas/trilium-notes
Quick Start
<?php require 'vendor/autoload.php'; use Lumetas\TriliumNotes\Trilium; $trilium = new Trilium('http://localhost:37740/etapi', 'your-auth-token'); // Create a note $note = $trilium->createNote( 'root', 'New Note', 'text', 'Note content' ); // Get content echo $note->getContent();
Core Classes
Trilium
Main API client class. Takes endpoint and auth token.
Key methods:
getNoteById()
- get note by IDcreateNote()
- create new notesearchNotes()
- search notescreateAttribute()
- create attribute
Note
Class for working with notes.
Key methods:
getContent()
/writeContent()
- content managementgetAttributes()
- get attributescreateLabel()
/createRelation()
- create label/relationexport()
/import()
- export/import
Branch
Class for working with branches (note relationships).
Attribute
Class for working with attributes (labels and relations).
Attachment
Class for working with attachments.
Examples
Create Note with Label
$noteWithBranch = $trilium->createNote( 'root', 'Note with label', 'text', 'Content' ); $note = $noteWithBranch->getNote(); $note->createLabel('important', 'high');
Search Notes
$notes = $trilium->searchNotes('search query', [ 'ancestorNoteId' => 'root', 'limit' => 10 ]); foreach ($notes as $note) { echo $note->getTitle(); }