FileMaker Data API CLI for LLMs.
- Python 3.12+
- Access to GitHub (
gh auth logincompleted or SSH configured)
If uv is installed, you can install with a single command:
uv tool install git+https://github.com/HosakaKeigo/fmcli.gitpipx install git+https://github.com/HosakaKeigo/fmcli.git# uv tool
uv tool upgrade fmcli
# pipx
pipx upgrade fmcli# uv tool
uv tool uninstall fmcli
# pipx
pipx uninstall fmclifmcli --help# Configure connection via interactive wizard
fmcli auth config
# Login
fmcli auth login# 1. Check field names (always run before searching)
fmcli schema find-schema -l 'LayoutName'
# 2. Search records
fmcli record find -l 'LayoutName' -q '{"FieldName":"value"}'
# 3. Check field types and attributes as needed
fmcli layout describe -l 'LayoutName'fmcli supports the following environment variables, used as fallbacks when command-line options are not specified.
| Variable | Description | Example |
|---|---|---|
FMCLI_HOST |
FileMaker Server host URL. Used when --host is not specified |
https://fm.example.com |
FMCLI_DATABASE |
Database name. Used when -d is not specified and FMCLI_HOST is set |
MyDatabase |
FMCLI_ALLOW_INSECURE_HTTP |
Set to 1 or true to allow HTTP connections. Used when --allow-insecure-http is not specified |
1 |
NO_COLOR |
Disables color output when set (no-color.org compliant) | 1 |
XDG_CONFIG_HOME |
Base directory for config files. Defaults to ~/.config |
~/.config |
XDG_CACHE_HOME |
Base directory for cache files. Defaults to ~/.cache |
~/.cache |
Profiles (connection targets) are resolved in the following order:
--host+-d(command-line options)FMCLI_HOST+FMCLI_DATABASE(environment variables)- Default profile (
default_profile_keyin~/.config/fmcli/config.json)
| Path | Contents |
|---|---|
$XDG_CONFIG_HOME/fmcli/config.json |
Default profile configuration |
$XDG_CONFIG_HOME/fmcli/profiles/ |
Profile files (per host/database) |
$XDG_CACHE_HOME/fmcli/ |
Cache |
All commands output in Envelope format. The default is JSON (stdout), with errors sent to stderr. Use --format table to display list data as tables (unsupported data types automatically fall back to JSON).
{
"ok": true,
"command": "record find",
"profile": "https://fm.example.com|MyDatabase",
"database": "MyDatabase",
"layout": "Customers",
"data": [ ... ],
"pagination": {
"offset": 1,
"limit": 100,
"total_count": 42
},
"messages": [],
"api": {
"method": "POST",
"url": "https://fm.example.com/fmi/data/vLatest/databases/MyDatabase/layouts/Customers/_find",
"duration_ms": 234.5
}
}{
"ok": false,
"command": "record find",
"error": {
"type": "api_error",
"message": "FileMaker API error: Layout not found (api_code: 105)",
"http_status": 500,
"api_code": 105,
"retryable": false,
"hint": "Check layout name: fmcli layout list",
"host": "https://fm.example.com",
"database": "MyDatabase"
}
}| Field | Type | Description |
|---|---|---|
ok |
bool |
true on success, false on error |
command |
string |
Executed command name (e.g., record find) |
profile |
string |
Profile key used |
database |
string |
Target database name |
layout |
string |
Target layout name |
data |
any |
Command result data |
pagination |
object|null |
Pagination info (offset, limit, total_count) |
api |
object|null |
API call info (method, url, duration_ms) |
messages |
string[] |
Messages from FileMaker Server |
script_results |
object|null |
Script execution results (if applicable) |
error |
object|null |
Error details (only when ok: false) |
| Code | Meaning |
|---|---|
0 |
Success |
1 |
General error |
41 |
Authentication error |
42 |
Input error |
43 |
Transport error |
44 |
FileMaker API error |
51 |
Configuration error |
52 |
Resource not found |
130 |
User interrupt (Ctrl+C) |
fmcli supports shell completion. Use the following commands to set up completion for your shell:
# Install completion (auto-detects bash / zsh / fish / PowerShell)
fmcli --install-completion
# Show completion script (for manual setup)
fmcli --show-completionAfter installation, restart your shell to enable completion. Supports completion for command names, option names, layout names, host names, and database names.
To use the FileMaker Data API, the fmrest extended access privilege must be enabled on the FileMaker Server side.
- Open the target file in FileMaker Pro
- Go to File > Manage > Security
- Add fmrest to the extended access privileges for the target privilege set
- Verify the file is hosted on FileMaker Server Admin Console
If fmrest is not enabled, the following error is returned:
API error code 959: FileMaker Data API is disabled. Contact your server administrator.
fmcli requires HTTPS connections by default. To allow HTTP connections (e.g., in development environments), use one of the following:
# Command-line option
fmcli auth login --host http://localhost --allow-insecure-http
# Environment variable
export FMCLI_ALLOW_INSECURE_HTTP=1Warning: Always use HTTPS in production environments. HTTP connections transmit passwords and session tokens in plain text.
FileMaker Data API sessions expire after 15 minutes of inactivity by default. fmcli detects expired sessions and automatically attempts re-authentication using credentials stored in the keyring.
- Auto-refresh requires: Password saved to keyring during
fmcli auth login - Manual re-authentication: Run
fmcli auth loginagain
| API Code | Meaning | Solution |
|---|---|---|
100 / 101 |
Record not found | Verify the record ID |
105 |
Layout not found | Check layout name with fmcli layout list |
401 |
Field not found | Check field name with fmcli schema find-schema -l <layout> |
402 |
No records match the query | Review your query |
952 |
Session expired | Auto-refreshes if keyring is configured. Manual: fmcli auth login |
953 |
Invalid session | Re-login with fmcli auth login |
954 |
Max concurrent connections | Wait and retry |
958 |
Data API license error | Check FileMaker Server configuration |
959 |
Data API disabled | Contact server administrator |
If you cannot connect, verify the following:
- Host name and port are correct:
fmcli auth status - FileMaker Server is running
- Port 443 (HTTPS) is open in the firewall
A skill is included for using fmcli with Claude Code, providing automatic command reference.
Using Vercel Skills:
npx skills add https://github.com/HosakaKeigo/fmclinpx skills update https://github.com/HosakaKeigo/fmcli# Copy the .claude/skills from the repository to ~/.claude/skills
cp -r .claude/skills/fmcli-guide ~/.claude/skills/fmcli-guideOnce installed, Claude Code will automatically reference the correct commands and options when working with fmcli.
git clone https://github.com/HosakaKeigo/fmcli.git
cd fmcli
uv syncuv run ruff check . # lint
uv run ruff format --check . # format check
uv run mypy src # type check
uv run pytest -q # test