A command-line interface for managing todo items using Notion database integration. This Go-based CLI tool allows you to add and manage todo items directly from your terminal to your Notion workspace.
# Quick install script
curl -sSL https://raw.githubusercontent.com/caffeines/notion-todo/main/install.sh | bash
Or download manually from the releases page.
# Add the tap
brew tap caffeines/tap
# Install notion-todo (available as 'todo' command)
brew install notion-todo
# Now you can use it with:
todo guide
go install github.com/caffeines/notion-todo@latest
Download the latest release for your platform from the releases page.
-
Clone the repository:
git clone https://github.com/caffeines/notion-todo.git cd notion-todo
-
Build the project:
make build # or go build -o todo main.go
-
Move the binary to your PATH:
sudo mv todo /usr/local/bin/
-
Build the project:
make build # or go build -o todo main.go
-
Run the interactive setup guide:
todo guide # Or use the short alias todo g
-
Configure the CLI:
todo config # Or use the short alias todo c
-
Start adding todos:
todo add "Buy groceries" # Or use the short alias todo a "Complete project" --date 25-06-2025
-
View and manage your todos:
todo list # Or use short aliases todo l # or todo ls
That's it! The interactive guide will walk you through everything else.
- 💡 Interactive Setup Guide - Step-by-step walkthrough for first-time users
- 🔧 Easy configuration setup with Notion API token and database ID
- ➕ Add todo items to your Notion database with optional due dates
- 📋 Interactive list view for managing todos with delete and status update capabilities
- ❌ Delete unwanted todo items directly from the CLI
- 📝 Simple and intuitive command-line interface with short aliases for faster usage
- 🔒 Secure credential storage
- 🎯 Direct integration with Notion API
- 📊 Status tracking and validation (Not started, In progress, Done)
- 📅 Due date support for better task management
- ⚡ Quick commands with short aliases (
todo v
,todo a
,todo l
, etc.) - 🔄 Status normalization and validation to ensure data consistency
- Go 1.23 or higher
- A Notion account with API access
- A Notion database set up for todo items
Before using the CLI, you need to configure it with your Notion API credentials. You have two options:
Run the interactive setup guide for a step-by-step walkthrough:
todo guide
This interactive guide will walk you through:
- Setting up your todo database (with template option)
- Getting your database ID
- Creating a Notion integration
- Getting your API credentials
- Connecting the integration to your database
- Configuring the CLI
- Testing your setup
Navigation in the Guide:
- Next step:
Enter
,Space
,n
,l
, or→
(right arrow) - Previous step:
p
,h
, or←
(left arrow) - Restart:
r
- Quit:
q
orCtrl+C
If you prefer manual setup or already have your credentials:
todo config
This will prompt you to enter:
- Notion API Token: Your Notion integration token
- Database ID: The ID of your Notion database
Use the pre-configured template for the fastest setup:
-
Get the Template:
- Go to Notion Todo Template
- Click "Get template" and select your workspace
- The template already has the correct database structure
-
Get Database ID:
- Open your database in Notion
- Copy the database ID from the URL:
https://www.notion.so/{workspace}/{database_id}?v=...
- The database ID is the string after the last
/
and before?
- Example:
217e31359630803999d6ecaabdf4e11f
If you prefer to create the database manually:
Required Properties:
- Title (Title) - The main todo text
- Status (Select) - Todo completion status with options:
Todo
(default)In progress
Done
- Due Date (Date) - Optional due date for todos
- Tags (Multi-select) - Optional categorizing tags
Setup Instructions:
-
Create Integration:
- Go to Notion Integrations
- Click "New integration"
- Name it "Todo CLI" or similar
- Select your workspace and choose "Internal" type
- Click "Save"
-
Grant Database Access:
- In the integration configuration popup, click "Access" tab
- Select "pages" to see your database
- Select your todo database from the list
- Click "Update Access"
- Go back to "Configuration" tab
-
Copy Integration Token:
- Click "Show" next to "Internal Integration Token"
- Copy the token and keep it secure
# Basic todo
todo add "Buy groceries"
# Todo with due date
todo add "Complete project documentation" --date 25-06-2025
# Todo with specific date format
todo add "Schedule dentist appointment" --date 2025-06-30
The todo items will be created in your Notion database with:
- Title: Your todo text
- Status: Set to "Todo" by default
- Due Date: Due date if specified
# View all todos in an interactive interface
todo list
The list command provides an interactive interface where you can:
- View todos by status (Todo, In progress, Done)
- Navigate through your todos
- See due dates and completion status
- Delete unwanted todo items
- Update todo status
- Manage your todo items efficiently
todo guide
(ortodo g
) - Interactive setup guide for first-time users (recommended)todo config
(ortodo c
) - Configure Notion API credentials manuallytodo add <todo-text>
(ortodo a
) - Add a new todo itemtodo add <todo-text> --date YYYY-MM-DD
- Add todo with due datetodo list
(ortodo l
,todo ls
) - View and manage existing todos in interactive modetodo version
(ortodo v
) - Show version informationtodo help
- Show help information
For faster usage, you can use these short aliases:
todo v
→todo version
todo a
→todo add
todo l
→todo list
todo ls
→todo list
todo g
→todo guide
todo c
→todo config
# First-time setup
todo guide
# Or use the short alias
todo g
# Add todos
todo add "Buy milk"
todo a "Finish presentation" --date 2025-06-25
# View and manage
todo list
# Or use short aliases
todo l
todo ls
# Check version
todo version
todo v
# Get help
todo help
├── cmd/ # CLI commands
│ ├── add.go # Add todo command
│ ├── config.go # Configuration command
│ ├── guide.go # Interactive setup guide command
│ ├── list.go # List and manage todos command
│ ├── root.go # Root command
│ ├── version.go # Version command
│ ├── processors/ # Command processors
│ │ ├── add_processor.go
│ │ ├── guide_processor.go
│ │ ├── list_processor.go
│ │ ├── root_processor.go
│ │ └── version_processor.go
│ ├── steps/ # Guide step implementations
│ │ └── guide_steps.go
│ └── template/ # UI templates and styles
│ ├── guide_template.go
│ └── styles.go
├── consts/ # Application constants
│ ├── config.go # Configuration constants
│ ├── notion.go # Notion API constants
│ ├── status.go # Status constants
│ └── version.go # Version information
├── models/ # Data models
│ ├── config.go # Configuration model
│ ├── createTodoPayload.go # Notion API payload
│ └── todoItem.go # Todo item structure
├── service/ # Business logic services
│ ├── config/ # Configuration services
│ │ ├── credential.go
│ │ └── credentialImpl.go
│ ├── files/ # File handling services
│ │ ├── file.go
│ │ └── FileImpl.go
│ ├── notion/ # Notion API integration
│ │ ├── notion.go
│ │ └── notionImpl.go
│ └── utility/ # Utility services
│ ├── todo_utility.go
│ └── utility.go
└── main.go # Application entry point
The application stores your configuration in a hidden directory:
- Path:
~/.notion-todo/config.json
- Contains encrypted credentials for secure storage
- Make sure your integration is connected to the database (step 5 in the guide)
- Verify your Database ID is correct
- Check that your API token is valid
- Ensure your database has the exact properties: "Title", "Status", "Due Date"
- Property names are case-sensitive
- The Status property must be of type "Select" with options: "Todo", "In progress", "Done"
- Consider using the template for correct setup
- Run
todo config
to reconfigure your credentials - Check if
~/.notion-todo/config.json
exists and has valid JSON - Re-run the setup guide:
todo guide
- Run
todo guide
for the interactive setup - Use
todo help
for command information - Check that your Notion integration has the correct permissions
The project follows a clean architecture pattern with:
- Commands (
cmd/
): CLI command handlers using Cobra with dedicated processors - Services (
service/
): Business logic organized by domain (config, files, notion, utility) - Models (
models/
): Data structures for API communication - Constants (
consts/
): Application-wide constants and configuration - Processors (
cmd/processors/
): Command-specific business logic handlers
Key interfaces:
service/notion/notion.go
: Notion API operationsservice/config/credential.go
: Credential managementservice/files/file.go
: File operations
# Build the project
go build -o todo main.go
# Or use the Makefile
make build
go test ./...
- Cobra - CLI framework
- Bubble Tea - Terminal UI framework for interactive guide
- Lip Gloss - Style and layout for terminal interfaces
- PromptUI - Interactive prompts
- Spinner - Loading spinners for CLI operations
See LICENSE file for details.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request