Tour of Kiki
A Kiki page is plain text that computes: prose, typed tables, queries, tested formulas, charts, and interactive controls live together and recalculate as you edit.
Live values and prose
Write ordinary text anywhere. Start a line with > to write code, and use \(...) to splice a result into a sentence:
> usd = format.money "USD"
> price = 4.50
> cups = 7
Seven cups at $4.50 come to $31.50.
Structure prose with #, ##, and ### for headings, - for bullets, and + for numbered lists. Style inline text with functions:
• \(bold ~ important) renders as important (italic, dim, underline, and strikethrough work the same way).
• \(link "https://kikiai.app" ~ Kiki) renders as Kiki.
• Names in backticks become clickable references, such as price or doc/markup.ki.
Tables
Paste cells straight from Excel or Google Sheets (Cmd/Ctrl+V), drop a .csv or .xlsx file onto the page, or type |Columns| followed by rows—columns align automatically:
> expenses = |Category Item Amount|
Food Lunch 12.50
Travel Train 18.25
Food Coffee 4.75
Tools Notebook 7.00
Travel Taxi 31.40
Gift Gift card 30.00
A table is both an ordered list of row records (expenses.0 is {Category = "Food" Item = "Lunch" Amount = 12.50}) and a record of column lists (expenses.Item.0..3 is ["Lunch" "Train" "Coffee"]).
Queries and summaries
|> ("then") passes a value into the next step. filter keeps matching rows, select picks or computes columns, and sort orders rows (- sorts descending):
> expenses
|> filter Category == "Food"
|> select Item Amount Tip = (Amount * 0.15 |> usd)
|> sort Amount
Item Amount Tip
Coffee 4.75 $0.71 Lunch 12.50 $1.88
aggregate reduces a table to one value (sum, count, avg, min, max), and group builds one summary row per category:
> expenses |> aggregate sum Amount
103.90
> by-category = expenses
|> group Category Items = count Total = (sum Amount)
|> sort -Total
> by-category
Category Items Total
Travel 2 49.65
Gift 1 30.00
Food 2 17.25
Tools 1 7.00
See doc/query.ki for joins (lookup, embed), running totals (running), and pivots (reshape).
Formulas and tests
Name any repeated rule once with fn and verify it inline with =>:
> with-tax = fn amount -> amount * 1.08
> with-tax 25.0 => 27.0 ✓
If an edit breaks a rule, the => check flags the mismatch immediately. Use your function inside any query:
> expenses |> select Item Amount Total = (with-tax Amount |> usd)
Item Amount Total
Lunch 12.50 $13.50 Train 18.25 $19.71 Coffee 4.75 $5.13 Notebook 7.00 $7.56 Taxi 31.40 $33.91 Gift card 30.00 $32.40
Charts and controls
Pipe a table into chart.bar, chart.line, chart.pie, or chart.heatmap (doc/chart.ki):
> by-category |> chart.bar x = Category y = Total height = 180
Read CSV or JSON files reactively with read-table, wrap a default value in state, and place it with input or field to add an interactive control that filters or recalculates without changing the source file (doc/ui.ki):
> people = :|Name = string Age = int| read-table "doc/data/people.csv"
> max-age = state ((slider 0 60 1) 28)
> input max-age
> people |> filter Age <= max-age
Name Age
Bob 25
Views and editing
Every page has four modes in the title bar's mode menu:
• Use: Buttons, form fields, and editable tables stay live while prose and formulas are locked against stray edits. Start a tool page with > set view = 'tool so it opens in Use mode.
• Edit: Edit prose and values in place while code stays folded until your caret enters a cell, you hover an output and click <>, or you press Cmd/Ctrl+/ (> set view = 'page).
• Code: Shows every formula and query above its live result (> set view = 'code).
• Source: Plain text only, with no rendered output.
Readers without edit permission always see the clean Use view with no mode controls (doc/share.ki).
Workspaces, files, and AI
• Workspaces: Try Kiki without an account in /playground or any demo (demo/index.ki). Sign in (settings/index.ki) to create a synced workspace that works offline, syncs across devices, and supports team collaboration; press Ctrl+T to open or create a page, or click the workspace name in the title bar to browse files.
• Import files: Paste spreadsheet ranges directly, or drag .csv, .xlsx, and .pdf files into the window.
• Work with @AI: Start a line with @AI to ask for a query, chart, PDF table extraction, or a multi-page tool (doc/ai.ki).
Where next
• doc/build.ki — structure a multi-page tool over shared records
• doc/table.ki — column formats, keys, owners, boards, and calendars
• doc/share.ki — share links, public forms, and row-level access
• doc/dev-tour.ki — language tour for programmers