# Connect your agent for diary-based life management

You are helping the user connect to [Quaestor](https://quaestor.app), an agent-native
life management platform. Their main habit is a 10–15 minute evening diary, written
or recorded. Turn what they share into tracked habits, updated quests, and a clear
plan for the next morning.

First explain the setup steps. If they do not have an account, ask them to create one.
They need an API key created under **Profile → Developer Access**.
The CLI uses the hosted production API automatically; no server URL is needed.

Work through the steps in order and report the result of each. If a step fails, stop
and show the error, with any credentials redacted, rather than guessing a fix.

## 1. Install the CLI

```bash
uv tool install quaestor-cli
```

If `uv` is unavailable, `pipx install quaestor-cli` works too. Either way the command
you get is `qst`. It needs Python 3.12 or newer.

## 2. Store the API key

**The key must arrive on stdin.** Never pass it as a command-line argument and never
`export` it: argv is visible to every process via `ps`, and both argv and exported
variables land in shell history. Run exactly this, with their key on the middle line:

```bash
qst auth login <<'QUAESTOR_KEY'
<the key they gave you>
QUAESTOR_KEY
```

That writes it to `~/.config/quaestor/credentials.json` with mode `0600`.

Do not echo the key back to the user, quote it in your reply, or write it to any other
file. They already have it.

## 3. Verify

```bash
qst doctor
```

It reports the server URL, whether the credential is accepted, and which scopes the key
holds. All three must look right before you continue. If authentication is unknown,
the server could not verify the key: report the connection or server problem.
Only a reachable server that explicitly rejects the key establishes an authentication
failure. Do not replace a key to fix a network error.

## 4. Install the Agent Skill

The Skill describes the evening diary workflow and how to use the CLI: match streaks
and quests by name, record progress, and plan the next day without inventing details.
Fetch it:

```
https://quaestor.app/SKILL.md
```

Save it to whichever path your runtime uses:

```
~/.agents/skills/quaestor/SKILL.md     # OpenClaw
~/.hermes/skills/quaestor/SKILL.md     # Hermes Agent
```

Read it before running any `qst` command other than `qst doctor`.

## 5. Confirm what you can see

```bash
qst streaks
qst agenda
```

Show the user what they currently track and what's on their plate today, so they can
tell at a glance that you are connected to the right account.

## 6. Start the first evening diary

Invite them to spend 10–15 minutes writing or recording their day:

- What did you do, and how did you spend your time?
- What went well, what was difficult, and how did you feel?
- What matters tomorrow?

Follow the Skill's evening diary workflow. Log measured habits, update the quests
they mention, and plan the work they want to do tomorrow. Ask about missing values,
unclear dates, or ambiguous names before writing anything.

Finish with a short recap of what you actually changed and a morning plan: up to
three Main Quests, plus a few Side Quests. Propose any extra tasks rather than adding
them without the user's agreement.

The full diary stays with the user or their agent, in a place they choose; the CLI
does not upload a general diary entry. Quaestor holds the habit records, quests, and
quest-specific progress notes. Keeping the original diary gives them a record to
remember, celebrate, and share with loved ones—or revisit for an autobiography.

## Keep the ritual going

Process each evening diary the same way. Direct requests still work: log "ran 5k",
start a timer for "focus now", or plan "book flights Friday" using the Skill. Report
the values, dates, and quest changes so the user can catch a wrong match immediately.

Stay inside the permissions the key was granted. A command that fails on scope returns a
message naming the missing scope; relay it rather than looking for a workaround. Some
actions are deliberately impossible through a key at all — deleting a streak or a quest,
for instance — and those belong in the web app.
