Notion CLI is a self-documenting command line interface that allows users to interact with Notion's API. It is suitable for developers looking to automate tasks or retrieve information from Notion programs.
$ npx skills add https://github.com/makenotion/skills --skill notion-cliNotion CLI provides developers with a command line interface to interact directly with Notion's API. The tool supports workers, public API requests, and file uploads, making it suitable for automating routine tasks and retrieving information from Notion databases and pages. Installation is straightforward through the skills CLI, allowing quick integration into development workflows. Developers can use Notion CLI to build custom automation scripts, sync data between systems, and programmatically manage Notion workspace content without manual intervention.
Use the command '$ npx skills add https://github.com/makenotion/skills --skill notion-cli' to install.
List public API endpoints.
Retrieve pages as Markdown.
Show methods and documentation for specific API endpoints.
$ npx skills add https://github.com/makenotion/skills --skill notion-cligit clone https://github.com/makenotion/skillsCopy the install command above and run it in your terminal.
Launch Claude Code, Cursor, or your preferred AI coding agent.
Use the prompt template or examples below to test the skill.
Adapt the skill to your specific use case and workflow.
I need to use the Notion CLI to [ACTION: e.g., 'retrieve all database entries', 'update a page property', 'list all pages in a workspace']. Here's the [DATABASE_ID/PAGE_ID/WORKSPACE_NAME] if needed: [ID/NAME]. Can you show me the exact commands to run? Include authentication steps if required.
### Notion CLI Commands for Database Retrieval
1. **Authenticate** (if not already done):
```bash
notion auth login
```
2. **List all databases in the workspace**:
```bash
notion search --filter type:database
```
3. **Retrieve all entries from a specific database** (replace `DATABASE_ID` with your actual ID):
```bash
notion query database DATABASE_ID --output json
```
4. **Format the output into a readable table**:
```bash
notion query database DATABASE_ID --output table
```
**Example Output (JSON)**:
```json
{
"results": [
{
"id": "1234-5678-90ab-cdef",
"properties": {
"Name": "Project Alpha",
"Status": "In Progress",
"Due Date": "2024-05-15"
}
},
{
"id": "9876-5432-10fe-dcba",
"properties": {
"Name": "Project Beta",
"Status": "Completed",
Take a free 3-minute scan and get personalized AI skill recommendations.
Take free scan