### Quick Start Wafflebase with Docker Compose Source: https://wafflebase.io/docs/developers/self-hosting.html Commands to clone the repository, install dependencies, and launch the services using Docker Compose. ```bash git clone https://github.com/wafflebase/wafflebase.git cd wafflebase pnpm install docker compose up -d # Starts PostgreSQL + Yorkie server pnpm backend migrate # Run database migrations pnpm dev # Start frontend (:5173) + backend (:3000) ``` -------------------------------- ### Install Wafflebase CLI Source: https://wafflebase.io/docs/developers/cli.html Install the CLI globally using npm. ```bash npm install -g @wafflebase/cli ``` -------------------------------- ### JSON import format example Source: https://wafflebase.io/docs/developers/cli.html Example structure for JSON files used during spreadsheet imports. ```json [ { "Name": "Alice", "Score": 95 }, { "Name": "Bob", "Score": 87 } ] ``` -------------------------------- ### Formatting CLI Output Source: https://wafflebase.io/docs/developers/cli.html Examples of requesting different output formats using the --format flag. ```bash $ wafflebase docs list [ {"id": "abc-123", "title": "Q1 Report", "type": "sheet"}, {"id": "def-456", "title": "Meeting Notes", "type": "doc"} ] ``` ```bash $ wafflebase --format table docs list ┌─────────┬───────────────┬───────┐ │ ID │ Title │ Type │ ├─────────┼───────────────┼───────┤ │ abc-123 │ Q1 Report │ sheet │ │ def-456 │ Meeting Notes │ doc │ └─────────┴───────────────┴───────┘ ``` ```bash $ wafflebase --format csv sheets cells get abc-123 A1:B3 A1,Revenue A2,1000 B1,Expenses B2,500 ``` -------------------------------- ### Initiate a formula Source: https://wafflebase.io/docs/sheets/formulas.html Start any formula by typing an equals sign in a cell. ```text =SUM(A1:A10) ``` -------------------------------- ### Get Document Source: https://wafflebase.io/docs/developers/rest-api.html Retrieve details for a specific document by ID. ```bash GET /api/v1/workspaces/:wid/documents/:did ``` -------------------------------- ### Get Document Content Endpoint Source: https://wafflebase.io/docs/developers/rest-api.html Retrieves the full content tree of a document. ```bash GET /api/v1/workspaces/:wid/documents/:did/content ``` -------------------------------- ### GET /api/v1/workspaces/:wid/documents Source: https://wafflebase.io/docs/developers/rest-api.html Retrieves a list of all documents within a specified workspace. ```APIDOC ## GET /api/v1/workspaces/:wid/documents ### Description Retrieves a list of all documents within a specified workspace. ### Method GET ### Endpoint /api/v1/workspaces/:wid/documents ### Parameters #### Path Parameters - **wid** (string) - Required - The unique identifier of the workspace. ``` -------------------------------- ### Get Image Source: https://wafflebase.io/docs/developers/rest-api.html Retrieve raw image bytes. Responses include an immutable cache header. ```bash GET /api/v1/workspaces/:wid/images/:imageId ``` -------------------------------- ### Get All Cells Endpoint Source: https://wafflebase.io/docs/developers/rest-api.html Retrieves all cells within a specific sheet tab. ```bash GET /api/v1/workspaces/:wid/documents/:did/tabs/:tid/cells ``` -------------------------------- ### Get Single Cell Endpoint Source: https://wafflebase.io/docs/developers/rest-api.html Retrieves the data for a specific cell reference. ```bash GET /api/v1/workspaces/:wid/documents/:did/tabs/:tid/cells/:ref ``` -------------------------------- ### GET /api/v1/workspaces/:wid/documents/:did/content Source: https://wafflebase.io/docs/developers/rest-api.html Retrieves the full content tree of a doc or slides document. ```APIDOC ## GET /api/v1/workspaces/:wid/documents/:did/content ### Description Reads the full content tree of a document. ### Method GET ### Endpoint /api/v1/workspaces/:wid/documents/:did/content ``` -------------------------------- ### GET /api/v1/workspaces/:wid/documents/:did/tabs Source: https://wafflebase.io/docs/developers/rest-api.html Lists all tabs associated with a sheet document. ```APIDOC ## GET /api/v1/workspaces/:wid/documents/:did/tabs ### Description Retrieves an array of tab descriptors for a sheet document. Returns HTTP 409 if called on a non-sheet document. ### Method GET ### Endpoint /api/v1/workspaces/:wid/documents/:did/tabs ### Parameters #### Path Parameters - **wid** (string) - Required - The workspace ID. - **did** (string) - Required - The document ID. ### Response #### Success Response (200) - **id** (string) - Stable tab id - **name** (string) - Display name - **type** (string) - Tab type - **kind** (string) - Sheet subtype ``` -------------------------------- ### GET /api/v1/workspaces/:wid/documents/:did/tabs/:tid/cells/:ref Source: https://wafflebase.io/docs/developers/rest-api.html Fetches a single cell by its reference. ```APIDOC ## GET /api/v1/workspaces/:wid/documents/:did/tabs/:tid/cells/:ref ### Description Retrieves the data for a specific cell. ### Method GET ### Endpoint /api/v1/workspaces/:wid/documents/:did/tabs/:tid/cells/:ref ### Parameters #### Path Parameters - **wid** (string) - Required - Workspace ID - **did** (string) - Required - Document ID - **tid** (string) - Required - Tab ID - **ref** (string) - Required - Cell reference (e.g., A1) ``` -------------------------------- ### GET /api/v1/workspaces/:wid/documents/:did/tabs/:tid/cells Source: https://wafflebase.io/docs/developers/rest-api.html Fetches all cells within a specific sheet tab. Supports an optional range query parameter. ```APIDOC ## GET /api/v1/workspaces/:wid/documents/:did/tabs/:tid/cells ### Description Retrieves all cells in a sheet tab. Optionally filter by a specific range. ### Method GET ### Endpoint /api/v1/workspaces/:wid/documents/:did/tabs/:tid/cells ### Parameters #### Path Parameters - **wid** (string) - Required - Workspace ID - **did** (string) - Required - Document ID - **tid** (string) - Required - Tab ID #### Query Parameters - **range** (string) - Optional - A1-notation range (e.g., A1:C10) ### Response #### Success Response (200) - **ref** (string) - A1-notation reference - **value** (string|null) - Stored value - **formula** (string|null) - Stored formula - **style** (object|null) - Style payload ``` -------------------------------- ### Inspecting Schema Source: https://wafflebase.io/docs/developers/cli.html Commands to list available operations or view documentation for specific commands. ```bash # List all commands wafflebase schema # Describe a specific command wafflebase schema docs.content wafflebase schema sheets.cells.get wafflebase schema slides.export # Singular aliases also resolve wafflebase schema cell.get # → sheets.cells.get wafflebase schema doc.list # → docs.list ``` -------------------------------- ### Use Configuration Profiles Source: https://wafflebase.io/docs/developers/cli.html Execute commands using a specific configuration profile. ```bash wafflebase --profile production docs list ``` -------------------------------- ### Managing API Keys Source: https://wafflebase.io/docs/developers/cli.html Commands to create, list, and revoke API keys for programmatic access. ```bash # Create a new API key (printed once — copy it now) wafflebase api-keys create "My Integration" # List API keys (raw key never re-shown) wafflebase api-keys list # Revoke an API key wafflebase api-keys revoke ``` -------------------------------- ### Configure CLI Profiles Source: https://wafflebase.io/docs/developers/cli.html Define server and authentication settings in the YAML configuration file. ```yaml profiles: default: server: http://localhost:3000 api-key: wfb_your_api_key_here workspace: your-workspace-id ``` -------------------------------- ### Manage Workspace Context Source: https://wafflebase.io/docs/developers/cli.html List available workspaces or switch the active workspace context. ```bash # List workspaces (* = active) wafflebase ctx list # Switch active workspace wafflebase ctx switch "Team Workspace" wafflebase ctx switch e98ff707 ``` -------------------------------- ### Manage documents via CLI Source: https://wafflebase.io/docs/developers/cli.html Commands for listing, creating, retrieving, renaming, and deleting documents in Wafflebase. ```bash wafflebase docs list wafflebase docs list --type doc # only word-processor docs wafflebase docs list --type sheet # only spreadsheets # Create a new sheet (default) wafflebase docs create "Q1 Report" # Create a new word-processor document wafflebase docs create "Meeting Notes" --type doc # Get document metadata wafflebase docs get # Rename a document wafflebase docs rename "New Title" # Delete a document wafflebase docs delete ``` -------------------------------- ### Create Document Source: https://wafflebase.io/docs/developers/rest-api.html Endpoint for creating a new document in a workspace. ```bash POST /api/v1/workspaces/:wid/documents ``` -------------------------------- ### Create Document Source: https://wafflebase.io/docs/developers/rest-api.html Create a new document, sheet, or slide deck within a workspace. The type defaults to sheet if not specified. ```bash curl -X POST \ -H "Authorization: Bearer wfb_..." \ -H "Content-Type: application/json" \ -d '{"title": "Q1 Report"}' \ https://api.wafflebase.io/api/v1/workspaces/:wid/documents ``` ```bash curl -X POST \ -H "Authorization: Bearer wfb_..." \ -H "Content-Type: application/json" \ -d '{"title": "Meeting Notes", "type": "doc"}' \ https://api.wafflebase.io/api/v1/workspaces/:wid/documents ``` ```bash curl -X POST \ -H "Authorization: Bearer wfb_..." \ -H "Content-Type: application/json" \ -d '{"title": "Launch Deck", "type": "slides"}' \ https://api.wafflebase.io/api/v1/workspaces/:wid/documents ``` -------------------------------- ### Importing Slides Source: https://wafflebase.io/docs/developers/cli.html Commands for importing PowerPoint files as new decks or replacing existing ones. ```bash wafflebase slides import deck.pptx wafflebase slides import deck.pptx --title "Roadmap" ``` ```bash wafflebase slides import revision.pptx --replace --yes ``` ```bash wafflebase slides import deck.pptx --dry-run ``` -------------------------------- ### Perform DOCX to PDF round-trip Source: https://wafflebase.io/docs/developers/cli.html Import a document, verify content in Markdown, and export to PDF. ```bash DOC_ID=$(wafflebase docs import draft.docx --format json | jq -r '.id') wafflebase docs content "$DOC_ID" --format md wafflebase docs export "$DOC_ID" final.pdf ``` -------------------------------- ### Export slide decks to PPTX Source: https://wafflebase.io/docs/developers/cli.html Convert slide decks to PPTX format with support for piping and overwriting files. ```bash # Auto-detected from the .pptx extension wafflebase slides export deck.pptx # Explicit format (only "pptx" is supported) wafflebase slides export out --format pptx # Pipe binary to stdout wafflebase slides export - --format pptx > deck.pptx # Overwrite an existing file wafflebase slides export deck.pptx --force ``` -------------------------------- ### Import documents using CLI Source: https://wafflebase.io/docs/developers/cli.html Commands for importing DOCX files as new documents or replacing existing ones, including support for stdin and dry-run modes. ```bash wafflebase docs import draft.docx wafflebase docs import draft.docx --title "Final Draft" ``` ```bash cat draft.docx | wafflebase docs import - ``` ```bash wafflebase docs import revision.docx --replace --yes ``` ```bash wafflebase docs import draft.docx --dry-run wafflebase docs import revision.docx --replace --dry-run ``` -------------------------------- ### POST /api/v1/workspaces/:wid/documents Source: https://wafflebase.io/docs/developers/rest-api.html Creates a new document, sheet, or slides deck within a specified workspace. ```APIDOC ## POST /api/v1/workspaces/:wid/documents ### Description Creates a new document in the specified workspace. The type can be specified as 'sheet' (default), 'doc', or 'slides'. ### Method POST ### Endpoint /api/v1/workspaces/:wid/documents ### Parameters #### Path Parameters - **wid** (string) - Required - The workspace ID. #### Request Body - **title** (string) - Required - Document title - **type** (string) - Optional - "sheet" (default), "doc", or "slides" ### Request Example {"title": "Q1 Report", "type": "sheet"} ``` -------------------------------- ### Authenticate with API Keys Source: https://wafflebase.io/docs/developers/cli.html Use API keys for non-interactive environments via flags or environment variables. ```bash wafflebase --api-key wfb_xxx docs list # Or via environment variable: export WAFFLEBASE_API_KEY=wfb_xxx ``` -------------------------------- ### Manage slide decks Source: https://wafflebase.io/docs/developers/cli.html Basic CRUD operations for slide deck documents. ```bash # List slide decks (filtered to type=slides) wafflebase slides list # Create a new deck wafflebase slides create "Kickoff Deck" # Get deck metadata wafflebase slides get # Rename a deck wafflebase slides rename "New Title" # Delete a deck wafflebase slides delete ``` -------------------------------- ### List Documents Source: https://wafflebase.io/docs/developers/rest-api.html Retrieve a list of documents within a workspace. ```bash GET /api/v1/workspaces/:wid/documents ``` ```bash curl -H "Authorization: Bearer wfb_..." \ https://api.wafflebase.io/api/v1/workspaces/:wid/documents ``` -------------------------------- ### Configure Environment Variables Source: https://wafflebase.io/docs/developers/self-hosting.html Required and optional environment variables for the backend service, to be placed in packages/backend/.env. ```env # Required DATABASE_URL=postgresql://wafflebase:wafflebase@localhost:5432/wafflebase JWT_SECRET=your_secret_here GITHUB_CLIENT_ID=your_github_client_id GITHUB_CLIENT_SECRET=your_github_client_secret GITHUB_CALLBACK_URL=http://localhost:3000/auth/github/callback FRONTEND_URL=http://localhost:5173 # Optional PORT=3000 JWT_ACCESS_EXPIRES_IN=1h JWT_REFRESH_EXPIRES_IN=7d ``` -------------------------------- ### Authenticate with Wafflebase Source: https://wafflebase.io/docs/developers/cli.html Log in via GitHub OAuth or specify a custom server URL. ```bash wafflebase login ``` ```bash wafflebase login --server https://api.example.com ``` -------------------------------- ### Export documents using CLI Source: https://wafflebase.io/docs/developers/cli.html Commands for exporting documents to PDF or DOCX formats with options for page ranges, stdout piping, and overwriting files. ```bash wafflebase docs export output.pdf ``` ```bash wafflebase docs export output.pdf --pages 1-3 ``` ```bash wafflebase docs export output.docx ``` ```bash wafflebase docs export - --format pdf > out.pdf ``` ```bash wafflebase docs export output.pdf --force ``` -------------------------------- ### Check CLI Status Source: https://wafflebase.io/docs/developers/cli.html Verify the current authentication status. ```bash wafflebase status ``` -------------------------------- ### Set Environment Variables Source: https://wafflebase.io/docs/developers/cli.html Configure CLI behavior using environment variables. ```bash export WAFFLEBASE_SERVER=http://localhost:3000 export WAFFLEBASE_API_KEY=wfb_your_api_key export WAFFLEBASE_WORKSPACE=your-workspace-id ``` -------------------------------- ### POST /api/v1/workspaces/:wid/documents Source: https://wafflebase.io/docs/developers/rest-api.html Creates a new document within the specified workspace. ```APIDOC ## POST /api/v1/workspaces/:wid/documents ### Description Creates a new document within the specified workspace. ### Method POST ### Endpoint /api/v1/workspaces/:wid/documents ### Parameters #### Path Parameters - **wid** (string) - Required - The unique identifier of the workspace. ``` -------------------------------- ### POST /api/v1/workspaces/:wid/images Source: https://wafflebase.io/docs/developers/rest-api.html Uploads an image to the workspace storage. ```APIDOC ## POST /api/v1/workspaces/:wid/images ### Description Uploads an image file to workspace-scoped storage. Supports png, jpeg, gif, and webp formats up to 10MB. ### Method POST ### Endpoint /api/v1/workspaces/:wid/images ### Parameters #### Path Parameters - **wid** (string) - Required - The workspace ID. ### Request Body - **file** (binary) - Required - The image file to upload. ### Response #### Success Response (200) - **id** (string) - The image ID. - **url** (string) - The URL to access the image. ``` -------------------------------- ### Execute dry-run mode Source: https://wafflebase.io/docs/developers/cli.html Simulate a command execution to view the API request details without modifying data. ```bash $ wafflebase --dry-run sheets cells set abc-123 A1 "Hello" { "dry_run": true, "method": "PUT", "url": "http://localhost:3000/api/v1/workspaces/.../tabs/tab-1/cells/A1", "body": { "value": "Hello" } } ``` -------------------------------- ### wafflebase docs create Source: https://wafflebase.io/docs/developers/cli.html Creates a new document or spreadsheet. ```APIDOC ## wafflebase docs create ### Description Creates a new document with the specified title. ### Parameters - **title** (string) - Required - The title of the new document. - **--type** (string) - Optional - Document type: 'sheet' or 'doc'. Default is 'sheet'. ``` -------------------------------- ### Analyze document content with LLM Source: https://wafflebase.io/docs/developers/cli.html Pipe document content directly into an LLM for summarization. ```bash wafflebase docs content <doc-id> --format md --quiet > /tmp/doc.md cat /tmp/doc.md | claude "Summarize this in 5 bullet points" ``` -------------------------------- ### Upload Image Source: https://wafflebase.io/docs/developers/rest-api.html Upload an image file to workspace storage using multipart form data. Max file size is 10 MB. ```bash POST /api/v1/workspaces/:wid/images ``` ```bash curl -X POST \ -H "Authorization: Bearer wfb_..." \ -F "file=@chart.png" \ https://api.wafflebase.io/api/v1/workspaces/:wid/images ``` ```json { "id": "<imageId>", "url": "/api/v1/workspaces/:wid/images/<imageId>" } ``` -------------------------------- ### wafflebase ctx Source: https://wafflebase.io/docs/developers/cli.html Manages workspace context switching. ```APIDOC ## wafflebase ctx ### Description Lists available workspaces or switches the active workspace context. ### Usage `wafflebase ctx list` `wafflebase ctx switch <workspace_name_or_id>` ``` -------------------------------- ### PUT /api/v1/workspaces/:wid/documents/:did/content Source: https://wafflebase.io/docs/developers/rest-api.html Destructively replaces the document content. ```APIDOC ## PUT /api/v1/workspaces/:wid/documents/:did/content ### Description Replaces the document's root with the provided JSON structure. ### Method PUT ### Endpoint /api/v1/workspaces/:wid/documents/:did/content ### Parameters #### Request Body - **blocks** (array) - Required - Top-level blocks - **pageSetup** (object) - Optional - Paper settings - **header** (object) - Optional - Header region - **footer** (object) - Optional - Footer region ``` -------------------------------- ### Authenticate API Requests Source: https://wafflebase.io/docs/developers/rest-api.html Include the API key in the Authorization header for all requests. ```bash curl -H "Authorization: Bearer wfb_your_key_here" \ https://api.wafflebase.io/api/v1/workspaces/:wid/documents ``` -------------------------------- ### Calculate Budget Totals Source: https://wafflebase.io/docs/sheets/build-a-budget.html Use the SUM function to aggregate budget and actual spending columns. ```spreadsheet =SUM(B2:B7) ``` ```spreadsheet =SUM(C2:C7) ``` -------------------------------- ### Replace Document Content Endpoint Source: https://wafflebase.io/docs/developers/rest-api.html Destructively replaces the document's Yorkie root. ```bash PUT /api/v1/workspaces/:wid/documents/:did/content ``` -------------------------------- ### Analyze Budget Data Source: https://wafflebase.io/docs/sheets/build-a-budget.html Various formulas for calculating averages, finding maximums, counting over-budget items, and determining budget utilization percentage. ```spreadsheet =AVERAGE(C2:C7) ``` ```spreadsheet =MAX(C2:C7) ``` ```spreadsheet =COUNTIF(D2:D7, "<0") ``` ```spreadsheet =C8/B8*100 ``` -------------------------------- ### Read slide deck content Source: https://wafflebase.io/docs/developers/cli.html Extract slide content as JSON, Markdown, or plain text with optional speaker notes. ```bash # Default JSON (raw SlidesDocument) wafflebase slides content <doc-id> # Markdown / plain text — one section per slide wafflebase slides content <doc-id> --format md wafflebase slides content <doc-id> --format text # Include speaker notes (md/text only) wafflebase slides content <doc-id> --format md --notes # Save to a file (refuses to overwrite without --force) wafflebase slides content <doc-id> --format md --out deck.md --force ``` -------------------------------- ### Update Document Source: https://wafflebase.io/docs/developers/rest-api.html Modify an existing document's properties. ```bash PATCH /api/v1/workspaces/:wid/documents/:did ``` ```bash curl -X PATCH \ -H "Authorization: Bearer wfb_..." \ -H "Content-Type: application/json" \ -d '{"title": "Q1 Report (Updated)"}' \ https://api.wafflebase.io/api/v1/workspaces/:wid/documents/:did ``` -------------------------------- ### Manage spreadsheet data Source: https://wafflebase.io/docs/developers/cli.html Commands for importing CSV data, setting cell formulas, and exporting ranges. ```bash wafflebase sheets import abc-123 sales.csv wafflebase sheets cells set abc-123 C1 "=SUM(B2:B100)" --formula wafflebase sheets export abc-123 report.csv --range A1:C100 ``` -------------------------------- ### Batch populate sheet cells Source: https://wafflebase.io/docs/developers/cli.html Update multiple cells at once using a JSON data payload. ```bash wafflebase sheets cells batch abc-123 --data '{ "A1": {"value": "Name"}, "B1": {"value": "Email"}, "A2": {"value": "Alice"}, "B2": {"value": "alice@example.com"} }' ``` -------------------------------- ### Define Base URL Source: https://wafflebase.io/docs/developers/rest-api.html The base URL for all API requests, requiring the workspace ID. ```text https://api.wafflebase.io/api/v1/workspaces/:workspaceId ``` -------------------------------- ### Import spreadsheet data Source: https://wafflebase.io/docs/developers/cli.html Import CSV or JSON data into a spreadsheet tab with options for target location and dry-run validation. ```bash # Import a CSV file wafflebase sheets import <doc-id> data.csv # Import a JSON file wafflebase sheets import <doc-id> data.json # Import from stdin cat data.csv | wafflebase sheets import <doc-id> - # Import starting at a specific cell wafflebase sheets import <doc-id> data.csv --start C5 # Target a specific tab wafflebase sheets import <doc-id> data.csv --tab tab-2 # Preview without writing wafflebase sheets import <doc-id> data.csv --dry-run ``` -------------------------------- ### List spreadsheet tabs Source: https://wafflebase.io/docs/developers/cli.html Retrieve a list of all tabs available in a specific spreadsheet. ```bash wafflebase sheets tabs list <doc-id> ``` -------------------------------- ### Fetch Document Content via cURL Source: https://wafflebase.io/docs/developers/rest-api.html Retrieves the full document JSON using cURL. ```bash curl -H "Authorization: Bearer wfb_..." \ https://api.wafflebase.io/api/v1/workspaces/:wid/documents/:did/content ``` -------------------------------- ### Read document content Source: https://wafflebase.io/docs/developers/cli.html Commands to retrieve document content in JSON, Markdown, or plain text formats with optional page filtering and output settings. ```bash # Default JSON wafflebase docs content <doc-id> # GitHub-Flavoured Markdown for human reading or LLM input wafflebase docs content <doc-id> --format md # Plain text (one block per line, no formatting) wafflebase docs content <doc-id> --format text # Slice by page range (1-based; clamps with stderr warning) wafflebase docs content <doc-id> --pages 1-3,5 # Include header/footer regions (md/text only — JSON always includes them) wafflebase docs content <doc-id> --format md --include-header-footer # Inline data: image URLs (md only) wafflebase docs content <doc-id> --format md --inline-images # Save to a file (refuses to overwrite without --force) wafflebase docs content <doc-id> --format md --out summary.md wafflebase docs content <doc-id> --format md --out summary.md --force ``` -------------------------------- ### wafflebase login Source: https://wafflebase.io/docs/developers/cli.html Authenticates the user via GitHub OAuth and stores the session token. ```APIDOC ## wafflebase login ### Description Logs the user in via GitHub OAuth in the browser and stores the JWT session. Optionally supports specifying a custom server URL. ### Usage `wafflebase login [--server <url>]` ``` -------------------------------- ### Cell references and operators Source: https://wafflebase.io/docs/sheets/formulas.html Use cell references and operators to perform calculations or join text. ```text =A1 * 1.1 ``` ```text =A1 > 100 ``` ```text =A1 & " " & B1 ``` -------------------------------- ### Totals and averages functions Source: https://wafflebase.io/docs/sheets/formulas.html Common aggregation functions for numerical data. ```text =SUM(B2:B10) ``` ```text =AVERAGE(B2:B10) ``` ```text =COUNT(B2:B10) ``` ```text =COUNTA(A:A) ``` ```text =MAX(B2:B10) ``` -------------------------------- ### Apply Conditional Status Logic Source: https://wafflebase.io/docs/sheets/build-a-budget.html Use the IF function to label categories as 'Over' or 'OK' based on the difference value. ```spreadsheet =IF(D2 < 0, "Over", "OK") ``` -------------------------------- ### Conditional logic functions Source: https://wafflebase.io/docs/sheets/formulas.html Functions for handling conditional branching and error management. ```text =IF(A1>0, "Profit", "Loss") ``` ```text =IFERROR(A1/B1, 0) ``` ```text =SUMIF(A:A, "Sales", B:B) ``` ```text =COUNTIF(A:A, ">100") ``` ```text =IFS(A1>=90,"A", A1>=80,"B", TRUE,"C") ``` -------------------------------- ### List Tabs Source: https://wafflebase.io/docs/developers/rest-api.html Retrieve an array of tab descriptors for a sheet document. This endpoint returns 409 if called on a non-sheet document. ```bash GET /api/v1/workspaces/:wid/documents/:did/tabs ``` -------------------------------- ### Fetch Cells via cURL Source: https://wafflebase.io/docs/developers/rest-api.html Retrieves all cells or a specific range using cURL. ```bash # Get all cells curl -H "Authorization: Bearer wfb_..." \ .../tabs/:tid/cells # Get a range curl -H "Authorization: Bearer wfb_..." \ .../tabs/:tid/cells?range=A1:C10 ``` -------------------------------- ### Date and time functions Source: https://wafflebase.io/docs/sheets/formulas.html Functions for calculating and extracting date information. ```text =TODAY() ``` ```text =DAYS(B1, A1) ``` ```text =YEAR(A1) ``` ```text =EDATE(A1, 3) ``` -------------------------------- ### PATCH /api/v1/workspaces/:wid/documents/:did Source: https://wafflebase.io/docs/developers/rest-api.html Updates the properties of an existing document. ```APIDOC ## PATCH /api/v1/workspaces/:wid/documents/:did ### Description Updates an existing document identified by its ID. ### Method PATCH ### Endpoint /api/v1/workspaces/:wid/documents/:did ### Parameters #### Path Parameters - **wid** (string) - Required - The workspace ID. - **did** (string) - Required - The document ID. ### Request Body - **title** (string) - Optional - New document title ``` -------------------------------- ### Export spreadsheet data Source: https://wafflebase.io/docs/developers/cli.html Commands for exporting sheet data to various formats or stdout. ```bash wafflebase sheets export <doc-id> output.csv ``` ```bash wafflebase sheets export <doc-id> output.json ``` ```bash wafflebase sheets export <doc-id> output.csv --range A1:D100 ``` ```bash wafflebase sheets export <doc-id> - --file-format csv | head -20 ``` -------------------------------- ### Delete Document Source: https://wafflebase.io/docs/developers/rest-api.html Remove a document from the workspace. ```bash DELETE /api/v1/workspaces/:wid/documents/:did ``` -------------------------------- ### Replace Document Content via cURL Source: https://wafflebase.io/docs/developers/rest-api.html Replaces the document content using a JSON file. ```bash curl -X PUT \ -H "Authorization: Bearer wfb_..." \ -H "Content-Type: application/json" \ -d @document.json \ .../documents/:did/content ``` -------------------------------- ### wafflebase docs list Source: https://wafflebase.io/docs/developers/cli.html Lists all documents, optionally filtered by type. ```APIDOC ## wafflebase docs list ### Description Lists all documents. Use the --type flag to filter by 'doc' or 'sheet'. ### Parameters - **--type** (string) - Optional - Document type: 'sheet' or 'doc'. ``` -------------------------------- ### Calculate Budget Difference Source: https://wafflebase.io/docs/sheets/build-a-budget.html Subtract actual spending from the budget to determine savings or overspending. ```spreadsheet =B2-C2 ``` -------------------------------- ### Lookup functions Source: https://wafflebase.io/docs/sheets/formulas.html Functions for retrieving data from tables based on specific criteria. ```text =VLOOKUP("Alice", A:C, 3, FALSE) ``` ```text =XLOOKUP(A1, D:D, E:E) ``` ```text =INDEX(B:B, MATCH("Alice", A:A, 0)) ``` -------------------------------- ### PUT /api/v1/workspaces/:wid/documents/:did/tabs/:tid/cells/:ref Source: https://wafflebase.io/docs/developers/rest-api.html Sets the value or formula for a specific cell. ```APIDOC ## PUT /api/v1/workspaces/:wid/documents/:did/tabs/:tid/cells/:ref ### Description Updates the value or formula of a single cell. ### Method PUT ### Endpoint /api/v1/workspaces/:wid/documents/:did/tabs/:tid/cells/:ref ### Parameters #### Request Body - **value** (string) - Optional - Plain value - **formula** (string) - Optional - Formula string ``` -------------------------------- ### Batch Update Cells via cURL Source: https://wafflebase.io/docs/developers/rest-api.html Updates multiple cells or deletes them by setting the value to null. ```bash curl -X PATCH \ -H "Authorization: Bearer wfb_..." \ -H "Content-Type: application/json" \ -d '{ "cells": { "A1": {"value": "Name"}, "B1": {"value": "Score"}, "C1": {"formula": "=SUM(B2:B100)"}, "D1": null } }' \ .../tabs/:tid/cells ``` -------------------------------- ### Batch Update Cells Endpoint Source: https://wafflebase.io/docs/developers/rest-api.html Updates multiple cells in a single request. ```bash PATCH /api/v1/workspaces/:wid/documents/:did/tabs/:tid/cells ``` -------------------------------- ### Delete Image Source: https://wafflebase.io/docs/developers/rest-api.html Remove an image from workspace storage. ```bash DELETE /api/v1/workspaces/:wid/images/:imageId ``` ```json { "deleted": true } ``` -------------------------------- ### Logout from Wafflebase Source: https://wafflebase.io/docs/developers/cli.html Clear the current session. ```bash wafflebase logout ``` -------------------------------- ### Fetch Single Cell via cURL Source: https://wafflebase.io/docs/developers/rest-api.html Retrieves a single cell by its reference using cURL. ```bash curl -H "Authorization: Bearer wfb_..." \ .../tabs/:tid/cells/A1 ``` -------------------------------- ### wafflebase docs content Source: https://wafflebase.io/docs/developers/cli.html Retrieves the content of a document in various formats. ```APIDOC ## wafflebase docs content <doc-id> ### Description Reads a word-processor document as JSON, Markdown, or plain text. ### Parameters - **doc-id** (string) - Required - The unique identifier of the document. - **--format** (string) - Optional - Output format: 'json', 'md', or 'text'. Default is 'json'. - **--pages** (string) - Optional - Page selection range (e.g., '1-3,5'). - **--include-header-footer** (boolean) - Optional - Include header/footer in md/text output. - **--inline-images** (boolean) - Optional - Emit data image URLs in md output. - **--out** (string) - Optional - File path to write output. - **--force** (boolean) - Optional - Overwrite existing output file. ``` -------------------------------- ### Text manipulation functions Source: https://wafflebase.io/docs/sheets/formulas.html Functions for formatting and modifying string data. ```text =CONCATENATE(A1, " ", B1) ``` ```text =LEFT(A1, 3) ``` ```text =TRIM(A1) ``` ```text =UPPER(A1) ``` ```text =SUBSTITUTE(A1, "old", "new") ``` -------------------------------- ### Set Cell Value Endpoint Source: https://wafflebase.io/docs/developers/rest-api.html Updates the value or formula of a specific cell. ```bash PUT /api/v1/workspaces/:wid/documents/:did/tabs/:tid/cells/:ref ``` -------------------------------- ### Manage spreadsheet cells Source: https://wafflebase.io/docs/developers/cli.html Perform CRUD operations on spreadsheet cells, including batch updates and formula support. ```bash # Get all cells (default tab) wafflebase sheets cells get <doc-id> # Get a specific cell wafflebase sheets cells get <doc-id> A1 # Get a range wafflebase sheets cells get <doc-id> A1:C10 # Specify a tab wafflebase sheets cells get <doc-id> A1:C10 --tab tab-2 # Set a cell value wafflebase sheets cells set <doc-id> A1 "Revenue" # Set a formula wafflebase sheets cells set <doc-id> B2 "=SUM(A1:A10)" --formula # Delete a cell wafflebase sheets cells delete <doc-id> A1 # Batch update (inline JSON) wafflebase sheets cells batch <doc-id> \ --data '{"A1": {"value": "Name"}, "B1": {"value": "Score"}}' # Batch update (from stdin) echo '{"A1": {"value": "1"}, "A2": {"value": "2"}}' | \ wafflebase sheets cells batch <doc-id> ``` -------------------------------- ### wafflebase status Source: https://wafflebase.io/docs/developers/cli.html Checks the current authentication status. ```APIDOC ## wafflebase status ### Description Displays the current authentication status of the CLI. ``` -------------------------------- ### wafflebase logout Source: https://wafflebase.io/docs/developers/cli.html Logs the user out of the current session. ```APIDOC ## wafflebase logout ### Description Logs the user out and clears the stored session. ``` -------------------------------- ### PATCH /api/v1/workspaces/:wid/documents/:did/tabs/:tid/cells Source: https://wafflebase.io/docs/developers/rest-api.html Updates multiple cells in a single request. ```APIDOC ## PATCH /api/v1/workspaces/:wid/documents/:did/tabs/:tid/cells ### Description Performs a batch update on multiple cells. Set a cell to null to delete it. ### Method PATCH ### Endpoint /api/v1/workspaces/:wid/documents/:did/tabs/:tid/cells ### Request Body - **cells** (object) - Required - Map of cell references to their new values or null ``` -------------------------------- ### Set Cell Value via cURL Source: https://wafflebase.io/docs/developers/rest-api.html Updates a cell with a text value or a formula. ```bash # Set a text value curl -X PUT \ -H "Authorization: Bearer wfb_..." \ -H "Content-Type: application/json" \ -d '{"value": "Revenue"}' \ .../tabs/:tid/cells/A1 # Set a formula curl -X PUT \ -H "Authorization: Bearer wfb_..." \ -H "Content-Type: application/json" \ -d '{"formula": "=SUM(A1:A10)"}' \ .../tabs/:tid/cells/B1 ``` -------------------------------- ### DELETE /api/v1/workspaces/:wid/documents/:did/tabs/:tid/cells/:ref Source: https://wafflebase.io/docs/developers/rest-api.html Deletes a specific cell. ```APIDOC ## DELETE /api/v1/workspaces/:wid/documents/:did/tabs/:tid/cells/:ref ### Description Removes a cell from the sheet. ### Method DELETE ### Endpoint /api/v1/workspaces/:wid/documents/:did/tabs/:tid/cells/:ref ``` -------------------------------- ### Delete Cell Endpoint Source: https://wafflebase.io/docs/developers/rest-api.html Removes a cell from the sheet. ```bash DELETE /api/v1/workspaces/:wid/documents/:did/tabs/:tid/cells/:ref ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.