No slash command · from flapi
Guides through flAPI installation, project scaffolding with `flapii project init`, and flapi.yaml configuration including connections, environment whitelisting, logging, CORS, and server flags. Use when starting a new flAPI project or wiring up data sources.
Ships in flapi. 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.
Read when SKILL.md points to them.
flAPI: v26.10.31 | Skill: Setup | See also: flapi-rest, flapi-mcp, flapi-auth, flapi-cache-design, flapi-deploy
project-name and template.path are required (project-description is optional,
default empty). Leave one out and startup fails with Missing required key: ....properties and in init resolve differently. A property value that starts
with ./ or ../ is resolved against the directory of flapi.yaml. A path inside init
SQL (ATTACH './data/x.sqlite' ...) is plain DuckDB SQL: it resolves against the
process's working directory. Run the server from the project directory or use absolute
paths in init. A SQLite ATTACH is lazy, so a wrong path shows up on the first request
(Unable to open database), not at startup.{{env.VAR}} only works for whitelisted names. template.environment-whitelist is a
list of regexes. An unlisted variable in any YAML file stops startup. A missing or
empty whitelist allows none. A top-level environment-whitelist: is rejected; it goes
under template:. ${VAR} is not supported.server: block and no MCP port. A server: key stops startup. Use the
top-level http-port / http-host (or -p, --host, FLAPI_PORT, FLAPI_HOST). MCP
runs on the same port at /mcp/jsonrpc. mcp.port / mcp.host only log a warning.init statement stops the server. All connections share one DuckDB
instance, and every init runs at startup. CREATE SECRET that cannot be validated, or an
ATTACH to an unreachable database, means no server, not one broken endpoint.debug | info | warning | error; warn is an alias of warning
(flag, FLAPI_LOG_LEVEL and config). An unknown log-level: in the config stops startup.rate-limit: (the
global key is rate_limit), port: or https:. Known keys that do nothing warn too
(server-name, connections.<n>.log-queries/log-parameters/allow, a request field's
field-type, storage: with a local template.path). Do not ignore these warnings.CREATE SECRET statements in init that
read whitelisted env vars. Prefer CREATE OR REPLACE SECRET (temporary). PERSISTENT
writes the secret to ~/.duckdb/stored_secrets. flAPI's DuckDB also loads every
persistent secret already stored there.flapi --version prints the build version (e.g. 26.10.31; a build from git
appends -<n>-g<sha>). A running server
reports the same in GET /api/v1/_config/health -> server.version.GOOGLE_* env vars are not applied to DuckDB (startup WARNING). Use an HMAC
CREATE SECRET (TYPE gcs, KEY_ID ..., SECRET ...) in a connection init.pip install flapi-io # ONE package with both commands: flapi (server) + flapii (CLI)
flapi --help
flapii --help
| Channel | What you get |
|---|---|
PyPI flapi-io | wheels for linux x86_64/aarch64, macOS arm64 and Windows x64. Each wheel holds both binaries. There is no separate flapii package. |
| GitHub release | flapi-linux-amd64.tar.gz, flapi-linux-arm64.tar.gz, flapi-macos-arm64.tar.gz, flapi-windows-amd64.zip (server only). |
| Docker | ghcr.io/datazoode/flapi:latest (the latest release), :v<version>, :v<version>-runtime (extensions pre-installed). See flapi-deploy. |
docker run -it --rm -p 8080:8080 -v "$PWD":/config ghcr.io/datazoode/flapi:latest -c /config/flapi.yaml
flapii project init my-api # or: flapii project init (current directory)
flapii project init my-api --force # overwrite existing files
flapii project init my-api --no-examples --skip-validation
The command creates flapi.yaml, sqls/sample.yaml, sqls/sample.sql, data/sample.csv,
common/auth.yaml, common/rate-limit.yaml and .gitignore. The sample endpoint
GET /sample reads ./data/sample.csv, which init also writes, so it answers 200 at once.
--advanced and --ai (needs a Gemini key) are also available.
Layout: flapi.yaml, sqls/customers.yaml, sqls/customers.sql, data/customers.parquet.
# flapi: config group=minimal
project-name: customers-api
project-description: Customers served from a Parquet file
template:
path: ./sqls
connections:
customers:
properties:
path: ./data/customers.parquet # resolved against this file's directory
# flapi: endpoint group=minimal file=customers.yaml
url-path: /customers
method: GET
request:
- field-name: segment
field-in: query
required: false
validators:
- type: enum
allowedValues: [AUTOMOBILE, BUILDING, FURNITURE, HOUSEHOLD, MACHINERY]
- field-name: id
field-in: query
required: false
validators:
- type: int
min: 1
template-source: customers.sql
connection: [customers]
# flapi: check GET /customers?segment=BUILDING -> 200
# flapi: check GET /customers?id=7 -> 200
# flapi: check GET /customers?segment=SPACE -> 400
# flapi: check GET /customers?id=0 -> 400
-- flapi: template group=minimal file=customers.sql
SELECT c_custkey, c_name, c_mktsegment, c_acctbal
FROM read_parquet('{{{ conn.path }}}')
WHERE 1=1
{{#params.segment}}
AND c_mktsegment = '{{{ params.segment }}}'
{{/params.segment}}
{{#params.id}}
AND c_custkey = {{ params.id }}
{{/params.id}}
ORDER BY c_custkey
flapi -c flapi.yaml --validate-config # never opens the database; exit 0 = valid
flapi -c flapi.yaml # serves on 0.0.0.0:8080
curl 'http://localhost:8080/customers?segment=BUILDING&limit=2'
# {"next":"...","total_count":...,"data":[{"c_custkey":...}, ...]}
Open http://localhost:8080/doc (Swagger UI) or /doc.yaml (OpenAPI). For endpoint design
(parameters, validators, pagination, {{ }} vs {{{ }}}), see flapi-rest.
./data/northwind.sqlite has the tables Products, Categories, Orders, Order Details,
Customers, Employees, Suppliers, Shippers, Territories and Regions.
# flapi: config group=northwind
project-name: northwind-api
project-description: Northwind products from SQLite
template:
path: ./sqls
connections:
northwind:
init: |
INSTALL sqlite;
LOAD sqlite;
ATTACH IF NOT EXISTS './data/northwind.sqlite' AS nw (TYPE sqlite, READ_ONLY);
# flapi: endpoint group=northwind file=products.yaml
url-path: /products
method: GET
request:
- field-name: category_id
field-in: query
required: false
validators:
- type: int
min: 1
max: 8
template-source: products.sql
connection: [northwind]
# flapi: check GET /products -> 200
# flapi: check GET /products?category_id=1 -> 200
# flapi: check GET /products?category_id=99 -> 400
-- flapi: template group=northwind file=products.sql
SELECT p.ProductID, p.ProductName, c.CategoryName, p.UnitPrice, p.UnitsInStock
FROM nw.Products p
JOIN nw.Categories c ON c.CategoryID = p.CategoryID
WHERE 1=1
{{#params.category_id}}
AND p.CategoryID = {{ params.category_id }}
{{/params.category_id}}
ORDER BY p.ProductID
flAPI runs one query at a time on any connection whose init attaches SQLite. This
avoids a read/write deadlock in the SQLite scanner. Override it with
serialize-access: true|false on the connection.
project-name: my-api # required
project-description: What it serves # optional
http-port: 8080 # -p / FLAPI_PORT win over this
http-host: 0.0.0.0 # --host / FLAPI_HOST win over this
log-level: info # debug | info | warning (or warn) | error
log-format: text # text | json (one JSON object per line)
template:
path: ./sqls # required; endpoint YAML + SQL, scanned recursively
environment-whitelist: # regexes for {{env.NAME}}; empty = none allowed
- '^PG_(HOST|PASSWORD)$'
connections:
warehouse:
init: | # DuckDB SQL run once at startup
INSTALL postgres;
LOAD postgres;
properties: # free-form; templates read {{{ conn.<key> }}}
schema: public
mcp:
enabled: true # served at /mcp/jsonrpc on http-port
cors:
allow-origins: [https://app.example.com] # no cors block = Access-Control-Allow-Origin: *
The duckdb: block (YAML; its keys are DuckDB settings passed through, so it is shown as text):
duckdb:
db_path: ./flapi.db # omit = in-memory
threads: 4 # any other key is passed to DuckDB as a setting
max_memory: 2GB
default-extensions: [httpfs, parquet, json] # default: httpfs ducklake fts json postgres sqlite parquet
Every key, with its default and its gotcha (including ducklake, heartbeat,
enforce-https, rate_limit, auth, audit, tracing and telemetry), is in
references/flapi-yaml.md.
A connection is a name, optional init SQL and optional properties. The endpoint lists it
in connection: [name], and the template reads its properties as conn.<key>. All init
blocks run in the same DuckDB, so a catalog attached in one connection is visible to
every endpoint.
| Source | Extension | How the template reads it |
|---|---|---|
| Parquet / CSV / JSON file, glob | parquet / built-in CSV / json | read_parquet('{{{ conn.path }}}'), read_csv(...), read_json(...) |
| SQLite | sqlite (default) | ATTACH ... (TYPE sqlite, READ_ONLY) in init, then nw.Table |
| DuckDB file | built-in | ATTACH ... (READ_ONLY); this locks the file against every other writer while the server runs. Written by another process: attach in the populate template + atomic rename (references) |
| Postgres | postgres (default) | CREATE SECRET (TYPE postgres ...) + ATTACH '' AS pg (TYPE postgres, SECRET ...) |
| MySQL | mysql (core, not a default) | CREATE SECRET (TYPE mysql ...) + ATTACH '' AS my (TYPE mysql, SECRET ...) |
| BigQuery | bigquery (community) | ATTACH 'project=<id>' AS bq (TYPE bigquery, READ_ONLY) |
| Snowflake | snowflake (community, needs the ADBC Snowflake driver on the host) | CREATE SECRET (TYPE snowflake ...) + ATTACH '' AS sf (TYPE snowflake, SECRET ...) |
| S3 / GCS | httpfs (default) | read_parquet('s3://...') / 'gs://...' + CREATE SECRET (TYPE s3 / gcs) |
| Azure Blob | azure (not a default) | read_parquet('az://...') + CREATE SECRET (TYPE azure ...) |
The full YAML for each recipe, with whitelisted env vars, is in references/connections.md.
flapi -c flapi.yaml # --config; default ./flapi.yaml (env FLAPI_CONFIG)
flapi -c flapi.yaml -p 9090 --host 127.0.0.1
flapi -c flapi.yaml --log-level debug # env FLAPI_LOG_LEVEL
flapi -c flapi.yaml --validate-config # check config + endpoints, exit
flapi -c flapi.yaml --config-service --config-service-token "$FLAPI_CONFIG_SERVICE_TOKEN"
flapi -c flapi.yaml --no-telemetry
flapi -c flapi.yaml --cache-warmup if-empty # always | if-empty | never (env FLAPI_CACHE_WARMUP)
flapi -c flapi.yaml --no-cache-warmup
Precedence is CLI flag > env var > flapi.yaml > default for the port, host, log level and
config path. An invalid FLAPI_PORT or log level exits with status 1.
Subcommands: flapi cache refresh, flapi extensions install, flapi pack, flapi info,
flapi unpack. See flapi-deploy and flapi-cache-tuning.
flapii (the CLI) talks to a running server's config service. Start the server with
--config-service. Then export FLAPI_CONFIG_SERVICE_TOKEN=<token> for the client (or
pass -t). The default base URL is http://localhost:8080 (-u, FLAPI_BASE_URL, or
FLAPI_URL when FLAPI_BASE_URL is unset). The server logs flAPI server listening on http://<host>:<port> (REST API; MCP at .../mcp/jsonrpc) once it has bound the port.
export FLAPI_CONFIG_SERVICE_TOKEN=dev-token-0123456789
flapi -c flapi.yaml --config-service &
flapii ping
flapii endpoints list
pip install flapi-io. Check with flapi --help and flapii --help.flapii project init my-api && cd my-api, or write flapi.yaml + sqls/ by hand
(see the minimal project above).INSTALL/LOAD/CREATE SECRET/ATTACH in init.
Read credentials as {{env.X}} and add each X to template.environment-whitelist.duckdb.default-extensions to what you use. Each default is installed (downloaded)
at startup when it is missing.flapi-rest).flapi -c flapi.yaml --validate-config until it reports no errors, and read every
warning.flapi -c flapi.yaml from the project directory, curl the endpoint, open /doc.flapii, restart with --config-service and export
FLAPI_CONFIG_SERVICE_TOKEN.flapi-auth), MCP tools (flapi-mcp), caching (flapi-cache-design),
shipping (flapi-deploy).What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub datazoode/flapi --plugin flapi10 skills in this plugin
/flapi-authSecuring flAPI: per-endpoint Basic auth with PBKDF2 hashes, bearer (HS256 JWT) auth, OIDC with provider presets (google, microsoft, keycloak, auth0, okta, github), roles and the auth context in SQL templates, MCP authentication and allowed-roles, OAuth protected-resource metadata, the config-service token, CORS, TLS (enforce-https) and the startup security warnings. Covers global auth inherited by every endpoint, opt-out, and REST roles (403). Use when a user asks to require a login or token, restrict who may call an endpoint or tool, debug a 401/403, or harden a deployment.
/flapi-cache-designDesigning flAPI DuckLake caches: how full refresh, incremental append and incremental merge are inferred from cursor / primary-key, writing the populate SQL (first-run CTAS bootstrap, watermark, late rows, overlap windows, soft and hard deletes), the serving template, warm-up modes and 503 cache_warming / cache_not_built / cache_build_failed, schedules and the scheduler, full rebuilds (--full), write-through (invalidate-on-write / refresh-on-write), read-only replicas on a shared catalog, prebuilt caches in CI, snapshots, retention and time travel. Use when a user wants to cache an endpoint, pick a refresh mode, write or debug a cache template, or serve a cache from several instances.
/flapi-cache-tuningMeasuring and shortening flAPI DuckLake cache refreshes: reading duration_ms and rows_affected from `flapii cache audit` and `flapii metrics`, tracing spans and DuckDB profiling, timing `flapi cache refresh`, then the levers: incremental instead of full, watermark predicate pushdown (verified with EXPLAIN), column projection, overlap window size, schedule vs refresh time, data inlining, compaction, snapshot retention and file cleanup, DuckDB threads and memory. Use when a cache refresh is slow, overlaps its schedule, grows storage, or a user asks how to make cache updates faster or cheaper.
/flapi-deployShipping a flAPI project to production: self-packaging into one binary (`flapi pack`, `info`, `unpack`, embed:// data, bundled extensions, reproducible builds), offline DuckDB extensions, the Docker images (slim and -runtime), Cloud Run and other scale-to-zero platforms, Kubernetes probes, read-only DuckLake replicas, the PyPI wheel, environment variables and a production checklist (config service, auth, JSON logs, telemetry opt-out). Use when someone packages, containerises, deploys or hardens a flAPI server.
/flapi-live-configManaging a running flAPI server: the config service (`--config-service`, its token, `FLAPI_CONFIG_SERVICE_TOKEN`, `X-Config-Token`), the full `flapii` command map and global options, the REST routes under /api/v1/_config, the `flapi_*` MCP config tools (including flapi_get_metrics), hot reload and what it does not pick up, schema introspection, runtime log level, and the plugin's validate-and-reload hook. Use when a user wants to list, inspect, edit, reload or test endpoints, templates and caches on a live server, run flapii, or script the config API.
/flapi-mcpExposing flAPI endpoints to AI agents over MCP: `mcp-tool` (name, description, result-mime-type, allowed-roles, response shaping, rate-limit, async / async-after-ms), `mcp-resource`, `mcp-prompt`, how request fields become the tool input schema, writing descriptions an agent can act on, the description scanner, dry-run, sessions, async tasks, the top-level `mcp:` block and server instructions. Covers connecting Claude Code, Claude Desktop and other clients and calling tools/list and tools/call with curl. Use when a user wants an MCP tool, resource or prompt, needs an agent to call their SQL, or an MCP call misbehaves.
Other plugins' skills for the same job