feat(fmodata): add fmodata CLI binary#128
Open
chriscors wants to merge 1 commit intoproofgeist:mainfrom
Open
Conversation
Adds a non-interactive CLI (`fmodata`) to the @proofkit/fmodata package, making every OData operation available from the shell for use in scripts, CI pipelines, and one-off database tasks. ## What's included ### Binary & build - New `fmodata` binary entry in package.json → `dist/cli/index.js` - `tsdown.config.ts` for bundling the CLI separately from the library - Build script updated: `tsc && vite build && tsdown && publint --strict` ### Commands implemented - `query list/insert/update/delete` — CRUD via raw OData requests with `--top`, `--skip`, `--select`, `--where`, `--order-by` options - `script run <name>` — execute FileMaker scripts with optional `--param` - `webhook list/get/add/remove` — full webhook lifecycle management - `metadata get/tables` — retrieve OData metadata (JSON or XML) - `schema list-tables/create-table/add-fields` — DDL operations with a `--confirm` flag; without it the command is a safe dry-run ### Connection - All commands accept `--server`, `--database`, `--username`, `--password`, `--api-key` flags with automatic env var fallbacks (`FM_SERVER`, `FM_DATABASE`, `FM_USERNAME`, `FM_PASSWORD`, `OTTO_API_KEY`) - API key takes precedence over username/password when both are set ### Output - JSON by default; `--table` flag renders results as ASCII table via cli-table3 - Errors go to stderr; non-zero exit code on failure ### Tests (859 passing, 0 type errors) - `tests/cli/unit/` — connection env-var resolution and output formatting - `tests/cli/commands/` — per-command happy-path and error tests - `tests/cli/integration/` — verifies built binary and `--help` output - `tests/cli/e2e/` excluded from default runs; run with `test:cli:e2e` ### Docs - New `apps/docs/content/docs/fmodata/cli.mdx` with full command reference, connection options table, CI integration examples, and dry-run guidance - Added to fmodata nav under a new `---CLI---` section Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
@chriscors is attempting to deploy a commit to the Proof Geist Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a non-interactive
fmodataCLI binary to@proofkit/fmodata, making every OData operation scriptable from the shell — useful for CI pipelines, automation, and quick one-off database operations.packages/fmodatapackage--confirmflag; without it they dry-runCommands
fmodata query list--top,--skip,--select,--where,--order-by)fmodata query insert--data <json>)fmodata query update--data,--where)fmodata query delete--where)fmodata script run <name>--param)fmodata webhook list/get/add/removefmodata metadata getfmodata metadata tablesfmodata schema list-tablesfmodata schema create-table--confirm)fmodata schema add-fields--confirm)Connection
All commands share the same global flags with env var fallbacks:
API key takes precedence over username/password when both are provided.
Output
--tableflag renders an ASCII table viacli-table3Implementation details
Files added
package.jsonchanges"bin": { "fmodata": "dist/cli/index.js" }tsc && vite build && tsdown && publint --stricttest:cli:e2escript for E2E tests against a real FM servercommanderto dependencies;tsdownandcli-table3to devDependenciesvitest.config.tschangetests/cli/e2e/**added to the exclude list (run separately viatest:cli:e2e)Testing
Documentation
Full reference docs added at
apps/docs/content/docs/fmodata/cli.mdx, covering:🤖 Generated with Claude Code