{{tag>[npm notion cli api workers]}}
====== ntn ======
Notion CLI. Notion 인증, Workers 배포/운영, Public API 호출을 터미널에서 다룬다.
===== Summary =====
* 공식 패키지명과 실행 파일은 ''ntn''이다.
* ''nth''는 다른 npm 패키지이므로 혼동하지 않는다.
* 이 페이지는 2026-07-13 기준 npm registry의 ''ntn 0.19.0''과 공식 README를 바탕으로 정리했다.
사용자가 흔히 ''nth''로 잘못 적지만, 실제 Notion CLI는 ''ntn''이다.
===== Usage =====
ntn login
ntn workers list
ntn workers deploy
ntn api ls
ntn api v1/pages --spec -X POST
ntn files list
* ''**ntn** login''
* ''**ntn** logout''
* ''**ntn** workers [...] COMMAND''
* ''**ntn** api PATH [...]''
* ''**ntn** files COMMAND [...]''
* ''**ntn** completions SHELL''
===== Install =====
* 공식 README는 macOS/Linux에서 ''curl -fsSL https://ntn.dev | bash'' 설치를 우선 안내한다.
* Windows는 ''winget install --exact --id Notion.ntn'' 설치를 안내한다.
* npm registry에도 게시되어 있으므로 Node.js 환경에서는 ''npm install -g ntn'' 또는 ''npm exec --yes ntn -- --version'' 형태를 검토할 수 있다.
===== Options =====
* ''**-X**'', ''**--method**'': ''ntn api''에서 HTTP method를 강제한다.
* ''**-d**'', ''**--data**'': ''ntn api'' 요청 본문을 직접 JSON으로 넣거나 ''@path'' 파일 입력을 사용한다.
* ''**--spec**'': 선택한 API path의 스펙을 확인한다.
* ''**--docs**'': 선택한 API path의 문서를 연다.
===== Examples =====
ntn login
ntn logout
ntn workers --help
ntn workers list
ntn workers deploy
ntn api ls
ntn api v1/pages --spec -X POST
ntn api v1/pages --docs -X POST
ntn api v1/pages -d '{"parent":{"page_id":"abc123"}}'
ntn api v1/pages parent[page_id]=abc123
ntn api v1/pages archived:=true properties[count]:=10
ntn api v1/users page_size==100 Accept:application/json
ntn files create < file.png
ntn files create --external-url https://example.com/photo.png
ntn files get
ntn files list
===== Config =====
* 초기 인증은 ''ntn login''으로 시작한다.
* shell completion은 ''ntn completions powershell'' 같은 하위 명령으로 설정한다.
* ''ntn api''는 header, query param, inline JSON body를 한 줄 문법으로 받을 수 있다.
* 요청 본문 입력은 stdin JSON, ''--data'', inline body field 중 하나만 사용한다.
===== Troubleshooting =====
* ''nth''를 설치했다면 Notion CLI가 아니다. ''npm uninstall -g nth'' 뒤에 ''ntn'' 기준으로 다시 확인한다.
* ''ntn api'' 요청에서 body source를 여러 방식으로 섞으면 충돌할 수 있으므로 한 가지 방식만 쓴다.
* file upload는 성공 시 조용히 끝날 수 있다. TTY가 아니면 진행 표시가 보이지 않을 수 있다.
* Workers 중심 도구이므로 일반적인 Notion page 작성 도구로 기대하면 기능 범위가 다를 수 있다.
===== Compatibility =====
* npm 최신 버전: ''0.19.0'' (2026-07-09 게시)
* registry 메타데이터 기준 지원 OS: ''darwin'', ''linux'', ''win32''
* registry 메타데이터 기준 지원 CPU: ''arm64'', ''x64''
* 문서 기준 설치 경로는 curl 설치와 Winget 설치가 우선이며, npm 패키지는 배포 채널 중 하나로 본다.
===== Deprecated / Legacy =====
* 현재 확인한 자료에서는 뚜렷한 deprecated 서브커맨드는 찾지 못했다.
* 다만 설치 방식은 공식 README 기준으로 npm보다 ''https://ntn.dev'' 또는 Winget 안내가 더 전면에 있다.
===== Related =====
* 인증: ''ntn login'', ''ntn logout''
* Workers 운영: ''ntn workers list'', ''ntn workers deploy''
* Public API 호출: ''ntn api ls'', ''ntn api v1/pages''
* 파일 업로드: ''ntn files create'', ''ntn files list''
===== Help =====
++++ ntn --help |
Local help output was not captured in this workspace because the ntn binary is not installed here.
Use the following entrypoints from the official README until live help is captured:
ntn login
ntn workers --help
ntn api ls
ntn files list
++++
===== See Also =====
* [[notion:ko|Notion]]
* [[node.js:npm|npm]]
===== History =====
* codex:: 2026-07-13 Created the ntn command page from the official Notion CLI npm package and README.