README.md

Shrok

Shrok is a personal assistant that runs on your own computer or server, and you talk to it through SimpleX Chat on your phone. It answers questions, remembers what you tell it, saves the links and files you share, and runs reminders and tasks on a schedule. With Google or X set up, it can also work with your mail, calendar, Drive and posts on X.

Warning

Shrok is in alpha. One person builds it in their spare time, so expect rough edges and changes that break things between versions. Keep a backup of your data folder, as docs/backup.md describes. There is no support promise, but you can report bugs in the issue tracker, and you can report security problems as SECURITY.md describes.

How a message is answered

Shrok keeps your chats, memory and saved items on your machine, and it sends each conversation to the model provider whose key you set. When a task needs an action outside your machine, such as sending an email, Shrok asks you on your phone first.

mermaid
1sequenceDiagram
2 participant Phone as You, in SimpleX on your phone
3 participant Shrok as Shrok, on your machine
4 participant Model as Anthropic or OpenAI
5 participant World as Web, Gmail, Calendar, Drive, X
6 Phone->>Shrok: "Move the dentist to Friday at 10:00"
7 Shrok->>Model: the conversation
8 Model-->>Shrok: read the calendar, then change the event
9 Shrok->>World: read your calendar
10 Shrok->>Phone: request 4, "change Dentist to Friday 10:00"
11 Shrok-->>Phone: "I've asked you to approve the change."
12 Note over Phone,Shrok: Shrok keeps answering other messages while request 4 waits.
13 Phone->>Shrok: /yes 4
14 Shrok->>World: change the event
15 Shrok-->>Phone: "Done. The dentist is on Friday at 10:00."

What Shrok asks you about

Shrok reads and keeps notes on its own, and it asks before it acts for you outside your machine.

What Shrok doesDoes it ask you first?
Reads a page you sent, your mail, your calendar or your DriveNo
Sets a reminder or a task for later, archives or labels mail, or keeps a listNo, and it tells you what it did
Opens a web address that neither you nor a page gave itYes
Adds, changes or deletes a calendar event, or saves a flowYes, for the exact event or script
Clicks a button that books, buys, pays, signs up or sendsYes
Reads a post on X, which costs X creditsYes
Sends an emailYes, for the exact email and the Google account it sends from
Runs a gws or xurl command, such as a post on XYes, for the exact command

A request stays open until you answer it. You can answer in any of the ways below, and Shrok then tells you how the action went.

text
1/yes 4 do request 4 once
2/no 4 don't do it
3/always 4 do it, and allow the same kind of action from now on
4 (an email only to the same recipients, a command only exactly the same)
5/grants list what you allowed with /always
6/revoke 2 take back the second item on that list

You can also react with 👍 or 👎 on a request, or quote it in a reply with "yes" or "no".

What you need

  • An API key from Anthropic or OpenAI.
  • SimpleX Chat on your phone.
  • A Mac with Apple silicon or Intel, or Linux on amd64 or arm64. On Linux, Shrok's sandbox needs user namespaces.

Install

WhereHowGuide
Macbrew tap bjoernaagaard/shrok, brew trust bjoernaagaard/shrok, then brew install shrokdocs/setup.md
Debian or Ubuntuthe .deb from the releases pagedocs/setup.md
Dockerghcr.io/bjoernaagaard/shrok with packaging/oci/compose.yamldocs/setup.md
Any Linux or Macthe portable archive from the releases pagedocs/setup.md

After you install Shrok, pair your phone with the command for your install in docs/pairing.md.

Where Shrok keeps your data

Everything Shrok knows is in one data folder, so a copy of the folder is a full backup. Shrok's tools can open only the workspace inside it.

text
1~/Library/Application Support/Shrok/ (on Linux, /var/lib/shrok)
2├── secrets.env your keys and settings, if you keep them here
3├── shrok.sqlite the conversation
4├── memory.sqlite what Shrok remembers of it
5├── approvals.sqlite requests and what you allowed with /always
6├── simplex/ the SimpleX keys that make Shrok your contact
7└── workspace/ the only folder Shrok's tools can open
8 ├── items/ links, files and notes you shared, as Markdown
9 ├── lists/ lists you keep, such as shopping
10 ├── flows/ saved scripts for tasks you repeat
11 └── skills/ your own how-to notes for Shrok

Settings

Shrok reads each setting from the environment first, and then from secrets.env in the data folder.

SettingWhat it doesDefault
ANTHROPIC_API_KEY or OPENAI_API_KEYThe model key. Shrok needs one of them.
SHROK_TIME_ZONEThe zone for schedules and calendar times, such as Europe/Copenhagenthe system's zone
SHROK_LOCALEThe language for dates, such as en-GBLC_ALL, LC_TIME or LANG, then the macOS region
SHROK_DATA_DIRWhere Shrok keeps its data/var/lib/shrok on Linux, ~/Library/Application Support/Shrok on macOS
SHROK_MODEL, SHROK_SMALL_MODEL, SHROK_CLASSIFIERThe models, written as provider/modelchosen by which key is set
SHROK_MCP_CONFIGAn mcp.json file that lists MCP serversmcp.json in the data folder
SHROK_BROWSERA Chromium binary to use instead of the bundled one
SHROK_LINKS_FILEA text file of links, one per line. Shrok saves each new link and tells you.

You can keep your keys in whatever way you like, because Shrok only needs them in its environment when it starts. Shrok looks for each key in the order below and uses the first one it finds.

text
1for each key, such as ANTHROPIC_API_KEY
2 1. the environment, which a secret manager such as secretspec, 1Password's op or bas can fill
3 2. the file that ANTHROPIC_API_KEY_FILE names, as with Docker secrets
4 3. a systemd credential with the same name
5 4. a line in secrets.env, which must be readable only by Shrok's user (chmod 600)

Plugins

You can add your own tools without changing Shrok. A plugin is a folder in the plugins folder of Shrok's data folder, with a plugin.ts that exports createPlugin and, if it has any, its own skills. Shrok loads every plugin when it starts, and it gives each one the API it builds on, so a plugin works the same with every kind of install.

text
1~/Library/Application Support/Shrok/plugins/
2└── fresha/
3 ├── plugin.ts export const createPlugin: CreatePlugin = (api) => ({ tools: [...] })
4 └── skills/fresha/SKILL.md

src/plugin-api.ts describes the API, and its CreatePlugin type checks a plugin's file. Only you can install a plugin, because Shrok's tools cannot write in the data folder. A plugin runs with Shrok's own rights, so install only code you trust. A plugin that fails to load is left out, and Shrok records why in its event log.

Guides

License

Shrok is free software under the GNU Affero General Public License 3.0.