t2-notes
v1.0.3
Published
A beautiful terminal-based note-taking app with git-backed storage
Downloads
347
Maintainers
Readme
Terminal Notes App 📝
A beautiful terminal-based note-taking app with git-backed storage, similar to nb.
✨ Features
- 📝 Markdown notes with live preview
- 🎨 Beautiful terminal UI with multiple themes
- ⚙️ Configurable via CLI or config file
- 📂 Local vault storage with automatic organization
- 🔄 Git-backed with auto-commits on every change
- 🌐 Remote sync support (push/pull to GitHub, GitLab, etc.)
- ⌨️ Keyboard-driven workflow
- 📅 Date-based note naming with auto-numbering
- 🔍 Quick navigation and search
- ✏️ External editor support (nvim, vim, nano, etc.)
🚀 Install
npm install --global t2-notes📖 Usage
Starting the App
t2-notesThe app will automatically create a vault at ~/.notes and initialize it as a git repository.
Configuration
You can configure the application directly from the terminal using the configuration interface.
t2-notes --configThis will open the configuration menu where you can:
- Set Vault Path: Choose where your notes are stored (defaults to
~/.notes). - Select Theme: Choose from a variety of built-in themes.
Configuration is saved to ~/.t2/config.json.
Manual Configuration
You can also manually edit the configuration file at ~/.t2/config.json:
{
"theme": "tokyo-night",
"vaultPath": "/Users/username/my-notes"
}Environment Variables
You can override the vault path using environment variables (highest priority):
export VAULT_PATH=/path/to/your/notes
t2-notesOr:
export NOTES_VAULT=/path/to/your/notes
t2-notes⌨️ Keyboard Shortcuts
| Key | Action |
|-----|--------|
| 1 | Focus Notes pane |
| 2 | Focus Preview pane |
| 3 | Focus TODOs pane |
| n | Create new note |
| e | Edit selected note |
| d | Delete selected note |
| ↑/↓ | Navigate notes |
| Enter | Select note |
| Ctrl+C | Quit |
📝 Creating Notes
- Press
nto open the create note dialog - Enter a title (defaults to today's date:
YYYY-MM-DD) - Press
Enterto create
Notes are automatically named by date:
- First note of the day:
2025-11-13.md - Second note:
2025-11-13-2.md - Third note:
2025-11-13-3.md
✏️ Editing Notes
- Select a note using arrow keys
- Press
eto open in your editor - Make changes and save
- Changes are auto-committed to git
The app uses your $EDITOR or $VISUAL environment variable, defaulting to nvim.
To set your preferred editor:
export EDITOR=nano # or vim, emacs, code, etc.🌐 Git Remote Sync
The vault is automatically initialized as a git repository. You can sync it with a remote repository (GitHub, GitLab, Bitbucket, etc.).
Initial Setup
Create a repository on your git hosting service (GitHub, GitLab, etc.)
Add the remote to your vault:
cd ~/.notes # Or your custom vault path
git remote add origin https://github.com/yourusername/notes.git
git branch -M main
git push -u origin mainPushing Changes
After making changes in the app, push to remote:
cd ~/.notes
git pushPulling Changes
If you edit notes from another device, pull changes:
cd ~/.notes
git pullAuto-Sync Script
Create a script for automatic sync (optional):
#!/bin/bash
# ~/.local/bin/notes-sync
cd ~/.notes
git pull --rebase
git push
echo "Notes synced!"Make it executable:
chmod +x ~/.local/bin/notes-syncRun it periodically or before/after using the app.
Using Git Hooks
You can set up git hooks to auto-sync. Create ~/.notes/.git/hooks/post-commit:
#!/bin/bash
git push origin main &Make it executable:
chmod +x ~/.notes/.git/hooks/post-commit📂 Vault Structure
~/.notes/
├── .git/ # Git repository
├── README.md # Vault info
└── notes/ # Your notes
├── 2025-11-13.md
├── 2025-11-13-2.md
└── ...📄 Note Format
Notes use Markdown with YAML frontmatter:
---
title: My Note Title
created: 2025-11-13T20:00:00.000Z
modified: 2025-11-13T20:30:00.000Z
pinnedAt: 2025-11-13T20:15:00.000Z
---
# My Note Title
Your content here...
## Lists
- Item 1
- Item 2
## Code
\`\`\`javascript
console.log('Hello, world!');
\`\`\`
## TODOs
- [x] Completed task
- [ ] Pending task🎨 Themes
The app comes with several built-in themes including:
tokyo-night(default)synthwave-84forest-nightmaterial-oceansunset-glownord-frostrose-pine-dawnneon-junglemidnight-amethystdesert-miragecherry-blossomelectric-stormdeep-seavolcanic-ashcyberpunk-mint
Change themes using t2 --config.
🔧 Development
# Install dependencies
npm install
# Run in development
npm start
# Build
npm run build
# Test
npm test🤝 Contributing
Contributions are welcome! Feel free to open issues or submit PRs.
📝 License
MIT
🙏 Acknowledgments
Inspired by nb - a command-line note-taking tool.
