Skip to content

Latest commit

 

History

History
183 lines (137 loc) · 3.34 KB

File metadata and controls

183 lines (137 loc) · 3.34 KB

CLI Usage Guide

This guide describes all CLI commands available in NoteDown, with examples and tips.

📋 Table of Contents

Global Options

noted [command] [flags]

# Global flags:
--verbose   Enable verbose output
--version   Show version
--help      Show help for any command

Quick Actions

Quick Snippet

# Add a quick snippet to your default repository
noted "This is a quick thought"

# Same as:
noted snippet "This is a quick thought"

# Options:
noted snippet --no-timestamp     # Do not include timestamp
noted snippet --no-commit        # Do not auto-commit

Setup

# Detect OS and install dependencies	noted setup

# Options:
--dry-run        Show what would be installed
--skip-nodejs    Skip Node.js/npm
--skip-pandoc    Skip Pandoc
--skip-git       Skip Git

Set Default Repository

# Set the default repository for snippets
noted set default /path/to/repo

# Example:
noted set default ~/my-notes

Repository Management

Initialize Repository

# Initialize in current directory
noted init

# Initialize in specified directory
noted init ~/my-notes

# Initialize with a remote
noted init --remote=git@github.com:username/my-notes.git

Rescan Indexes

# Rebuild note and asset indexes
noted rescan

# Verbose output
noted rescan --verbose

Synchronize

# Sync with remote
noted sync

# Force options (if implemented in your environment)
noted sync --force-pull
noted sync --force-push

Note Operations

Create

# Create a new note with a title
noted new "My New Note"

# Create under a specific path (if supported)
noted new "My New Note" --path=projects/alpha

Edit

# Edit by search term
noted edit "architecture"

# Edit by exact path
noted edit notes/architecture.md

List

# Tree view
noted list --format=tree

# JSON view (machine-readable)
noted list --format=json

Content Management

Save

# Save and commit all changes
noted save -m "Update architecture notes"

Export

# Export to PDF (requires pandoc)
noted export my-note.md --pdf

# Output path (if supported)
noted export my-note.md --pdf --output=exports/my-note.pdf

Assets

Assets (images, documents, media) are stored in the assets/ directory of each repository and indexed for search.

# Add assets
cp image.png assets/images/
cp document.pdf assets/documents/

# Rebuild asset index
noted rescan

Asset entries include path, type, size, MIME type, and timestamps, and are stored in .noted under the assets section.

Development

Build CLI

go build -o noted ./cmd/noted

Build VSCode Extension

# Recommended
noted vsix

# Or from the extension directory
cd vscode-extension
npm install
npm run compile
npm run package

Exit Codes

  • 0: Success
  • 1: General error (invalid arguments, missing dependencies, etc.)
  • Other codes may be returned by underlying tools

← Previous: Quick Start | Next: VSCode Extension → | Back to README