Skip to main content

CLI tool for Fast Note Sync (Obsidian)

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
  • Auto-Setup โ€” Interactive guide on first login (URL โ†’ credentials โ†’ vault selection)

๐Ÿ“ฆ Installation

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

This installs the fns command globally on your system.

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

โš™๏ธ 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

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

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

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"

๐Ÿ“ File Structure

fns-cli/
โ”œโ”€โ”€ fns.py              # Main CLI logic
โ”œโ”€โ”€ setup.py            # Installation script
โ”œโ”€โ”€ requirements.txt    # Dependencies
โ”œโ”€โ”€ tests/
โ”‚   โ””โ”€โ”€ test_fns.py     # Unit tests
โ”œโ”€โ”€ README.md           # This file
โ”œโ”€โ”€ README.zh.md        # Chinese version
โ”œโ”€โ”€ skill.md            # Usage examples
โ”œโ”€โ”€ CHANGELOG.md        # Version history
โ””โ”€โ”€ LICENSE             # MIT License

๐Ÿ“– 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 unittest discover -s 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.4.0.tar.gz (17.4 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.4.0-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fns_cli-0.4.0.tar.gz
  • Upload date:
  • Size: 17.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.4

File hashes

Hashes for fns_cli-0.4.0.tar.gz
Algorithm Hash digest
SHA256 d838b9821d25451290f1c0e8f4490582f7b887e9d3ebbd4493886f53ff7139d7
MD5 56c6a5b6d92f6266137a018649fcfc5a
BLAKE2b-256 6facf195529b10ea8d1427263acb7a9f2533ba966ef13efbf34b83090b2732f1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fns_cli-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 12.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.4

File hashes

Hashes for fns_cli-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 438b983d61e84f38f220f26d0f630d6382239c9d9d6f2952ca7c75e55800dc8d
MD5 5d875aef38cb20d899a85fdfeb71b6b7
BLAKE2b-256 fd6880c14f58dee81fb2c657058d1257c3167cf7447c7bdfe787c2677b437c92

See more details on using hashes here.

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