{"id":15481349,"url":"https://github.com/litencatt/notion-cli","last_synced_at":"2025-04-15T06:14:25.787Z","repository":{"id":187809260,"uuid":"463756048","full_name":"litencatt/notion-cli","owner":"litencatt","description":"Notion CLI tool  and operation with interactive mode.","archived":false,"fork":false,"pushed_at":"2025-03-01T06:09:57.000Z","size":1780,"stargazers_count":15,"open_issues_count":3,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-04-15T06:14:17.038Z","etag":null,"topics":["cli","notion","oclif"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@litencatt/notion-cli","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/litencatt.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-02-26T04:48:59.000Z","updated_at":"2025-04-09T10:20:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"7466d98a-280e-4486-8bb8-e10ac93248a4","html_url":"https://github.com/litencatt/notion-cli","commit_stats":{"total_commits":474,"total_committers":4,"mean_commits":118.5,"dds":0.2721518987341772,"last_synced_commit":"5e49a89af6694fff6cd247cbe2791def02fe9b6d"},"previous_names":["litencatt/notion-cli"],"tags_count":37,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litencatt%2Fnotion-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litencatt%2Fnotion-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litencatt%2Fnotion-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litencatt%2Fnotion-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/litencatt","download_url":"https://codeload.github.com/litencatt/notion-cli/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249016641,"owners_count":21198833,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","notion","oclif"],"created_at":"2024-10-02T05:04:02.914Z","updated_at":"2025-04-15T06:14:25.769Z","avatar_url":"https://github.com/litencatt.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# notion-cli\n\nThis is a Notion CLI tool written by TypeScript. And some commands can be executed in interactive mode.\n\n## Features\n\n* Support for multiple output formats including csv and JSON\n* Support interactive mode for CRUD operation.\n\n\n## Quick Start\n\nRetrieves a page object using the ID specified.\u003cbr\u003e\n\n```sh\n$ export NOTION_TOKEN=secret_xxx...\n$ notion-cli page retrieve \u003cPAGE_ID\u003e\n```\n\n* How to create a `NOTION_TOKEN`: https://developers.notion.com/docs/create-a-notion-integration\n* `PAGE_ID` is included in the page URL: `https://www.notion.so/Page-title-\u003cPAGE_ID\u003e`\n\n\nUsing docker image:\n\n```sh\n$ docker run -e NOTION_TOKEN=secret_xxx... ghcr.io/litencatt/notion-cli page retrieve \u003cPAGE_ID\u003e\n\n# -it flag is required to run interactive mode using docker\n$ docker run -it -e NOTION_TOKEN=secret_xxx... ghcr.io/litencatt/notion-cli db retrieve\n```\n\n### Multiple output formats\n\noclif [ux.table](https://oclif.io/docs/table) supported output formats are `table`, `csv`, `json`, `yaml`. And notion-cli supports output raw json response with `--raw`.\n\n#### default: table\n\nOutput columns are only `title`, `object`, `id`, `url` now.\n```sh\n$ notion-cli page retireve c77dbaf240174ea1ac1e93a87269f3ea\n Title      Object Id                                   Url\n ────────── ────── ──────────────────────────────────── ─────────────────────────────────────────────────────────────────\n Page title page   c77dbaf2-4017-4ea1-ac1e-93a87269f3ea https://www.notion.so/Page-title-c77dbaf240174ea1ac1e93a87269f3ea\n```\n\n#### csv\n\n```sh\n$ notion-cli page retrieve c77dbaf240174ea1ac1e93a87269f3ea --output csv\nTitle,Object,Id,Url\nPage title,page,c77dbaf2-4017-4ea1-ac1e-93a87269f3ea,https://www.notion.so/Page-title-c77dbaf240174ea1ac1e93a87269f3ea\n```\n\n#### json\n\n```sh\n$ notion-cli page retrieve c77dbaf240174ea1ac1e93a87269f3ea --output json\n[\n  {\n    \"title\": \"Page title\",\n    \"object\": \"page\",\n    \"id\": \"c77dbaf2-4017-4ea1-ac1e-93a87269f3ea\",\n    \"url\": \"https://www.notion.so/Page-title-c77dbaf240174ea1ac1e93a87269f3ea\"\n  }\n]\n```\n\n### yaml\n\n```sh\n$ notion-cli page retrieve c77dbaf240174ea1ac1e93a87269f3ea --output yaml\n- title: Page title\n  object: page\n  id: c77dbaf2-4017-4ea1-ac1e-93a87269f3ea\n  url: 'https://www.notion.so/Page-title-c77dbaf240174ea1ac1e93a87269f3ea'\n```\n\n### Raw json\n\nThis flag returns the raw json response from the Notion API, so you can get all the data for a given resource. You can also process the response using [`jq`](https://jqlang.github.io/jq/) or other tools.\n\n```sh\n$ notion-cli page retrieve c77dbaf240174ea1ac1e93a87269f3ea --raw | head\n{\n  \"object\": \"page\",\n  \"id\": \"c77dbaf2-4017-4ea1-ac1e-93a87269f3ea\",\n  \"created_time\": \"2023-05-07T09:08:00.000Z\",\n  \"last_edited_time\": \"2023-08-15T01:08:00.000Z\",\n  \"created_by\": {\n    \"object\": \"user\",\n    \"id\": \"3555ae80-4588-4514-bb6b-2ece534157de\"\n  },\n  \"last_edited_by\": {\n...\n```\n\n### Interactive mode in db command\n\n1. Start interactive mode execute db command without args\n1. Select a database from list\n1. Build filter conditions\n    * And then you can choose whether to save the conditions to a json file or not.\n1. Query to db with the filter conditions\n1. Saved json files can be reused by passing them as flags at the next execution.\n\n![interactive-mode](./docs/images/interactive.gif)\n\n## Install\n\nnpm:\n\n```sh\n$ npm install -g @litencatt/notion-cli\n```\n\ndocker:\n\n```sh\n$ docker pull ghcr.io/litencatt/notion-cli\n```\n\n## Commands\n\n* [`notion-cli block`](docs/block.md)\n* [`notion-cli page`](docs/page.md)\n* [`notion-cli db`](docs/db.md)\n* [`notion-cli user`](docs/user.md)\n* [`notion-cli search`](docs/search.md)\n* [`notion-cli help`](docs/help.md)\n\n## Supported API and functions\n\nEndpoint | API | Support | multi-format* | interactive mode\n-- | -- | -- | -- | --\nAuthentication | Create a token |   |   |  \nBlocks | Append  a block children | o | o |  \nBlocks | Retrieve  a block | o | o |  \nBlocks | Retrieve a block children | o | o |  \nBlocks | Update a block | o | o |  \nBlocks | Delete a block | o | o |  \nPages | Create a page | o | o |  \nPages | Retrieve a page | o | o |  \nPages | Update a page | o | o |  \nDatabase | Create a database | o | o | o\nDatabase | Retrieve a database | o | o | o\nDatabase | Update a database | o | o | o\nDatabase | Query a database | o | o | o\nUsers | List all users | o | o |  \nUsers | Retrieve a user | o | o |  \nUsers | Retrieve your token's bot user | o | o |  \nComments | Create a comment |   |   |  \nComments | Retrieve a comment |   |   |  \nSearch | Search by title | o | o |\n\n\\* multi-format NOT supported commands output only raw json response\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flitencatt%2Fnotion-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flitencatt%2Fnotion-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flitencatt%2Fnotion-cli/lists"}