# Can I add notes from the command line (CLI) or an AI agent? Yes, with `privacynotes`, the PrivacyNotes command line interface (CLI). Anything that runs in a terminal can use it: your own scripts, scheduled jobs and AI coding agents. Pipe in Markdown, add a title and tags, and the note lands in the Agent folder of your notes, on all your devices after their next sync. `privacynotes` can only add notes: it cannot open, change or delete the notes you have. It needs [Node.js](https://nodejs.org/en/download) 20 or newer, and it is part of Pro. To set it up, open Settings > CLI in the desktop app and choose Turn on. Choose Install, which puts the `privacynotes` command on this computer, then Make a code. In a new terminal, run `privacynotes login` and paste the code. Then save your first note: `echo "# Hello" | privacynotes save` `privacynotes` has few commands, because it does one job. Each one prints a short card for a person, or one line of JSON with `--json` for a script: - `privacynotes login` connects this computer with a one-time code from Settings > CLI. Paste the code, or pipe it in. - `privacynotes save note.md` adds a note from a file, and `privacynotes save` alone reads Markdown piped in. `--title` sets the title, otherwise the first `#` heading or the first line is used. `--tag work,ideas` adds tags. - `privacynotes status` shows whether this computer is connected, and the last note it saved. - `privacynotes logout` disconnects this computer. - `privacynotes mcp` runs the command as a tool for an AI app with no terminal, see [MCP](https://privacynotes.app/help/mcp). - `privacynotes help` (or `privacynotes --help`) lists every command and option, and `privacynotes --version` prints the version. With an AI coding agent, connect `privacynotes` once on the computer where the agent runs, then ask in plain words: "Save this plan to my PrivacyNotes with privacynotes save, tagged project." The agent can read `privacynotes --help` for the details, writes the Markdown and pipes it in. The same command works in your own scripts and scheduled jobs: - `git log --oneline -20 | privacynotes save --title "Recent commits"` saves your latest commits. - `pbpaste | privacynotes save --tag inbox` saves what you copied, on a Mac. - `privacynotes save --tag daily report.md` in a nightly job saves a generated report. - A key you pick in your system's settings can run `privacynotes save` too, see [Can I add a note with a keyboard shortcut, without opening the app?](https://privacynotes.app/help/quick-note-shortcut) A note holds up to 700 KB of Markdown, 20 tags and a 200-character title, and `privacynotes` checks this before it sends. It exits with 0 when the note is saved, 1 when the server refuses it, 2 for bad input, 3 when the computer is not connected and 4 when there is no network, so a script can react. A saved note waits, sealed, until one of your apps opens; if none does within 90 days, or you remove the computer first, it is deleted. To disconnect a computer, choose Remove next to it in Settings > CLI. What the command and an agent can see is in [Can the command line tool or an AI agent read my notes?](https://privacynotes.app/help/cli-security). --- Source: https://privacynotes.app/help/command-line