Skip to main content

Fast Note Sync CLI - Interact with your Obsidian FNS service from terminal

Project description

Languages: ๐Ÿ‡บ๐Ÿ‡ธ English | ๐Ÿ‡จ๐Ÿ‡ณ ไธญๆ–‡


FNS CLI (Fast Note Sync CLI)

From Local to Cloud: Transform Obsidian notes from locally-managed files into cloud-managed, AI-accessible knowledge. Edit once, sync everywhere.

FNS CLI is a powerful command-line tool for interacting with the Fast Note Sync (FNS) service. Manage, read, write, and sync your Obsidian notes directly from the terminal โ€” optimized for both human workflows and AI Agent integration.

๐ŸŽฏ Design Philosophy

This tool bridges the gap between local Obsidian editing and cloud-based AI knowledge management:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Obsidian App   โ”‚โ”€โ”€โ”€โ”€โ–ถโ”‚  FNS Service     โ”‚โ—€โ”€โ”€โ”€โ”€โ”‚  FNS CLI (this) โ”‚
โ”‚  (Desktop/Mobileโ”‚     โ”‚  (Cloud Server)  โ”‚     โ”‚  (Terminal/AI)  โ”‚
โ”‚   Editor)       โ”‚โ—€โ”€โ”€โ”€โ”€โ”‚                  โ”‚โ”€โ”€โ”€โ”€โ–ถโ”‚  (read/write)   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                                         โ”‚
                                              โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                                              โ”‚  AI Agents           โ”‚
                                              โ”‚  Claude Code,        โ”‚
                                              โ”‚  OpenCode, Cursor... โ”‚
                                              โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

One edit/update โ†’ all devices synced. Whether you write in Obsidian on your desktop or manage notes via CLI/AI on a server, everything stays in sync through the FNS cloud service.

โœจ Features

Core

  • Full Note CRUD โ€” Create, read, update, append, prepend, move, delete
  • Smart Append โ€” Automatically handles newlines to prevent content merging
  • Local File Upload โ€” Use @file.txt prefix to upload any local file
  • Note History โ€” View and restore previous versions
  • Recycle Bin โ€” Recover deleted notes
  • Find & Replace โ€” Search and replace content (supports regex)
  • Cross-Platform โ€” macOS / Linux / Windows (Python 3.6+)

Knowledge Graph

  • Backlinks โ€” See which notes link to the current note
  • Outlinks โ€” See which notes the current note links to
  • Folder Tree โ€” Browse your vault's directory structure

Sharing & Metadata

  • Share Links โ€” Create shareable URLs with optional password and expiry
  • Frontmatter Editing โ€” View and modify note metadata (tags, title, etc.)

AI Agent Friendly

  • --json Mode โ€” Machine-readable output for AI parsing
  • --quiet Mode โ€” Silent operation for scripting
  • Zero interactive prompts when arguments are provided

Administration

  • Vault Management โ€” List, view details, create, delete vaults
  • Server Status โ€” Check version and health
  • Storage Management โ€” Add/remove/validate storage backends (S3, OSS, WebDAV, etc.)
  • Git Sync โ€” Manage git sync configurations, trigger syncs, view history
  • Admin Operations โ€” System info, restart, upgrade, GC, WebSocket clients (requires admin privileges)
  • Auto-Setup โ€” Interactive guide on first login (URL โ†’ credentials โ†’ vault selection)

๐Ÿ“ฆ Installation

From PyPI (Recommended)

pip install fns-cli

This installs the fns command globally on your system.

From Source

git clone https://github.com/crazykuma/fns-cli.git
cd fns-cli
pip install -e .

Dependencies: click>=8.1 (installed automatically) + curl (pre-installed on most systems)

After installation, the fns command is available globally.

โš™๏ธ Quick Setup

First-Time (Interactive Guide)

fns login
# Enter FNS server URL: https://your-server
# Username or email: you@example.com
# Password: **** (hidden)
# ๐Ÿ“ฆ Available vaults:
#   1. defaultVault
# Select vault [1]: 1
# ๐ŸŽ‰ Ready! Try: fns list

Script-Friendly (Non-Interactive)

fns login -u https://your-server username password

Manual Configuration

fns config url "https://your-server/api"

๐Ÿš€ Command Reference

Authentication & Setup

fns login [user] [pass] [-u URL]  # Login (interactive if args omitted)
fns config show                    # Show current configuration
fns config url <value>             # Set API URL
fns config vault <value>           # Set vault name

Note CRUD

fns read <path>                    # Read a note
fns write <path> <text|@file>      # Create/overwrite (use @ to upload local file)
fns append <path> <text|@file>     # Append content (smart newline handling)
fns prepend <path> <text|@file>    # Prepend content (after frontmatter)
fns delete <path>                  # Delete note (moves to recycle bin)
fns move <old> <new>               # Move/rename a note
fns replace <path> <find> <replace> # Find and replace (supports regex)
fns history <path>                 # View revision history
fns restore <path>                 # Restore note from recycle bin

Knowledge & Links

fns list [keyword]                 # List/search notes
fns tree [path]                    # View folder tree structure
fns backlinks <path>               # Notes linking to this one
fns outlinks <path>                # Notes this one links to

Folder Management

  • Create & Delete โ€” mkdir, folder-delete
  • Browse โ€” folder-list, folder-tree
  • List Content โ€” folder-files, folder-notes
  • Metadata โ€” folder

File/Attachment Management

  • View & Download โ€” file-info, file-download [-o output]
  • List โ€” file-list [keyword]
  • Delete & Restore โ€” file-delete, file-restore
  • Rename โ€” file-rename <old> <new>
  • Recycle โ€” file-recycle-clear [paths]

User Settings & Backup

  • Settings โ€” setting-list, setting-get, setting-create, setting-delete, setting-rename
  • Backup โ€” backup-list, backup-create, backup-delete, backup-run, backup-history
  • Short Links โ€” share-link <path>
  • Password โ€” change-password <old> <new>

Sharing & Metadata

fns share <path> [--expire 24h] [--password secret]  # Create share link
fns unshare <path>                 # Remove sharing
fns frontmatter <path>             # View frontmatter
fns frontmatter <path> --set key=value --remove key  # Edit frontmatter

Folder Management

fns mkdir <path>                     # Create a new folder
fns folder <path>                    # Get folder metadata
fns folder-list [path]               # List sub-folders (root if empty)
fns folder-files <path>              # List files in a folder
fns folder-notes <path>              # List notes in a folder
fns folder-tree [--depth N]          # View folder tree
fns folder-delete <path>             # Delete folder (soft delete)

File/Attachment Management

fns file-info <path>                 # View file metadata
fns file-download <path> [-o file]   # Download file to local
fns file-list [keyword]              # List files with pagination
fns file-delete <path>               # Delete file (to recycle bin)
fns file-rename <old> <new>          # Rename file
fns file-restore <path>              # Restore file from recycle bin
fns file-recycle-clear [paths]       # Clear file recycle bin

User Settings & Backup

fns setting-list [keyword]           # List settings with pagination
fns setting-get <path>               # Get setting content
fns setting-create <path> <content>  # Create/update setting
fns setting-delete <path>            # Soft delete setting
fns setting-rename <old> <new>       # Rename setting

fns backup-list                      # List backup configurations
fns backup-create <vault> --storage-ids N --cron daily  # Create backup config
fns backup-delete <config_id>        # Delete backup config by ID
fns backup-run <config_id>           # Trigger backup
fns backup-history <config_id>       # View backup history

fns share-link <path>                # Generate short share URL
fns change-password <old> <new>      # Change account password

Vault & Server

fns vaults                         # List available vaults
fns vault-info [id]                # Show vault details
fns vault-create <name>            # Create vault (with confirmation)
fns vault-delete <id>              # Delete vault (double confirmation)
fns recycle-bin [keyword]          # View recycle bin
fns version                        # Show server version
fns health                         # Check server health
fns info                           # Show current user info
fns change-password <old> <new>    # Change account password

Storage Management (v0.9+)

fns storage-list                   # List storage configurations
fns storage-add <name> <type>      # Add storage (localfs/s3/oss/r2/minio/webdav)
fns storage-remove <id>            # Remove storage by ID
fns storage-validate <type>        # Test storage connection
fns storage-enabled                # List enabled storage types

Git Sync Management (v0.9+)

fns git-sync list                  # List git sync configurations
fns git-sync add <name> --repo-url <url> [--branch main] [--interval 5m]
fns git-sync remove <id>           # Remove configuration
fns git-sync validate <id>         # Validate configuration
fns git-sync run <id>              # Manually trigger sync
fns git-sync clean <id>            # Clean local workspace
fns git-sync history <id>          # View sync history

Admin Operations (v0.9+, requires admin privileges)

fns admin-info                     # Show system and runtime info
fns admin-restart                  # Gracefully restart server
fns admin-upgrade <version>        # Trigger server upgrade
fns admin-gc                       # Trigger manual GC
fns admin-ws-clients               # List connected WebSocket clients

Global Flags

fns --json <command>               # Output as JSON (for AI/script parsing)
fns --quiet <command>              # Suppress non-essential output
fns --version / -v                 # Show version
fns --help                         # Show help

๐Ÿค– AI Agent Integration

This tool is designed to give AI agents long-term memory and knowledge access:

  • Read Context: fns read specific notes before coding tasks
  • Auto-Documentation: fns append changelogs to daily notes
  • Knowledge Retrieval: fns list / fns tree to discover relevant files
  • Knowledge Graph: fns backlinks / fns outlinks to find related notes

Example with AI Agent:

# Ask AI to read context, work, then document
fns read "projects/architecture.md" --json
# ... AI works ...
fns append "daily/2024-05-20.md" "- Completed architecture review"

๐Ÿ“ Project Structure

fns-cli/
โ”œโ”€โ”€ pyproject.toml           # Package definition + fns command entry point
โ”œโ”€โ”€ fns_cli/                 # Python CLI package
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ main.py              # Click entry point + global options + login/config/health/version
โ”‚   โ”œโ”€โ”€ api.py               # HTTP request layer (curl subprocess)
โ”‚   โ”œโ”€โ”€ config.py            # Config management (load/save/require_vault)
โ”‚   โ”œโ”€โ”€ hashing.py           # Path hash computation (32-bit rolling hash)
โ”‚   โ”œโ”€โ”€ formatting.py        # Output formatting (timestamp/size/echo)
โ”‚   โ”œโ”€โ”€ commands/
โ”‚   โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”‚   โ”œโ”€โ”€ note.py          # read/write/delete/append/prepend/replace/move/rename/restore/frontmatter/backlinks/outlinks
โ”‚   โ”‚   โ”œโ”€โ”€ folder.py        # mkdir/folder/folder-files/notes/list/delete/tree
โ”‚   โ”‚   โ”œโ”€โ”€ file.py          # file-info/list/delete/rename/restore/download
โ”‚   โ”‚   โ”œโ”€โ”€ share.py         # share/unshare/shares/password/paths/link
โ”‚   โ”‚   โ”œโ”€โ”€ setting.py       # setting-list/get/create/delete/rename
โ”‚   โ”‚   โ”œโ”€โ”€ backup.py        # backup-list/create/delete/run/history
โ”‚   โ”‚   โ”œโ”€โ”€ vault.py         # vaults/info/create/delete
โ”‚   โ”‚   โ”œโ”€โ”€ storage.py       # storage-list/add/remove/validate/enabled
โ”‚   โ”‚   โ”œโ”€โ”€ git_sync.py      # git-sync list/add/remove/validate/run/clean/history
โ”‚   โ”‚   โ””โ”€โ”€ admin.py         # admin-info/restart/upgrade/gc/ws-clients
โ”‚   โ””โ”€โ”€ tests/
โ”‚       โ”œโ”€โ”€ __init__.py
โ”‚       โ”œโ”€โ”€ test_api.py
โ”‚       โ”œโ”€โ”€ test_formatting.py
โ”‚       โ”œโ”€โ”€ test_hashing.py
โ”‚       โ””โ”€โ”€ commands/
โ”‚           โ””โ”€โ”€ test_note.py
โ”œโ”€โ”€ fns-source/              # FNS Go backend server (submodule)
โ”œโ”€โ”€ fns-skill/               # AI Agent Skill (portable)
โ”‚   โ””โ”€โ”€ SKILL.md
โ””โ”€โ”€ .github/workflows/ci.yml # CI for Python CLI

๐Ÿ“– Usage Examples

For detailed examples, see the portable Skill at fns-skill/SKILL.md. You can copy the entire fns-skill/ directory into your own AI agent's Skills folder (Qwen Code, Claude Code, etc.).

๐Ÿงช Running Tests

python -m pytest fns_cli/tests/ -v
# or
python -m unittest discover -s fns_cli/tests -v

๐Ÿ”— Related Projects

๐Ÿ“œ License

MIT License โ€” see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fns_cli-0.9.0.tar.gz (39.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fns_cli-0.9.0-py3-none-any.whl (44.0 kB view details)

Uploaded Python 3

File details

Details for the file fns_cli-0.9.0.tar.gz.

File metadata

  • Download URL: fns_cli-0.9.0.tar.gz
  • Upload date:
  • Size: 39.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for fns_cli-0.9.0.tar.gz
Algorithm Hash digest
SHA256 8f4b380a5c001013be8f8a5e33962686078e8b1a6d0a6e13f2a6990b51f3fabe
MD5 096158d8e4f394830e5a549b341a1aed
BLAKE2b-256 eb4d6f7a6e19932472cf5b9126cfdbf5af186a244c5de8b737b8f1f0a1725c2f

See more details on using hashes here.

Provenance

The following attestation bundles were made for fns_cli-0.9.0.tar.gz:

Publisher: ci.yml on crazykuma/fns-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fns_cli-0.9.0-py3-none-any.whl.

File metadata

  • Download URL: fns_cli-0.9.0-py3-none-any.whl
  • Upload date:
  • Size: 44.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for fns_cli-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ed61ad3a2f4e0511f2492cf6abce4708e6f77875cd8a4c770a8b93afa8e1505c
MD5 51df24e080a8354f515645da983f0920
BLAKE2b-256 d6120ee32f19ccdda61ea45d9879d0f9ee4b4893a629fc834df24a3f91a32239

See more details on using hashes here.

Provenance

The following attestation bundles were made for fns_cli-0.9.0-py3-none-any.whl:

Publisher: ci.yml on crazykuma/fns-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page