[{"data":1,"prerenderedAt":765},["ShallowReactive",2],{"docs-nav":3,"content-query-eYiXhjei6O":265},[4,8,11,14,17,21,25,29,32,36,40,44,48,52,56,60,63,67,71,75,79,83,87,91,95,99,103,107,111,115,118,121,124,127,130,133,136,139,142,145,148,151,154,157,160,163,166,169,172,175,178,181,184,187,190,193,196,199,202,205,208,211,214,217,220,223,226,229,232,235,238,241,244,247,250,253,256,259,262],{"_path":5,"title":6,"order":7},"/docs/getting-started","Getting Started",1,{"_path":9,"title":10,"order":7},"/docs/views/grid","Grid View",{"_path":12,"title":13,"order":7},"/docs/api/server","Server API",{"_path":15,"title":16,"order":7},"/docs/self-hosting/all-in-one","All-in-One Setup",{"_path":18,"title":19,"order":20},"/docs/core-concepts","Core Concepts",10,{"_path":22,"title":23,"order":24},"/docs/crdt","What is a CRDT?",11,{"_path":26,"title":27,"order":28},"/docs/api/client-http","Client HTTP API",2,{"_path":30,"title":31,"order":28},"/docs/self-hosting/separate-containers","Separate Containers Setup",{"_path":33,"title":34,"order":35},"/docs/interface-overview","Interface Overview",20,{"_path":37,"title":38,"order":39},"/docs/global-search","Global Search",22,{"_path":41,"title":42,"order":43},"/docs/filters","Filters",24,{"_path":45,"title":46,"order":47},"/docs/sorting","Sorting",25,{"_path":49,"title":50,"order":51},"/docs/tagging-and-selection","Tagging & Selection",26,{"_path":53,"title":54,"order":55},"/docs/quick-view","Quick View",28,{"_path":57,"title":58,"order":59},"/docs/api/cli","CLI",3,{"_path":61,"title":62,"order":59},"/docs/self-hosting/remote-access-tailscale","Remote Access with Tailscale",{"_path":64,"title":65,"order":66},"/docs/block-actions","Block Actions",30,{"_path":68,"title":69,"order":70},"/docs/deleting-blocks","Deleting Blocks & Trash",32,{"_path":72,"title":73,"order":74},"/docs/self-hosting","Self-Hosting",4,{"_path":76,"title":77,"order":78},"/docs/managing-heaps","Managing Heaps",40,{"_path":80,"title":81,"order":82},"/docs/file-scanning","File Scanning & Importing",42,{"_path":84,"title":85,"order":86},"/docs/storage-management","Storage Management",44,{"_path":88,"title":89,"order":90},"/docs/daily-notes","Daily Notes & Calendar",46,{"_path":92,"title":93,"order":94},"/docs/api","API",5,{"_path":96,"title":97,"order":98},"/docs/views","Views",60,{"_path":100,"title":101,"order":102},"/docs/authentication","Authentication & User Management",70,{"_path":104,"title":105,"order":106},"/docs/licenses-privacy","Licenses & Privacy",72,{"_path":108,"title":109,"order":110},"/docs/faq","FAQ",80,{"_path":112,"title":113,"order":114},"/docs/changelog","Changelog",99,{"_path":116,"title":117},"/docs/changelog/v16.16.37","v16.16.37",{"_path":119,"title":120},"/docs/changelog/v16.16.38","v16.16.38",{"_path":122,"title":123},"/docs/changelog/v16.11.0","v16.11.0",{"_path":125,"title":126},"/docs/changelog/v16.16.29","v16.16.29",{"_path":128,"title":129},"/docs/changelog/v16.16.28","v16.16.28",{"_path":131,"title":132},"/docs/changelog/v16.16.1","v16.16.1",{"_path":134,"title":135},"/docs/changelog/v16.10.0","v16.10.0",{"_path":137,"title":138},"/docs/changelog/v16.16.8","v16.16.8",{"_path":140,"title":141},"/docs/changelog/v16.7.0","v16.7.0",{"_path":143,"title":144},"/docs/changelog/v16.16.14","v16.16.14",{"_path":146,"title":147},"/docs/changelog/v16.16.7","v16.16.7",{"_path":149,"title":150},"/docs/changelog/v16.16.36","v16.16.36",{"_path":152,"title":153},"/docs/changelog/v16.16.32","v16.16.32",{"_path":155,"title":156},"/docs/changelog/v16.16.41","v16.16.41",{"_path":158,"title":159},"/docs/changelog/v16.6.0","v16.6.0",{"_path":161,"title":162},"/docs/changelog/v16.16.4","v16.16.4",{"_path":164,"title":165},"/docs/changelog/v16.16.0","v16.16.0",{"_path":167,"title":168},"/docs/changelog/v16.16.40","v16.16.40",{"_path":170,"title":171},"/docs/changelog/v16.16.20","v16.16.20",{"_path":173,"title":174},"/docs/changelog/v16.16.16","v16.16.16",{"_path":176,"title":177},"/docs/changelog/v16.16.25","v16.16.25",{"_path":179,"title":180},"/docs/changelog/v16.16.17","v16.16.17",{"_path":182,"title":183},"/docs/changelog/v16.17.8","v16.17.8",{"_path":185,"title":186},"/docs/changelog/v16.16.33","v16.16.33",{"_path":188,"title":189},"/docs/changelog/v16.16.22","v16.16.22",{"_path":191,"title":192},"/docs/changelog/v16.16.23","v16.16.23",{"_path":194,"title":195},"/docs/changelog/v16.16.35","v16.16.35",{"_path":197,"title":198},"/docs/changelog/v16.16.24","v16.16.24",{"_path":200,"title":201},"/docs/changelog/v16.16.5","v16.16.5",{"_path":203,"title":204},"/docs/changelog/v16.16.11","v16.16.11",{"_path":206,"title":207},"/docs/changelog/v16.16.27","v16.16.27",{"_path":209,"title":210},"/docs/changelog/v16.16.19","v16.16.19",{"_path":212,"title":213},"/docs/changelog/v16.16.13","v16.16.13",{"_path":215,"title":216},"/docs/changelog/v16.16.3","v16.16.3",{"_path":218,"title":219},"/docs/changelog/v16.9.0","v16.9.0",{"_path":221,"title":222},"/docs/changelog/v16.16.43","v16.16.43",{"_path":224,"title":225},"/docs/changelog/v16.16.2","v16.16.2",{"_path":227,"title":228},"/docs/changelog/v16.16.18","v16.16.18",{"_path":230,"title":231},"/docs/changelog/v16.16.30","v16.16.30",{"_path":233,"title":234},"/docs/changelog/v16.16.21","v16.16.21",{"_path":236,"title":237},"/docs/changelog/v16.16.26","v16.16.26",{"_path":239,"title":240},"/docs/changelog/v16.16.6","v16.16.6",{"_path":242,"title":243},"/docs/changelog/v16.16.31","v16.16.31",{"_path":245,"title":246},"/docs/changelog/v16.16.39","v16.16.39",{"_path":248,"title":249},"/docs/changelog/v16.16.34","v16.16.34",{"_path":251,"title":252},"/docs/changelog/v16.16.12","v16.16.12",{"_path":254,"title":255},"/docs/changelog/v16.8.0","v16.8.0",{"_path":257,"title":258},"/docs/changelog/v16.16.10","v16.16.10",{"_path":260,"title":261},"/docs/changelog/v16.16.9","v16.16.9",{"_path":263,"title":264},"/docs/changelog/v16.16.15","v16.16.15",{"_path":57,"_dir":266,"_draft":267,"_partial":267,"_locale":268,"title":58,"description":269,"order":59,"body":270,"_type":759,"_id":760,"_source":761,"_file":762,"_stem":763,"_extension":764},"api",false,"","Terminal interface for Heaper's local client HTTP API.",{"type":271,"children":272,"toc":750},"root",[273,282,288,293,300,313,319,324,329,392,397,403,424,429,439,444,475,481,486,499,512,520,525,531,536,545,550,559,564,573,578,587,592,601,606,615,621,626,726,732,737],{"type":274,"tag":275,"props":276,"children":278},"element","h1",{"id":277},"heaper-cli",[279],{"type":280,"value":281},"text","Heaper CLI",{"type":274,"tag":283,"props":284,"children":285},"p",{},[286],{"type":280,"value":287},"The CLI is a thin developer-focused wrapper around the local client HTTP API. It gives you terminal-friendly output, session shortcuts, and a simpler workflow than calling the local API directly.",{"type":274,"tag":283,"props":289,"children":290},{},[291],{"type":280,"value":292},"this is still very much WIP.",{"type":274,"tag":294,"props":295,"children":297},"h2",{"id":296},"install",[298],{"type":280,"value":299},"Install",{"type":274,"tag":301,"props":302,"children":307},"pre",{"className":303,"code":305,"language":306,"meta":268},[304],"language-bash","npm install -g heaper-cli\n","bash",[308],{"type":274,"tag":309,"props":310,"children":311},"code",{"__ignoreMap":268},[312],{"type":280,"value":305},{"type":274,"tag":294,"props":314,"children":316},{"id":315},"connection-model",[317],{"type":280,"value":318},"Connection Model",{"type":274,"tag":283,"props":320,"children":321},{},[322],{"type":280,"value":323},"The CLI expects the desktop app to be running with the Local API enabled.",{"type":274,"tag":283,"props":325,"children":326},{},[327],{"type":280,"value":328},"It resolves connection details in this order:",{"type":274,"tag":330,"props":331,"children":332},"ol",{},[333,351,367],{"type":274,"tag":334,"props":335,"children":336},"li",{},[337,343,345],{"type":274,"tag":309,"props":338,"children":340},{"className":339},[],[341],{"type":280,"value":342},"--port",{"type":280,"value":344}," and ",{"type":274,"tag":309,"props":346,"children":348},{"className":347},[],[349],{"type":280,"value":350},"--token",{"type":274,"tag":334,"props":352,"children":353},{},[354,360,361],{"type":274,"tag":309,"props":355,"children":357},{"className":356},[],[358],{"type":280,"value":359},"HEAPER_PORT",{"type":280,"value":344},{"type":274,"tag":309,"props":362,"children":364},{"className":363},[],[365],{"type":280,"value":366},"HEAPER_TOKEN",{"type":274,"tag":334,"props":368,"children":369},{},[370,376,378,383,385,390],{"type":274,"tag":309,"props":371,"children":373},{"className":372},[],[374],{"type":280,"value":375},"~/.heaper/api.json",{"type":280,"value":377}," for the port, plus ",{"type":274,"tag":309,"props":379,"children":381},{"className":380},[],[382],{"type":280,"value":366},{"type":280,"value":384}," or ",{"type":274,"tag":309,"props":386,"children":388},{"className":387},[],[389],{"type":280,"value":350},{"type":280,"value":391}," for auth",{"type":274,"tag":283,"props":393,"children":394},{},[395],{"type":280,"value":396},"If the app is not running or the Local API is disabled, the CLI fails with a connection error.",{"type":274,"tag":294,"props":398,"children":400},{"id":399},"sessions",[401],{"type":280,"value":402},"Sessions",{"type":274,"tag":283,"props":404,"children":405},{},[406,408,414,416,422],{"type":280,"value":407},"The ",{"type":274,"tag":309,"props":409,"children":411},{"className":410},[],[412],{"type":280,"value":413},"use \u003Cheap-id>",{"type":280,"value":415}," command creates a short session file so later commands can omit ",{"type":274,"tag":309,"props":417,"children":419},{"className":418},[],[420],{"type":280,"value":421},"--heap",{"type":280,"value":423},".",{"type":274,"tag":283,"props":425,"children":426},{},[427],{"type":280,"value":428},"Session files live in:",{"type":274,"tag":301,"props":430,"children":434},{"className":431,"code":433,"language":280,"meta":268},[432],"language-text","~/.heaper/sessions/\u003Cid>.json\n",[435],{"type":274,"tag":309,"props":436,"children":437},{"__ignoreMap":268},[438],{"type":280,"value":433},{"type":274,"tag":283,"props":440,"children":441},{},[442],{"type":280,"value":443},"Current behavior:",{"type":274,"tag":445,"props":446,"children":447},"ul",{},[448,453,458],{"type":274,"tag":334,"props":449,"children":450},{},[451],{"type":280,"value":452},"session IDs are short random hex strings",{"type":274,"tag":334,"props":454,"children":455},{},[456],{"type":280,"value":457},"sessions expire after 24 hours",{"type":274,"tag":334,"props":459,"children":460},{},[461,463,468,469],{"type":280,"value":462},"TTY mode automatically uses the latest session if you do not pass ",{"type":274,"tag":309,"props":464,"children":466},{"className":465},[],[467],{"type":280,"value":421},{"type":280,"value":384},{"type":274,"tag":309,"props":470,"children":472},{"className":471},[],[473],{"type":280,"value":474},"--session",{"type":274,"tag":294,"props":476,"children":478},{"id":477},"output-modes",[479],{"type":280,"value":480},"Output Modes",{"type":274,"tag":283,"props":482,"children":483},{},[484],{"type":280,"value":485},"TTY behavior:",{"type":274,"tag":445,"props":487,"children":488},{},[489,494],{"type":274,"tag":334,"props":490,"children":491},{},[492],{"type":280,"value":493},"arrays render as tables",{"type":274,"tag":334,"props":495,"children":496},{},[497],{"type":280,"value":498},"objects render as key/value output",{"type":274,"tag":283,"props":500,"children":501},{},[502,504,510],{"type":280,"value":503},"Non-TTY behavior, or ",{"type":274,"tag":309,"props":505,"children":507},{"className":506},[],[508],{"type":280,"value":509},"--json",{"type":280,"value":511},":",{"type":274,"tag":445,"props":513,"children":514},{},[515],{"type":274,"tag":334,"props":516,"children":517},{},[518],{"type":280,"value":519},"output is pretty-printed JSON",{"type":274,"tag":283,"props":521,"children":522},{},[523],{"type":280,"value":524},"That makes the CLI convenient both for humans and shell pipelines.",{"type":274,"tag":294,"props":526,"children":528},{"id":527},"common-workflows",[529],{"type":280,"value":530},"Common Workflows",{"type":274,"tag":283,"props":532,"children":533},{},[534],{"type":280,"value":535},"List heaps:",{"type":274,"tag":301,"props":537,"children":540},{"className":538,"code":539,"language":306,"meta":268},[304],"HEAPER_TOKEN=\u003Ctoken> heaper heaps\n",[541],{"type":274,"tag":309,"props":542,"children":543},{"__ignoreMap":268},[544],{"type":280,"value":539},{"type":274,"tag":283,"props":546,"children":547},{},[548],{"type":280,"value":549},"Choose a default heap:",{"type":274,"tag":301,"props":551,"children":554},{"className":552,"code":553,"language":306,"meta":268},[304],"heaper use \u003Cheap-id>\n",[555],{"type":274,"tag":309,"props":556,"children":557},{"__ignoreMap":268},[558],{"type":280,"value":553},{"type":274,"tag":283,"props":560,"children":561},{},[562],{"type":280,"value":563},"List blocks:",{"type":274,"tag":301,"props":565,"children":568},{"className":566,"code":567,"language":306,"meta":268},[304],"heaper blocks --limit 10\nheaper blocks --type document\nheaper blocks --query project\n",[569],{"type":274,"tag":309,"props":570,"children":571},{"__ignoreMap":268},[572],{"type":280,"value":567},{"type":274,"tag":283,"props":574,"children":575},{},[576],{"type":280,"value":577},"Inspect one block:",{"type":274,"tag":301,"props":579,"children":582},{"className":580,"code":581,"language":306,"meta":268},[304],"heaper block \u003Cblock-id>\nheaper block \u003Cblock-id> --view \u003Cview-id-or-name> --limit 25\n",[583],{"type":274,"tag":309,"props":584,"children":585},{"__ignoreMap":268},[586],{"type":280,"value":581},{"type":274,"tag":283,"props":588,"children":589},{},[590],{"type":280,"value":591},"Run a search:",{"type":274,"tag":301,"props":593,"children":596},{"className":594,"code":595,"language":306,"meta":268},[304],"heaper search \"meeting notes\"\n",[597],{"type":274,"tag":309,"props":598,"children":599},{"__ignoreMap":268},[600],{"type":280,"value":595},{"type":274,"tag":283,"props":602,"children":603},{},[604],{"type":280,"value":605},"Run a read-only SQL query:",{"type":274,"tag":301,"props":607,"children":610},{"className":608,"code":609,"language":306,"meta":268},[304],"heaper query \"SELECT id, title FROM blocks LIMIT 5\"\n",[611],{"type":274,"tag":309,"props":612,"children":613},{"__ignoreMap":268},[614],{"type":280,"value":609},{"type":274,"tag":294,"props":616,"children":618},{"id":617},"relationship-to-the-local-api",[619],{"type":280,"value":620},"Relationship to the Local API",{"type":274,"tag":283,"props":622,"children":623},{},[624],{"type":280,"value":625},"Current command mapping:",{"type":274,"tag":445,"props":627,"children":628},{},[629,646,662,678,694,710],{"type":274,"tag":334,"props":630,"children":631},{},[632,638,640],{"type":274,"tag":309,"props":633,"children":635},{"className":634},[],[636],{"type":280,"value":637},"heaper heaps",{"type":280,"value":639}," → ",{"type":274,"tag":309,"props":641,"children":643},{"className":642},[],[644],{"type":280,"value":645},"GET /api/heaps",{"type":274,"tag":334,"props":647,"children":648},{},[649,655,656],{"type":274,"tag":309,"props":650,"children":652},{"className":651},[],[653],{"type":280,"value":654},"heaper blocks",{"type":280,"value":639},{"type":274,"tag":309,"props":657,"children":659},{"className":658},[],[660],{"type":280,"value":661},"GET /api/heaps/:id/blocks",{"type":274,"tag":334,"props":663,"children":664},{},[665,671,672],{"type":274,"tag":309,"props":666,"children":668},{"className":667},[],[669],{"type":280,"value":670},"heaper block",{"type":280,"value":639},{"type":274,"tag":309,"props":673,"children":675},{"className":674},[],[676],{"type":280,"value":677},"GET /api/blocks/:id",{"type":274,"tag":334,"props":679,"children":680},{},[681,687,688],{"type":274,"tag":309,"props":682,"children":684},{"className":683},[],[685],{"type":280,"value":686},"heaper search",{"type":280,"value":639},{"type":274,"tag":309,"props":689,"children":691},{"className":690},[],[692],{"type":280,"value":693},"GET /api/search",{"type":274,"tag":334,"props":695,"children":696},{},[697,703,704],{"type":274,"tag":309,"props":698,"children":700},{"className":699},[],[701],{"type":280,"value":702},"heaper query",{"type":280,"value":639},{"type":274,"tag":309,"props":705,"children":707},{"className":706},[],[708],{"type":280,"value":709},"POST /api/query",{"type":274,"tag":334,"props":711,"children":712},{},[713,719,720],{"type":274,"tag":309,"props":714,"children":716},{"className":715},[],[717],{"type":280,"value":718},"heaper info",{"type":280,"value":639},{"type":274,"tag":309,"props":721,"children":723},{"className":722},[],[724],{"type":280,"value":725},"GET /api/info",{"type":274,"tag":294,"props":727,"children":729},{"id":728},"reference",[730],{"type":280,"value":731},"Reference",{"type":274,"tag":283,"props":733,"children":734},{},[735],{"type":280,"value":736},"Use the reference page for the exact options and examples:",{"type":274,"tag":445,"props":738,"children":739},{},[740],{"type":274,"tag":334,"props":741,"children":742},{},[743],{"type":274,"tag":744,"props":745,"children":747},"a",{"href":746},"/docs/api/cli-reference",[748],{"type":280,"value":749},"CLI Reference",{"title":268,"searchDepth":28,"depth":28,"links":751},[752,753,754,755,756,757,758],{"id":296,"depth":28,"text":299},{"id":315,"depth":28,"text":318},{"id":399,"depth":28,"text":402},{"id":477,"depth":28,"text":480},{"id":527,"depth":28,"text":530},{"id":617,"depth":28,"text":620},{"id":728,"depth":28,"text":731},"markdown","content:docs:api:cli.md","content","docs/api/cli.md","docs/api/cli","md",1777640558095]