Docs
CLI
CLI
Use the CLI to download and manage Notion content.
init
Use the init
command to set up your Notion downloader configuration.
notion-downloader init
You'll be prompted to enter your configuration options:
Would you to skip convertion to markdown (recommended)? (Y/n)
Which cache strategy would you like to use? (cache-only/cache-first/no-cache)
What is the root object type of your Notion content? (page/database)
What is the root ID of your Notion content?
Options
Usage: notion-downloader init [options]
initialize your project and install dependencies
Options:
-y, --yes skip confirmation prompt. (default: false)
-d, --defaults use default configuration. (default: false)
-c, --cwd <cwd> the working directory. defaults to the current directory.
-h, --help display help for command
pull
Use the pull
command to download content from Notion.
notion-downloader pull
Options
Usage: notion-downloader pull [options]
pull pages from notion
Options:
-n, --notion-token <string> notion api token, which looks like secret_3bc1b50XFYb15123RHF243x43450XFY33250XFYa343
-r, --root-page <string> The 31 character ID of the page which is the root of your docs page in notion. The code will look like 9120ec9960244ead80fa2ef4bc1bba25. This page must have a child page named 'Outline'
-d, --root-is-db Whether the root page is a database. If not, it must be a 'page'. Default: false
-c, --clean-cache Clear the cache before starting. WARNING: this will remove all files from the cache directory. Default: false
-l, --log-level <level> Log level (choices: "info", "verbose", "debug")
-o, --overwrite overwrite existing files. Default: false
-c, --cwd <cwd> the working directory. defaults to the current directory.
-p, --revalidate-period <period> The period (in milliseconds) at which to revalidate the cache. Default: -1 (disabled)
-h, --help display help for command
cleanup
Use the cleanup
command to remove downloaded files and cache.
notion-downloader cleanup
Options
Usage: notion-downloader cleanup [options]
Remove all downloaded files and cache
Options:
-y, --yes skip confirmation prompt. (default: false)
-c, --cwd <cwd> the working directory. defaults to the current directory.
-o, --output-only only clean output files and remove the filesmap files. (default: false)
-h, --help display help for command