Skip to content

Apps ​

An app is a note that replays a workflow without AI. You ask the AI once, with tools: it queries your database, calls Jira, runs your scripts. Then you save what worked as a note. Next time, you fill in a form and press Run: the same steps run again with new values, in seconds, at no AI cost.

An app is plain markdown: a YAML frontmatter that declares parameters, then executable blocks (sql, mcp, script, http, js…). It lives in your vault, so you can version it with Git, review it, and share it with your team.

md
---
app: 1
description: Unpaid invoices of a country, older than N days
params:
  country: { type: string, enum: [FR, DE, ES], default: FR }
  days: { type: integer, default: 30 }
---
# Unpaid invoices

```sql mcp=shop_db dialect=postgres name=unpaid
SELECT customer, amount, due_date
FROM invoices
WHERE country = :country
  AND paid = false
  AND due_date < now() - make_interval(days => :days)
```

Create an app from an AI session ​

  1. Open the AI overlay on a note and turn on the Tools chip. The AI can now use your MCP servers, your registered scripts and your existing apps.
  2. Ask your questions as usual: "list my Tempo time entries of last week", "show me the related Jira tickets". Each successful tool call is recorded.
  3. Click ▶ Save as app in the overlay (or type /app, optionally with an instruction: /app with the country as a parameter).

Znote builds a draft with one block per successful call. The AI keeps the useful steps, drops the exploration, and turns the values you are likely to change (dates, names, limits, search terms) into parameters. The new note gets a short name from its title, such as tempo-time-jira-tickets.

Two safeguards apply:

  • The AI cannot invent a step. A created app may only use the servers, tools and scripts that actually ran during the session.
  • The note is validated before it is kept. If the AI's version is invalid, its errors are sent back once. If it is still invalid, the app is saved as recorded, without parameters.

Edit an app with /app ​

On an app note, the AI input opens with /app already typed. Describe the change and press Enter:

  • /app add a boolean parameter to include the system databases
  • /app show the Jira results as a table
  • /app keep only the tickets that are not done

The AI receives the note and, if the app ran, the shape of its last results. It can add js blocks to reshape the data. The change is applied only if the new version is valid, in one undo step (Cmd/Ctrl+Z restores the previous version). To ask something else about the note, erase /app .

Run an app ​

An app note shows an App panel below its frontmatter:

  • a form for the parameters, with their defaults;
  • a preset selector, when the app declares presets;
  • ▶ Run / ■ Stop (Cmd/Ctrl+Enter in a field also runs the app);
  • the result of each block: an array of objects is shown as a table, other values as text or JSON.

Each block also has its own ▶ (and Cmd/Ctrl+Enter inside the block). It runs that block and the blocks it depends on, with the panel's values, and shows the result under the block. This is the fastest way to iterate on one step.

Apps run in a separate process: an endless loop or a stuck server never freezes Znote, and Stop kills it.

Approvals ​

Nothing that an AI or a teammate wrote can run code on your machine until you approve it. Approval is required for:

  • each MCP server of .znote/mcp.json (it is a command that Znote starts);
  • each entry of the script registry;
  • each block of free code (js, bash, sh);
  • each block that uses a secret.

When an app needs an approval, the panel shows Review & approve…. The dialog shows exactly what you approve: the code, the command, and the state of the secrets it uses.

An approval covers the content, by fingerprint. Any change to the block, the command or the script cancels it, so it must be approved again. Approvals are stored outside the vault (~/.znote/trust.json), so a commit cannot approve itself.

sql and mcp blocks without a secret, script blocks that call an approved entry, http blocks without a secret and data blocks need no approval.

Writes need confirmation ​

A block that changes something (creates, updates, deletes, posts, logs time…) is marked confirm=true. It never runs without your confirmation: the panel shows what it is about to send, and you confirm it.

Find an app ​

The Apps icon of the left bar searches the apps of the vault by their description and their when: phrasings ("what do you want to do?").

With the Tools chip on, the AI also searches your apps first. When an app fits your question, it runs the app instead of redoing the work.

Next steps ​

Znote — your notes, your files, your machine.