Tianji sushu 天機素書 "Pure book of the celestial loom", shortly called Tianjishu 天機書, is a book on geomancy (fengshui 風水) written by the Tang-period 唐 (618-907) master Qiu Tinghan 邱廷翰, courtesy name Yizhi 翼之. He hailed from Wenxi 聞喜 in modern Shanxi and is known as the author of the books Yuhanjing 玉函經, Huangnang dagua jue 黃囊大卦訣, and the 4-juan-long Tianjishu.
The latter is not listed in the bibliographic chapter of the encyclopaedia Tongzhi 通志, but the geomantic compendium Kanyu leizuan 堪輿類纂 quotes from the Song-period 宋 (960-1279) master Wu Jingluan's 吳景鸞 (d. 1064) preface Jin yinyang Tianjishu xu 進陰陽天機書序, where it is said that the Tianjishu was presented to Emperor Xuanzong 唐玄宗 (r. 712-755) by Qiu Tinghan. He had written a book called Liqi xinyin 理氣心印 "Cordial imprint of ordering the energies", but refused to publish it and preferred keeping it in a jade case (yuhan 玉函) where it was discovered at the end of the Tang period by Yang Yi 楊益. This version had the title Tianjishu. Yang transmitted it to his disciples Zeng Wenchan 曾文辿 (854-916) and Chen Tuan 陳摶 (871-989). In 1041, Wu Jingluan presented to the emperor the two books Tianji and Xinyin. This story proves that the book Yuhanjing mentioned in ancient bibliographies is identical to the Tianjishu.
The Tianjishu is included in the series Dili daquan 地理大全.