/qfs:qfs-faqfrom qfs
Use when answering an operator "how do I…" or troubleshooting question about qfs — connecting an account (Gmail, Drive, GitHub, Slack, S3/R2, SQL, git), adding a second or different-organization Google account, the describe→preview→commit safety loop, common errors (unknown source, org_internal / access blocked, the irreversible gate), exit codes, and which per-service skill to route a task to.
Ships in qfs. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Straight answers to the questions an operator actually asks — "how do I add a Drive connection for
another account?", "why is my Google sign-in blocked with org_internal?", "what does PREVIEW
mean, and how do I actually apply a change?" Every answer maps to a qfs command; nothing here
requires reading qfs source. For the full recipe set on any one service, jump to its cookbook
(the routing index is at the bottom).
qfs runs the same loop for every task, so most "how do I…" questions reduce to it:
qfs describe /drive — to learn its columns, verbs, and procedures. Runs
offline, no credentials, no network.qfs run "<statement>" shows the exact effect plan and changes nothing.--commit to apply it (--commit-irreversible for the ones that can't be
undone).A read returns rows the moment the source is connected. A write (insert, update,
upsert, remove, call) previews by default and touches nothing until you --commit.
Reaching a cloud service (Gmail, Drive, GitHub, Slack, S3/R2) takes three one-time steps.
/local, /sys, and local files need none of them; a local SQL file or git repo needs only the
mount (no secret).
qfs init once per machine creates the encrypted credential store (it
walks you through choosing the passphrase) and registers the operator. There is no password: your
OS login is the authentication, the email is an accountability label.qfs account add <provider> seals the account's token into the vault
and records your consent. qfs refuses a cloud account add until qfs init has run.qfs connect <path> --driver <driver> --account <label> binds that account to a
path you choose. A cloud path exists only after a connect.Gmail, Drive, and Google Analytics can share one Google account consent. Register a labeled OAuth app, authorize the account through that app, then mount each service where you want it:
qfs init [email protected] # ready the machine (once)
cat credentials.json | qfs app add google qmu # your OAuth app's client credentials (once)
qfs account add google --app qmu # paste-back browser consent; token sealed, never printed
qfs connect /mail --driver gmail --account [email protected] # mount Gmail at /mail
qfs connect /drive --driver gdrive --account [email protected] # mount Drive at /drive
qfs account add google --app qmu prints a URL — open it in your local browser, approve, and paste the
redirect URL back (this works over plain SSH). To provision a refresh token out of band instead of
the browser flow, pipe it on stdin with the email as the label:
printf %s "$REFRESH_TOKEN" | qfs account add google [email protected] --app qmu
After connecting, qfs describe /drive shows the schema and verbs, and qfs connect --list shows
the mount. See the Gmail and Google Drive cookbooks
for the read/write recipes.
The mount carries the account — there is no "active" account and no command that switches one. A second account is simply a second mount at a second path:
qfs connect /drive --driver gdrive --account [email protected] # your Drive
qfs connect /work/drive --driver gdrive --account [email protected] # a second Drive, side by side
Both mounts coexist in the same process; every /drive/… recipe works verbatim as /work/drive/….
Remove a mount with qfs disconnect /work/drive (idempotent).
OAuth apps are labeled. Multiple Google app registrations can coexist, such as
qmuandclient-a. Authorize each Google account with the app that should mint or service its consent, then mount paths against the account label.
For a non-Google service, pipe the credential value on stdin — never on argv, where it leaks into shell history and the process table — then mount the path:
printf %s "$GH_TOKEN" | qfs account add github work # GitHub personal-access token
printf %s "$SLACK_TOKEN" | qfs account add slack team # Slack bot/user token
printf %s "$AWS_SECRET_ACCESS_KEY" | qfs account add objstore prod # S3/R2 secret access key
qfs connect /github --driver github --account work
qfs connect /slack --driver slack --account team
qfs connect /s3 --driver s3 --account prod
qfs account list shows the labels and metadata only, never a secret. A local SQLite file or
git repo stores no secret, so it needs only a mount — the in-language CONNECT statement (no
ACCOUNT clause):
CONNECT /db TO sqlite AT 'file:app.db'
Every qfs connect / qfs account add has a query-language twin, so a connection can live in a
script or a server config instead of a shell command. CONNECT binds a path (the ACCOUNT clause
names the account label; the optional HOST names which qfs host owns the mount), and
CREATE ACCOUNT records consent in the language:
CONNECT /mail TO gmail ACCOUNT '[email protected]' APP 'qmu' HOST 'local'
CREATE ACCOUNT google '[email protected]' APP 'qmu'
org_internal — a different-organization Google accountSymptom. Authorizing a Google account fails in the browser with "アクセスをブロック … 組織内で
のみ利用可能です" / "Error 403: org_internal", or the consent screen refuses the account
outright.
Cause — this is a Google OAuth configuration, not a qfs bug. Your OAuth app's consent screen is
set to Internal, so only users inside the Workspace organization that owns the app may
authorize it. An account that lives in a different organization (a client's domain) is refused
before qfs ever sees a token. org_internal is Google's error string; qfs never emits it.
Fixes, ranked.
cat credentials.json | qfs app add google client-a, then authorize with
qfs account add google [email protected] --app client-a./drive/shared.Option 1 is usually the least disruptive. Option 3 avoids the OAuth question altogether when you only need a few shared items.
describe is offline; preview is side-effect-free but still requires a routed path. A compiled
path such as /mail/drafts can be described without a connection, because that reports the shipped
schema. Evaluating a write must resolve its target through an installed mount. On a fresh host the
mail write therefore refuses with unrouted_path (exit 3), even without --commit:
qfs describe /mail/drafts --json | jq .verbs
qfs run "insert into /mail/drafts values ('[email protected]', 'Hi', 'Body text')"
To exercise the preview gate with no service credentials, use the built-in routed /sys surface:
qfs run "insert into /sys/policies values (name, allow) ('preview-example', 'ALLOW INSERT')"
That command prints a PREVIEW and creates nothing:
PREVIEW: 1 effect(s)
#0 INSERT -> sys:/sys/policies [affected 1]
total affected: 1
A cloud write preview also performs no network request or credential resolution, but its mount must
already exist. Authorize the account and run qfs connect /mail --driver gmail --account <label>
before previewing the mail example.
Apply it with --commit. Actions that can't be undone (sending mail, merging a PR, trashing a
file) need a second acknowledgement in a one-shot — --commit alone is refused, fail-closed:
qfs run "insert into /mail/drafts values ('[email protected]', 'Hi', 'Body')" --commit
qfs run "/mail/drafts |> call mail.send" --commit --commit-irreversible
Output formats. qfs prints the human table on a terminal and JSON when piped (so it composes with other tools). Force either explicitly:
qfs run "/mail/inbox |> select date, subject" --format table # always the table
qfs run "/mail/inbox |> select date, subject" --json # always JSON
Warm the session so repeated commands don't re-prompt for the passphrase (default 8h window);
qfs auth --lock drops it again:
qfs auth
qfs auth --lock
A declared driver (/chatwork, /cloudflare, /slack) is installed by committing its
statements to /sys/drivers, and from then on the installed rows are the driver — the shipped
file is never read again. So when a shipped declaration is corrected in a later qfs release, your
installation keeps running the old text. Ask which of yours are behind:
/sys/declarations
One row per installed declaration, with a three-value status:
status | Meaning | What to do |
|---|---|---|
current | Your installation matches the declaration this binary ships | Nothing |
stale | It names a shipped declaration and differs from it | Re-install the statements named in differs (an ordinary preview → --commit) |
local | You authored this declaration yourself — nothing shipped declares that name | Nothing. local is not "out of date"; there is no shipped counterpart to be behind |
shipped names the asset compared against (chatwork.qfs), and differs lists the statements that
disagree — so a stale row tells you which CREATE … to re-run, not just that something moved. To
see only what needs attention:
/sys/declarations |> where status == 'stale'
The check is local and offline: it compares your rows against the declaration text embedded in
your own qfs binary, so it resolves with no network and no credentials. Nothing is upgraded for
you — re-installing is an ordinary previewed-and-committed write you choose to make, because a
declaration you edited on purpose must not be silently overwritten (blueprint §13.4).
qfs declareThe statements come from the binary itself, so the refresh needs no download and no copy-paste:
qfs declare # what this binary ships, and how many statements each one writes
qfs declare slack # list them — writes nothing
qfs declare slack --commit # install / refresh
Re-installing replaces: a declaration's identity is (kind, name, verb), and the superseded row
is deleted in the same transaction the new one lands in, so running it twice is safe. Each statement
goes through the same one-shot path qfs run takes, and the first failure stops the run and returns
its exit code — a half-installed declaration is reported where it stopped, never summarised as done.
It adds and replaces; it never removes. Nodes you added locally that the binary does not ship
stay exactly as they are — which is why a declaration carrying local extras still reads stale
after a successful --commit. That is a local addition, not a failed install; drop one with
REMOVE VIEW|MAP|TYPE <name> if you want the row gone.
Upgrading the binary does not update a declaration. Config and code move independently, so a
current binary can run a declaration years older than it — the shape behind a Slack mount that could
list attachments and not read one. After any upgrade, qfs run "/sys/declarations |> select driver, status" is the one question worth asking.
| You see | What it means | Fix |
|---|---|---|
unknown source \mail` (kind: capability`) | The path is not connected — cloud sources fail closed, never return empty rows | qfs account add <provider> then qfs connect <path> --driver <driver> --account <label> |
connect a Google account to read mail | The path resolved but there is no signed-in operator or recorded consent yet | Run qfs init, register an app with qfs app add google <app>, then qfs account add google --app <app> |
| A write "affected 1" but nothing changed | You saw a PREVIEW — writes change nothing without --commit | Re-run with --commit |
--commit of a send/remove is refused | The plan is irreversible and a one-shot needs the explicit extra ack | Add --commit-irreversible |
An auth error resolving a secret | The vault is locked, or the account's credential was revoked | qfs auth to unlock; qfs account rotate <provider> <label> to re-mint |
`where` names column 'nope', which this relation does not carry (code: unknown_column, kind: usage, exit 2) | A stage named a column the relation has no such thing as. This is not "nothing matched" — a typo now refuses instead of quietly answering zero rows, so the two are distinguishable. where, expand and select all refuse it, on every source: the same statement refuses identically whether the driver runs the projection natively (/sql) or qfs runs it locally | qfs describe <path> and use a real column; the message lists the available ones |
`select` names column 'nope', which this relation does not carry (code: unknown_column, kind: usage, exit 2) | A projection named a column the relation does not carry. It used to be dropped, so |> select nope answered the row count with an empty schema — rows of {} at exit 0. Every spelling of the projection refuses alike: naming the column (select nope), renaming it (select nope AS x), or building a value from it (select {n: nope} AS s) — the renaming forms used to answer one null per row instead. select * (and no select at all) still means every column, and extend/set keep resolving an absent column to null | qfs describe <path> for the column list, or drop the stage |
`expand` cannot explode column 'path': it is a scalar (text), not an array or a struct (code: not_expandable, kind: usage, exit 2) | expand was pointed at a column that carries no nested rows to explode | qfs describe <path> and expand an array or struct column instead |
Exit codes are stable so an agent can branch on them:
| Code | Meaning |
|---|---|
0 | success — rows rendered, or a PREVIEW shown |
2 | a malformed question — a parse error, a CLI usage error (a relative path, a bad flag), or a stage naming something the relation does not have |
3 | capability — unknown source, or a verb the path does not support |
4 | a destructive set-wide plan was previewed without --commit |
5 | an effect failed to apply during commit |
6 | auth / credential failure resolving or using a secret |
The JSON error envelope carries a stable code and kind alongside the message, e.g.
{"error":{"code":"unknown_source","kind":"capability","message":"unknown source \mail`"}}`.
One line each — route "how do I read/write X" to the service's own skill:
qfs-gmailqfs-gdriveqfs-databasesqfs-filesqfs-gitqfs-githubqfs-slackqfs-cross-serviceqfs-automationWhat SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
14 skills in this plugin
/qfsUse when the user asks to use QFS or its connected services. Discover the live connections and available paths before reading or writing through the qfs CLI; covers pipe-SQL, preview, and commit. For Slack channel discovery and threads, also read qfs-slack./qfs-automationUse when a task needs the qfs SERVER side — scheduled jobs, triggers, HTTP endpoints, and cached views created with CREATE bindings over queries you already write./qfs-chatworkUse when a task needs Chatwork through qfs — installing and querying the DECLARED /chatwork driver (rooms, a room's latest messages, a room's unread messages, room file listings, file download, and file upload) written in the query language itself, and posting a message to a room. Covers installing the chatwork.qfs declaration, connecting it to a stored Chatwork API token, reading the latest messages versus the unread-only ones, posting a message via ENCODE form, downloading a file's bytes via the FOLLOW stage, and uploading via ENCODE multipart./qfs-cloudflareUse when a task needs Cloudflare through qfs — installing and querying the DECLARED /cloudflare driver (zones, DNS records, account-scoped KV/Queues/D1 listings, plus D1 SQL, KV get/put, queue push and queue pull) written in the query language itself. Covers installing the cloudflare.qfs declaration, connecting it to the stored Cloudflare token, reading, consuming a queue with the read-over-POST pull view, and the declared D1 SQL surface. For Artifacts Git repositories use the compiled /cf driver instead./qfs-cookbookUse for an overview of what qfs can do and which qfs cookbook skill fits a task — reading, searching, transforming, or writing across Gmail, Google Drive, databases, files, git, GitHub, Slack, and automation with one pipe-SQL language. Routes to the per-service skills./qfs-cross-serviceUse when a task spans MORE THAN ONE service in a single qfs query — joining a database to GitHub, a file to a table, or federating several services with one JOIN or UNION over their paths.npx claudepluginhub qmu/qfs --plugin qfs