Skip to content

vtxf/quick-note

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

quick-note

A command-line tool for quick note-taking.

Why This Tool?

Traditional note-taking software like Obsidian often takes a long time to start up. When you just want to quickly record a short idea or task, you have to go through a series of tedious operations like creating a file, entering content, saving and closing, which is not cost-effective. The quick-note tool is designed to solve this pain point, allowing you to quickly record temporary ideas, to-do items, and important tasks. At the end of the day, simply execute the qn -s command to automatically generate a summary of the day's notes.

Additionally, you can configure the notes directory directly as a folder in your Obsidian repository, allowing content recorded through quick-note to be seamlessly viewed and managed in Obsidian, achieving a perfect combination of lightweight quick recording and deep note management.

How It Works

  1. Execute the qn <content> command, and the tool will format the content and append it to today's misc file.
  2. Execute the qn -g command, and the tool will call the OpenAI API to generate a summary of today's notes.

Usage Guide

  1. Installation
npm -g i @vtxf/quick-note
  1. Usage
qn <content>

For example:

qn I worked for an hour at the company today.
  1. Multi-line notes (choose according to your system)
# Linux/Bash/WSL:
qn $'Learned Node.js today\nNeed to finish project tomorrow\nRemember to commit code'

# Windows PowerShell:
qn "Learned Node.js today`nNeed to finish project tomorrow`nRemember to commit code"

# Windows CMD:
qn Learned Node.js today
qn Need to finish project tomorrow
qn Remember to commit code
  1. Summary
qn -g

For example:

qn -g 20251015

Configuration File

On first use, the tool will create a configuration file in the user directory:

  • Windows: %USERPROFILE%\.quick-note\config.json
  • Linux/macOS: ~/.quick-note/config.json

Content in config.json:

{
    "env": {
        "QUICKNOTE_NOTE_DIR": "~/.quick-note/default-note",
        "QUICKNOTE_OPENAI_BASE_URL": "http://localhost:1234/v1",
        "QUICKNOTE_OPENAI_API_KEY": "",
        "QUICKNOTE_OPENAI_MODEL": "qwen/qwen3-4b-thinking-2507",
        "QUICKNOTE_EDITOR": 'code -r <QUICKNOTE_NOTE_DIR> <QUICKNOTE_MISC_FILE_PATH>'
    }
}

Where <QUICKNOTE_NOTE_DIR> is the notes storage directory <QUICKNOTE_MISC_FILE_PATH> is the misc file path

Editor Configuration Examples

In addition to using the default code editor, you can configure other editors as needed:

  • Using notepad editor:
    "QUICKNOTE_EDITOR": 'notepad <QUICKNOTE_HISTORY_FILE_PATH>'
    
  • Using vim editor:
    "QUICKNOTE_EDITOR": 'vim <QUICKNOTE_HISTORY_FILE_PATH>'
    

Note: <QUICKNOTE_HISTORY_FILE_PATH> is the history file path, used to open the history record file.

Configuration Options

The tool supports the following configuration options. Use qn -c to open the configuration file for modification.

Note Configuration

  • QUICKNOTE_NOTE_DIR: Note storage directory path
    • Default: ~/.quick-note/default-note
    • Supports relative paths and ~ symbol
    • Can be configured as an Obsidian repository directory for seamless integration

AI Service Configuration

  • QUICKNOTE_OPENAI_BASE_URL: Base URL of the AI service

  • QUICKNOTE_OPENAI_API_KEY: API access key

    • Default: empty string
    • Fill in the appropriate key based on your AI service provider
  • QUICKNOTE_OPENAI_MODEL: AI model name to use

    • Default: qwen/qwen3-4b-thinking-2507
    • Fill in based on available models from your service provider

Editor Configuration

  • QUICKNOTE_EDITOR: External editor command
    • Default: code -r <QUICKNOTE_NOTE_DIR> <QUICKNOTE_MISC_FILE_PATH>
    • Supports the following placeholders:
      • <QUICKNOTE_NOTE_DIR>: Note root directory path
      • <QUICKNOTE_MISC_FILE_PATH>: Full path to today's misc file
    • Configuration examples:
      • VS Code (read-only mode): 'code -r <QUICKNOTE_MISC_FILE_PATH>'
      • VS Code (open directory and file): 'code -r <QUICKNOTE_NOTE_DIR> <QUICKNOTE_MISC_FILE_PATH>'
      • Notepad (Windows): 'notepad <QUICKNOTE_MISC_FILE_PATH>'
      • Vim: 'vim <QUICKNOTE_MISC_FILE_PATH>'
      • Typora: 'typora <QUICKNOTE_MISC_FILE_PATH>'

Project Directory Structure

quick-note/
├── bin/                    # Command-line tool entry
│   └── qn.js              # Main execution file
├── src/                   # Source code directory
│   ├── config.js          # Configuration file handling
│   ├── note.js            # Note processing logic
│   ├── summary.js         # Note summary functionality
│   ├── summary_prompt.js  # Prompts for note summary functionality
│   └── utils.js           # Utility functions
├── package.json           # Project configuration and dependencies
└── README.md              # Project documentation

Note Storage Specification

  1. Quick notes are stored here: {QUICKNOTE_NOTE_DIR}/YYYY/YYYYMM/YYYYMMDD_misc/YYYYMMDD_misc.md. Images are stored in the images directory of the current note's directory.

    • YYYY: Four-digit year, e.g., 2025
    • MM: Two-digit month, e.g., 10 for October
    • DD: Two-digit date, e.g., 15 for the 15th day of the month
    • Example: If today is October 15, 2025, notes will be stored in ~/.quick-note/default-note/2025/202510/20251015_misc/20251015_misc.md
  2. Summary files are stored here: {QUICKNOTE_NOTE_DIR}/YYYY/YYYYMM/YYYYMMDD_summary/YYYYMMDD_summary.md. Images are stored in the images directory of the current note's directory.

    • Example: If today is October 15, 2025, the summary file will be stored in ~/.quick-note/default-note/2025/202510/20251015_summary/20251015_summary.md

YYYYMMDD_misc.md File Content Format

Format Description

  1. Each note is recorded as a Markdown title with the format # YYYYMMDD_HHMMSS
    • YYYYMMDD: Four-digit year, two-digit month, two-digit date, e.g., 20251011 represents October 11, 2025
    • HHMMSS: Two-digit hour, two-digit minute, two-digit second, e.g., 151812 represents 15:18:12
  2. Below the title is the specific content of the note, which can be plain text, links, code snippets, etc.
  3. Each note is separated by a blank line
  4. New notes are appended to the end of the file in chronological order

Example

# 20251011_151812
Today I learned new markdown programming skills.

# 20251011_152000
claude code documentation: https://docs.claude.com/en/docs/claude-code/claude_code_docs_map.md

Command Parameters

  1. qn [note]: Quickly record a note, note is a sentence.
  2. qn -e: Use the editor {QUICKNOTE_EDITOR} to open the YYYYMMDD_misc.md file.
  3. qn -g: Summarize and organize files in the misc folder, then generate a YYYYMMDD_summary.md file. The summary content is divided into three parts: knowledge points, daily records, and others.
    • Knowledge points: Knowledge points and collections unrelated to the author themselves
    • Daily records: Daily records, feelings, evaluations, to-do items, etc. related to the author themselves
    • Others: Other content not belonging to the above two categories
  4. qn -p: Use the editor to open the summary prompt configuration file (~/.quick-note/summary_prompt.md), allowing you to customize the AI summary prompt.

Summary Prompt Configuration

The tool supports customizing AI summary prompts to better control the format and content of summaries.

Prompt File Location

  • Windows: %USERPROFILE%\.quick-note\summary_prompt.md
  • Linux/macOS: ~/.quick-note/summary_prompt.md

Prompt File Format

The prompt file is a Markdown file containing custom summary prompts. If this file does not exist, the tool will automatically create a default prompt file.

Default prompt content is as follows:

# Summary Prompt

You are a professional note organization assistant. Please generate a structured summary report based on the user's daily note content.

Requirements:
1. Divide the content into the following parts:
   - Knowledge points: Knowledge points, collections, technical materials, learning methods, etc. unrelated to the author themselves
   - Daily records: Daily records, feelings, evaluations, to-do items, personal thoughts, etc. related to the author themselves
   - Others: Other content not belonging to the above two categories (only show when there is content)

2. Content requirements for each part:
   - Extract core points, avoid redundancy
   - Preserve important information from the original text
   - Use concise and clear language
   - If a part has no content, do not display that part

3. Output format:
   - Use Markdown format
   - Use second-level headings (##) for each part
   - Use unordered lists (-) for items
   - Important content can be appropriately bolded

4. Special notes:
   - Maintain an objective and neutral tone
   - Do not add information not present in the original text
   - For technical content, maintain accurate professional terminology
   - For personal feeling content, maintain the original meaning
   - Do not include any thought processes or analysis explanations
   - Only output the final summary content

Please generate a summary based on the following note content:

Custom Prompts

You can modify the prompt file as needed, for example:

  • Add new summary categories
  • Modify summary format
  • Add specific summary requirements
  • Adjust the AI's tone and style

After modifying the prompt, the next time you execute the qn -g command, the new prompt will be used to generate the summary.

Usage Examples

# Quickly record a note
qn Today I learned new programming skills

# Open today's note file with an editor
qn -e

# Generate today's note summary
qn -g

# Generate a note summary for a specific date
qn -g 20251015

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published