toki-note

Crates.iotoki-note
lib.rstoki-note
version2025.11.23
created_at2025-11-23 08:34:40.047154+00
updated_at2025-11-23 08:34:40.047154+00
descriptionTiny SQLite-backed CLI for quickly adding, listing, and exporting personal schedules
homepagehttps://github.com/katsyoshi/toki-note
repositoryhttps://github.com/katsyoshi/toki-note
max_upload_size
id1946308
size492,600
MATSUMOTO Katsuyoshi (katsyoshi)

documentation

https://github.com/katsyoshi/toki-note

README

toki-note

toki-note logo

toki-note is a small Rust CLI that stores personal schedules in a local SQLite database. It focuses on fast data entry via flags, ISO-8601 timestamps, tag support, and all-day events, making it convenient for terminal-driven workflows.

Getting Started

rustup default stable         # first-time toolchain setup
cargo build                   # compile the CLI locally
cargo install toki-note       # crates.io release (provides `toki-note` binary)

By default the binary writes to $XDG_DATA_HOME/toki-note/toki-note.db (e.g. ~/.local/share/toki-note/toki-note.db). Override with --database path/to/file.db or set the [database] section described below.

Usage

Add a timed event:

toki-note add \
  --title "1:1 sync" \
  --start "2025-02-01T10:00:00+09:00" \
  --duration 30m \
  --note "Zoom 1234" \
  --tag work --tag sync

--end still works for absolute end instants and always overrides --duration when both are supplied.

You can also omit --start and provide --date/--time instead, with relative dates (e.g., today, tomorrow, +2d, 2日後). When neither --end nor --duration is provided, a 30-minute slot is assumed.

toki-note add \
  --title "Daily standup" \
  --date tomorrow \
  --time 09:30 \
  --tag work

Add an all-day (or multi-day) entry by supplying dates instead of instants and the --all-day flag:

toki-note add --title "Vacation" --start 2025-08-10 --end 2025-08-15 --all-day --tag personal

All-day entries must use explicit --end (or omit it for a single day); --duration is ignored when --all-day is set.

Successful inserts print the assigned row id, which will later be used for listing or deleting records.

List all tracked events, ordered by start time (output uses your system timezone unless overridden with --tz). You can also use the ls alias:

toki-note list
# or
toki-note ls

Filter for a specific day (UTC boundary for the filter; display timezone may be overridden):

toki-note list --day 2025-08-10

Short flags are available, e.g. toki-note list -d 2025-08-10 -z Europe/Paris or toki-note rss -o feed.xml.

Force a specific timezone (use IANA names such as Europe/Paris or America/New_York):

toki-note list --tz Europe/Paris

Delete an event by id (see ids from list output) or by title:

toki-note delete --id 42
toki-note delete --title "1:1 sync"
# or the rm alias
toki-note rm --id 42

Adjust an existing entry when you mis-scheduled it (aliases: mv, move):

toki-note move --id 42 --date 2025-08-11 --time 10:30

Generate an RSS feed (stdout) and redirect to a file:

toki-note rss --title "Private schedule" --link https://example.com --tz Asia/Tokyo > schedule.xml

You can combine --day and --tz to emit limited feeds (e.g., toki-note rss --day 2025-08-10 --tz Europe/Paris).

Use --output to write the feed directly:

toki-note rss --tz Asia/Tokyo --output ~/.cache/toki-note/feed.xml

Generate an iCalendar file:

toki-note ical --day 2025-08-10 --tz America/Los_Angeles --output schedule.ics

Import events from an iCalendar file (duplicates are skipped by UID):

toki-note import --path path/to/events.ics

Sharing a database over Tailscale

If you have multiple machines connected via Tailscale (or another VPN) and want to share the same SQLite database, you can:

  1. Expose a shared directory on one machine (NFS/Samba/SSHFS/etc.) over the VPN
  2. Mount that directory on other machines
  3. Point toki-note to the shared file, e.g. toki-note --database /mnt/toki-note/toki-note.db

SQLite is not designed for concurrent writers over a network filesystem, so try to avoid simultaneous writes. This setup is best when only one machine edits at a time (read-only access from others is fine).

Configuration

Optional settings live in $XDG_CONFIG_HOME/toki-note/config.toml (e.g. ~/.config/toki-note/config.toml). You can predefine paths for the database and feed/import outputs:

[database]
path = "/path/to/custom.db"

[rss]
output = "/path/to/feed.xml"

[ical]
output = "/path/to/feed.ics"

[import]
source = "/path/to/events.ics"

This file is read on startup before CLI flags are processed; flags always win over config values.

Versioning

Releases follow a date-based scheme: YYYY.MM.DD (e.g., 2025.11.23). If multiple releases happen on the same day, the package version will be bumped to the next date. Breaking changes are still noted in the CHANGELOG and release notes even though the version number does not follow SemVer semantics.

Development

  • cargo fmt to keep Rust style consistent.
  • cargo clippy --all-targets --all-features to lint and refuse regressions.
  • cargo check for fast feedback; cargo test once querying/listing commands land.

The SQLite schema is created automatically on first run and consists of events and event_tags. Each transaction writes the event first, then lowercases all tags before storing them to avoid duplicates. Extend the CLI by adding more Subcommand variants in src/main.rs. Keep DB migrations backward compatible for existing .db files.

Contributors

  • katsyoshi
  • Codex (AI assistant)
Commit count: 0

cargo fmt