A simple, fast, and efficient CLI application for managing your personal notes and thoughts, built with Rust. Create your own "Second Brain" system right from your terminal!
A Second Brain is a personal knowledge management system that helps you capture, organize, and retrieve your thoughts, ideas, and information. This CLI tool provides a lightweight way to:
- Quickly jot down thoughts and ideas
- Organize notes with timestamps
- Search through your knowledge base
- View and manage your collected wisdom
- Quick Note Creation: Add notes with titles and multi-line content
- Automatic Organization: Notes are timestamped and stored as Markdown files
- Smart Search: Find notes by title or search within content
- List Management: View all your notes with creation timestamps
- Markdown Support: All notes are stored as
.md
files for portability - Sanitized Filenames: Automatic filename sanitization for cross-platform compatibility
- Rust (edition 2024 or later)
- Git (to clone the repository)
- Clone the repository:
git clone <repository-url>
cd rust_second_brain
- Build the project:
cargo build --release
- The executable will be available at
target/release/rust_second_brain
To use the tool from anywhere, you can add it to your PATH or create an alias:
# Option 1: Copy to a directory in your PATH
cp target/release/rust_second_brain ~/.local/bin/second-brain
# Option 2: Create an alias in your shell profile (.bashrc, .zshrc, etc.)
alias second-brain="/path/to/rust_second_brain/target/release/rust_second_brain"
The application provides four main commands:
./rust_second_brain add "Your Note Title"
After running this command, you'll be prompted to enter the content of your note. Type your content and press Ctrl+D
(on Unix) or Ctrl+Z
(on Windows) on a new line to finish.
Example:
./rust_second_brain add "Meeting Notes"
Enter the content for your note (press Ctrl+D on a new line to finish):
Discussed project timeline
- Phase 1: Complete by end of month
- Phase 2: Research new technologies
- Follow up with team next week
^D
Note 'Meeting Notes' saved to second_brain_notes/20241229143022-meeting_notes.md
./rust_second_brain list
This displays all your notes with their original titles and creation timestamps.
Example output:
--- Your Second Brain Notes ---
- Meeting Notes (Created: 2024-12-29 14:30:22)
- Project Ideas (Created: 2024-12-28 09:15:45)
- Book Recommendations (Created: 2024-12-27 20:45:10)
-----------------------------
./rust_second_brain view "partial title"
You can use the full title or just part of it. The search is case-insensitive.
Example:
./rust_second_brain view "meeting"
--- Content of 'meeting_notes' ---
Discussed project timeline
- Phase 1: Complete by end of month
- Phase 2: Research new technologies
- Follow up with team next week
-----------------------------
./rust_second_brain search "keyword"
Search for notes containing specific keywords in their content.
Example:
./rust_second_brain search "project"
--- Search results for 'project' ---
- Found in: Meeting Notes
- Found in: Project Ideas
-----------------------------
- Notes are stored in the
second_brain_notes/
directory - Each note is saved as a Markdown file with the format:
YYYYMMDDHHMMSS-sanitized_title.md
- The directory is automatically created when you first run the application
clap
- Command-line argument parsingchrono
- Date and time handling for timestamps
rust_second_brain/
├── src/
│ └── main.rs # Main application logic
├── second_brain_notes/ # Your notes directory (created automatically)
├── Cargo.toml # Project configuration
├── Cargo.lock # Dependency lock file
└── README.md # This file
# Run directly with cargo
cargo run -- add "Test Note"
cargo run -- list
cargo run -- view "test"
cargo run -- search "keyword"
# Debug build
cargo build
# Release build (optimized)
cargo build --release
Contributions are welcome! Here are some ways you can help:
- Report bugs or suggest features
- Improve documentation
- Add new functionality
- Optimize performance
This project is open source. Please check the license file for details.
Potential future enhancements:
- Tag system for better organization
- Export to different formats
- Sync with cloud storage
- Rich text formatting
- Note templates
- Interactive mode
- Configuration file support
"No notes found" when you know you have notes:
- Ensure you're running the command from the same directory where you created the notes
- Check that the
second_brain_notes/
directory exists and contains.md
files
Can't find a note when using view
command:
- Note titles are sanitized (spaces become underscores, converted to lowercase)
- Try using just part of the title
- Use the
list
command to see all available notes
Build errors:
- Ensure you have Rust 2024 edition or later
- Run
cargo clean
and thencargo build
again
Happy note-taking! 🧠✨