UNPKG

@fragment-dev/cli

Version:
977 lines 31 kB
{ "commands": { "start": { "aliases": [], "args": {}, "description": "Develop your chart of accounts locally", "examples": [ "<%= config.bin %> <%= command.id %> --file ./my-fragment-schema.json" ], "flags": { "port": { "char": "p", "description": "Port for schema visualizer to run on", "name": "port", "required": false, "default": 9410, "hasDynamicHelp": false, "multiple": false, "type": "option" }, "file": { "char": "f", "description": "Path for schema JSON file. Default to fragment.jsonc", "name": "file", "required": false, "default": "fragment.jsonc", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "websocket-port": { "description": "Port for the websocket to live on that syncs changes between the CLI and visualizer", "name": "websocket-port", "hasDynamicHelp": false, "multiple": false, "type": "option" } }, "hasDynamicHelp": false, "hiddenAliases": [], "id": "start", "pluginAlias": "@fragment-dev/cli", "pluginName": "@fragment-dev/cli", "pluginType": "core", "strict": true }, "update": { "aliases": [], "args": {}, "description": "Update the FRAGMENT CLI", "examples": [ "<%= config.bin %> <%= command.id %>" ], "flags": { "yes": { "char": "y", "name": "yes", "allowNo": false, "type": "boolean" }, "dry-run": { "name": "dry-run", "required": false, "allowNo": false, "type": "boolean" } }, "hasDynamicHelp": false, "hiddenAliases": [], "id": "update", "pluginAlias": "@fragment-dev/cli", "pluginName": "@fragment-dev/cli", "pluginType": "core", "strict": true }, "login": { "aliases": [], "args": {}, "description": "Authentication is scoped to one FRAGMENT Workspace.\n If you want to authenticate with another Workspace, you must create another API Client and follow the authentication flow again.\n Credentials will be written to ~/.fragment/auth.json.", "examples": [ "<%= config.bin %> <%= command.id %>", "<%= config.bin %> <%= command.id %> --client-id <client-id> --client-secret <client-secret> --api-url <api-url> --oauth-url <oauth-url>" ], "flags": { "client-id": { "description": "The API Client ID for your FRAGMENT Workspace.", "name": "client-id", "required": false, "hasDynamicHelp": false, "multiple": false, "type": "option" }, "client-secret": { "description": "The API Client Secret for your FRAGMENT Workspace", "name": "client-secret", "required": false, "hasDynamicHelp": false, "multiple": false, "type": "option" }, "api-url": { "description": "The API URL for your FRAGMENT Workspace (ex: https://api.us-west-2.fragment.dev/graphql)", "name": "api-url", "required": false, "hasDynamicHelp": false, "multiple": false, "type": "option" }, "oauth-url": { "description": "The OAuth URL from which to retrieve your auth token (ex: https://auth.fragment.dev/oauth2/token)", "name": "oauth-url", "required": false, "hasDynamicHelp": false, "multiple": false, "type": "option" }, "oauth-scope": { "description": "The OAuth Scope for your auth token (ex: https://api.us-west-2.fragment.dev/*)", "name": "oauth-scope", "required": false, "hasDynamicHelp": false, "multiple": false, "type": "option" }, "test": { "description": "If set, tests stored credentials only", "name": "test", "required": false, "allowNo": false, "type": "boolean" } }, "hasDynamicHelp": false, "hiddenAliases": [], "id": "login", "pluginAlias": "@fragment-dev/cli", "pluginName": "@fragment-dev/cli", "pluginType": "core", "strict": true, "summary": "Authenticate with FRAGMENT.", "help": "Create an API client at dashboard.fragment.dev/api-clients" }, "token": { "aliases": [], "args": {}, "examples": [ "<%= config.bin %> <%= command.id %>" ], "flags": { "verbose": { "char": "v", "description": "Enable verbose mode (prints GraphQL commands).", "name": "verbose", "allowNo": false, "type": "boolean" } }, "hasDynamicHelp": false, "hiddenAliases": [], "id": "token", "pluginAlias": "@fragment-dev/cli", "pluginName": "@fragment-dev/cli", "pluginType": "core", "summary": "Get a FRAGMENT Authentication Token.", "help": "Create an API client at dashboard.fragment.dev/api-clients" }, "workspace": { "aliases": [], "args": {}, "description": "Get the details of the workspace this CLI is authenticated to", "examples": [ "<%= config.bin %> <%= command.id %>" ], "flags": { "verbose": { "char": "v", "description": "Enable verbose mode (prints GraphQL commands).", "name": "verbose", "allowNo": false, "type": "boolean" } }, "hasDynamicHelp": false, "hiddenAliases": [], "id": "workspace", "pluginAlias": "@fragment-dev/cli", "pluginName": "@fragment-dev/cli", "pluginType": "core", "help": "Get the details of the workspace this CLI is authenticated to" }, "init": { "aliases": [], "args": {}, "description": "Initialize an example chart of accounts locally", "examples": [ "<%= config.bin %> <%= command.id %>" ], "flags": { "file": { "char": "f", "description": "Path to write initial schema to", "name": "file", "required": false, "default": "fragment.jsonc", "hasDynamicHelp": false, "multiple": false, "type": "option" } }, "hasDynamicHelp": false, "hiddenAliases": [], "id": "init", "pluginAlias": "@fragment-dev/cli", "pluginName": "@fragment-dev/cli", "pluginType": "core", "strict": true }, "store-schema": { "aliases": [], "args": {}, "description": "Store schema within your Fragment workspace", "examples": [ "<%= config.bin %> <%= command.id %>" ], "flags": { "verbose": { "char": "v", "description": "Enable verbose mode (prints GraphQL commands).", "name": "verbose", "allowNo": false, "type": "boolean" }, "path": { "char": "p", "description": "Path to schema file (e.g. fragment.jsonc)", "name": "path", "default": "fragment.jsonc", "hasDynamicHelp": false, "multiple": false, "type": "option" } }, "hasDynamicHelp": false, "hiddenAliases": [], "id": "store-schema", "pluginAlias": "@fragment-dev/cli", "pluginName": "@fragment-dev/cli", "pluginType": "core" }, "verify-schema": { "aliases": [], "args": {}, "description": "Verify that a schema file follows the Fragment JSON schema format", "examples": [ "<%= config.bin %> <%= command.id %>", "<%= config.bin %> <%= command.id %> --path ./my-schema.jsonc", "<%= config.bin %> <%= command.id %> -p fragment/fragment.json --verbose", "<%= config.bin %> <%= command.id %> --path ./my-schema.jsonc --json" ], "flags": { "path": { "char": "p", "description": "Path to schema file (e.g. my-schema.jsonc)", "name": "path", "default": "fragment/fragment.json", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "verbose": { "char": "v", "description": "Show detailed validation output", "name": "verbose", "allowNo": false, "type": "boolean" }, "json": { "char": "j", "description": "Output validation results as JSON for programmatic use", "name": "json", "allowNo": false, "type": "boolean" } }, "hasDynamicHelp": false, "hiddenAliases": [], "id": "verify-schema", "pluginAlias": "@fragment-dev/cli", "pluginName": "@fragment-dev/cli", "pluginType": "core", "strict": true }, "get-schema": { "aliases": [], "args": {}, "description": "Retrieve a schema from the API for local use", "examples": [ "<%= config.bin %> <%= command.id %>" ], "flags": { "verbose": { "char": "v", "description": "Enable verbose mode (prints GraphQL commands).", "name": "verbose", "allowNo": false, "type": "boolean" }, "key": { "char": "k", "description": "Key of schema (e.g. template-schema)", "name": "key", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "version": { "description": "Schema version to retrieve (e.g. 2). Defaults to latest available version.", "name": "version", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "output": { "char": "o", "description": "Path to the schema file (e.g. /home/user/code/schema.jsonc). Defaults to the current directory and the schema key as the file name.", "name": "output", "hasDynamicHelp": false, "multiple": false, "type": "option" } }, "hasDynamicHelp": false, "hiddenAliases": [], "id": "get-schema", "pluginAlias": "@fragment-dev/cli", "pluginName": "@fragment-dev/cli", "pluginType": "core" }, "add-ledger-entry": { "aliases": [], "args": {}, "description": "This mirrors the addLedgerEntry mutation in the GraphQL API.\n\n Only entries with type are allowed to be posted to a Ledger Account.\n ", "examples": [ "<%= config.bin %> <%= command.id %>" ], "flags": { "verbose": { "char": "v", "description": "Enable verbose mode (prints GraphQL commands).", "name": "verbose", "allowNo": false, "type": "boolean" }, "ik": { "char": "i", "description": "The Idempotency Key for Ledger Entry creation.", "name": "ik", "required": true, "hasDynamicHelp": false, "multiple": false, "type": "option" }, "ledger.ik": { "char": "l", "description": "The Idempotency Key of the Ledger to post the Ledger Entry to.", "name": "ledger.ik", "required": true, "hasDynamicHelp": false, "multiple": false, "type": "option" }, "type": { "char": "t", "description": "The `type` of Ledger Entry you want to post.", "name": "type", "required": true, "hasDynamicHelp": false, "multiple": false, "type": "option" }, "type.version": { "char": "n", "description": "The version of the Ledger Entry type you want to post.", "name": "type.version", "required": false, "hasDynamicHelp": false, "multiple": false, "type": "option" }, "param": { "char": "p", "description": "You may specify multiple parameters by repeating the flag.", "name": "param", "summary": "The parameters for your Ledger Entry. (ex: --param amount=100 --param currency=USD)", "hasDynamicHelp": false, "multiple": true, "type": "option" } }, "hasDynamicHelp": false, "hiddenAliases": [], "id": "add-ledger-entry", "pluginAlias": "@fragment-dev/cli", "pluginName": "@fragment-dev/cli", "pluginType": "core", "summary": "Add a Ledger Entry to a Ledger Account." }, "create-ledger": { "aliases": [], "args": {}, "description": "Create schematized Ledger within your Fragment workspace", "examples": [ "<%= config.bin %> <%= command.id %>" ], "flags": { "verbose": { "char": "v", "description": "Enable verbose mode (prints GraphQL commands).", "name": "verbose", "allowNo": false, "type": "boolean" }, "ik": { "char": "i", "description": "Idempotency key for Ledger creation", "name": "ik", "required": true, "hasDynamicHelp": false, "multiple": false, "type": "option" }, "name": { "char": "n", "description": "Ledger name (e.g. 'My First Ledger')", "name": "name", "required": true, "hasDynamicHelp": false, "multiple": false, "type": "option" }, "schema": { "char": "s", "description": "Path to schema file (defaults to fragment.jsonc)", "name": "schema", "default": "fragment.jsonc", "hasDynamicHelp": false, "multiple": false, "type": "option" } }, "hasDynamicHelp": false, "hiddenAliases": [], "id": "create-ledger", "pluginAlias": "@fragment-dev/cli", "pluginName": "@fragment-dev/cli", "pluginType": "core" }, "update-ledger-account": { "aliases": [], "args": {}, "description": "This mirrors the updateLedgerAccount mutation in the GraphQL API.", "examples": [ "<%= config.bin %> <%= command.id %>" ], "flags": { "verbose": { "char": "v", "description": "Enable verbose mode (prints GraphQL commands).", "name": "verbose", "allowNo": false, "type": "boolean" }, "ledgerAccount.path": { "char": "p", "description": "The unique path of the Ledger Account.", "exclusive": [ "ledgerAccount.id" ], "name": "ledgerAccount.path", "relationships": [ { "type": "some", "flags": [ "ledger.id", "ledger.ik" ] } ], "hasDynamicHelp": false, "multiple": false, "type": "option" }, "ledger.ik": { "char": "l", "description": "The Idempotency Key of the Ledger the Ledger Account is in.", "name": "ledger.ik", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "ledger.id": { "description": "The Fragment ID of the Ledger the Ledger Account is in.", "name": "ledger.id", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "ledgerAccount.id": { "description": "The Fragment ID of the Ledger Account.", "name": "ledgerAccount.id", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "update.name": { "name": "update.name", "required": true, "hasDynamicHelp": false, "multiple": false, "type": "option" } }, "hasDynamicHelp": false, "hiddenAliases": [], "id": "update-ledger-account", "pluginAlias": "@fragment-dev/cli", "pluginName": "@fragment-dev/cli", "pluginType": "core", "summary": "Update a Ledger Account within your Fragment Ledger." }, "create-custom-link": { "aliases": [], "args": {}, "description": "This mirrors the CreateCustomLink API endpoint.\n Read https://fragment.dev/docs/sync-payments#custom-link-onboarding to learn more about Custom Links.", "examples": [ "<%= config.bin %> <%= command.id %> --ik <ik> --name <name>" ], "flags": { "verbose": { "char": "v", "description": "Enable verbose mode (prints GraphQL commands).", "name": "verbose", "allowNo": false, "type": "boolean" }, "ik": { "char": "i", "description": "The Idempotency Key for the Custom Link creation.", "name": "ik", "required": true, "hasDynamicHelp": false, "multiple": false, "type": "option" }, "name": { "description": "The name for the Custom Link.", "name": "name", "required": true, "hasDynamicHelp": false, "multiple": false, "type": "option" } }, "hasDynamicHelp": false, "hiddenAliases": [], "id": "create-custom-link", "pluginAlias": "@fragment-dev/cli", "pluginName": "@fragment-dev/cli", "pluginType": "core", "summary": "Create a Custom Link" }, "delete-ledger": { "aliases": [], "args": {}, "description": "This mirrors the deleteLedger mutation in the GraphQL API.", "examples": [ "<%= config.bin %> <%= command.id %>" ], "flags": { "verbose": { "char": "v", "description": "Enable verbose mode (prints GraphQL commands).", "name": "verbose", "allowNo": false, "type": "boolean" }, "ledger.ik": { "char": "l", "description": "The Idempotency Key of the Ledger to delete.", "name": "ledger.ik", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "ledger.id": { "description": "The Fragment ID of the Ledger to delete.", "name": "ledger.id", "hasDynamicHelp": false, "multiple": false, "type": "option" } }, "hasDynamicHelp": false, "hiddenAliases": [], "id": "delete-ledger", "pluginAlias": "@fragment-dev/cli", "pluginName": "@fragment-dev/cli", "pluginType": "core", "summary": "Delete a Ledger." }, "delete-schema": { "aliases": [], "args": {}, "description": "This mirrors the deleteSchema mutation in the GraphQL API.", "examples": [ "<%= config.bin %> <%= command.id %>" ], "flags": { "verbose": { "char": "v", "description": "Enable verbose mode (prints GraphQL commands).", "name": "verbose", "allowNo": false, "type": "boolean" }, "key": { "char": "k", "description": "Key of the Schema to delete (e.g. template-schema).", "name": "key", "required": true, "hasDynamicHelp": false, "multiple": false, "type": "option" } }, "hasDynamicHelp": false, "hiddenAliases": [], "id": "delete-schema", "pluginAlias": "@fragment-dev/cli", "pluginName": "@fragment-dev/cli", "pluginType": "core", "summary": "Delete a Schema." }, "delete-custom-txs": { "aliases": [], "args": {}, "description": "This mirrors the deleteCustomTxs mutation in the GraphQL API.", "examples": [ "<%= config.bin %> <%= command.id %>" ], "flags": { "verbose": { "char": "v", "description": "Enable verbose mode (prints GraphQL commands).", "name": "verbose", "allowNo": false, "type": "boolean" }, "id": { "description": "Fragment ID of the Custom Tx to delete.", "name": "id", "required": true, "hasDynamicHelp": false, "multiple": true, "type": "option" } }, "hasDynamicHelp": false, "hiddenAliases": [], "id": "delete-custom-txs", "pluginAlias": "@fragment-dev/cli", "pluginName": "@fragment-dev/cli", "pluginType": "core", "summary": "Delete Custom Txs." }, "migrate-ledger-entry": { "aliases": [], "args": {}, "description": "This mirrors the migrateLedgerEntry mutation in the GraphQL API.\n\n Migrates an existing Ledger Entry to a new type and version with new parameters.\n ", "examples": [ "<%= config.bin %> <%= command.id %>" ], "flags": { "verbose": { "char": "v", "description": "Enable verbose mode (prints GraphQL commands).", "name": "verbose", "allowNo": false, "type": "boolean" }, "entry.id": { "char": "e", "description": "The ID of the Ledger Entry to migrate.", "name": "entry.id", "required": true, "hasDynamicHelp": false, "multiple": false, "type": "option" }, "ledger.ik": { "char": "l", "description": "The Idempotency Key of the Ledger containing the entry.", "name": "ledger.ik", "required": true, "hasDynamicHelp": false, "multiple": false, "type": "option" }, "new.entry.type": { "char": "t", "description": "The new type for the migrated Ledger Entry.", "name": "new.entry.type", "required": true, "hasDynamicHelp": false, "multiple": false, "type": "option" }, "new.entry.type.version": { "char": "n", "description": "The new version of the Ledger Entry type.", "name": "new.entry.type.version", "required": false, "hasDynamicHelp": false, "multiple": false, "type": "option" }, "param": { "char": "p", "description": "You may specify multiple parameters by repeating the flag.", "name": "param", "summary": "The parameters for the new Ledger Entry. (ex: --param amount=100 --param currency=USD)", "hasDynamicHelp": false, "multiple": true, "type": "option" } }, "hasDynamicHelp": false, "hiddenAliases": [], "id": "migrate-ledger-entry", "pluginAlias": "@fragment-dev/cli", "pluginName": "@fragment-dev/cli", "pluginType": "core", "summary": "Migrate a Ledger Entry to a new type and version." }, "reverse-ledger-entry": { "aliases": [], "args": {}, "description": "This mirrors the reverseLedgerEntry mutation in the GraphQL API.", "examples": [ "<%= config.bin %> <%= command.id %>" ], "flags": { "verbose": { "char": "v", "description": "Enable verbose mode (prints GraphQL commands).", "name": "verbose", "allowNo": false, "type": "boolean" }, "id": { "description": "Fragment ID of the Ledger Entry to reverse.", "name": "id", "required": true, "hasDynamicHelp": false, "multiple": false, "type": "option" } }, "hasDynamicHelp": false, "hiddenAliases": [], "id": "reverse-ledger-entry", "pluginAlias": "@fragment-dev/cli", "pluginName": "@fragment-dev/cli", "pluginType": "core", "summary": "Reverse a Ledger Entry." }, "query:ledgerAccounts": { "aliases": [], "args": {}, "description": "Get accounts for ledger within your workspace by ID", "examples": [ "<%= config.bin %> <%= command.id %>" ], "flags": { "verbose": { "char": "v", "description": "Enable verbose mode (prints GraphQL commands).", "name": "verbose", "allowNo": false, "type": "boolean" }, "ledger": { "char": "l", "description": "Ledger ID to retrieve accounts for", "name": "ledger", "required": true, "hasDynamicHelp": false, "multiple": false, "type": "option" }, "first": { "description": "Number of ledger accounts to retrieve in each page", "name": "first", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "after": { "description": "Cursor to paginate through ledger accounts", "name": "after", "hasDynamicHelp": false, "multiple": false, "type": "option" } }, "hasDynamicHelp": false, "hiddenAliases": [], "id": "query:ledgerAccounts", "pluginAlias": "@fragment-dev/cli", "pluginName": "@fragment-dev/cli", "pluginType": "core" }, "query:ledgers": { "aliases": [], "args": {}, "description": "List all ledgers in your workspace", "examples": [ "<%= config.bin %> <%= command.id %>" ], "flags": { "verbose": { "char": "v", "description": "Enable verbose mode (prints GraphQL commands).", "name": "verbose", "allowNo": false, "type": "boolean" } }, "hasDynamicHelp": false, "hiddenAliases": [], "id": "query:ledgers", "pluginAlias": "@fragment-dev/cli", "pluginName": "@fragment-dev/cli", "pluginType": "core" }, "query:schemas": { "aliases": [], "args": {}, "description": "List all schemas in your workspace", "examples": [ "<%= config.bin %> <%= command.id %>" ], "flags": { "verbose": { "char": "v", "description": "Enable verbose mode (prints GraphQL commands).", "name": "verbose", "allowNo": false, "type": "boolean" } }, "hasDynamicHelp": false, "hiddenAliases": [], "id": "query:schemas", "pluginAlias": "@fragment-dev/cli", "pluginName": "@fragment-dev/cli", "pluginType": "core" }, "query:schema": { "aliases": [], "args": {}, "description": "Get schema from your workspace by key", "examples": [ "<%= config.bin %> <%= command.id %>" ], "flags": { "verbose": { "char": "v", "description": "Enable verbose mode (prints GraphQL commands).", "name": "verbose", "allowNo": false, "type": "boolean" }, "key": { "char": "k", "description": "Key of schema (e.g. template-schema)", "name": "key", "required": true, "hasDynamicHelp": false, "multiple": false, "type": "option" }, "version": { "description": "Schema version to retrieve (e.g. 2). Defaults to latest available version.", "name": "version", "required": false, "hasDynamicHelp": false, "multiple": false, "type": "option" } }, "hasDynamicHelp": false, "hiddenAliases": [], "id": "query:schema", "pluginAlias": "@fragment-dev/cli", "pluginName": "@fragment-dev/cli", "pluginType": "core" }, "gen-graphql": { "aliases": [], "args": {}, "description": "This command generates a GraphQL query for each entry type in your ledger Schema.\n Use this command with Fragment SDKs to create type-safe code to update your ledger.", "examples": [ { "description": "Output the GraphQL queries from the schema file at <path>.", "command": "<%= config.bin %> <%= command.id %> --path <path>" }, { "description": "Output the GraphQL queries to a specific output path.", "command": "<%= config.bin %> <%= command.id %> --path <path> --output <output path>" }, { "description": "Output each GraphQL query in a separate file.", "command": "<%= config.bin %> <%= command.id %> --path <path> --output <output path> --output-file-per-query" }, { "description": "Include the standard GraphQL queries and output each in a separate file.", "command": "<%= config.bin %> <%= command.id %> --path <path> --output <output path> --output-file-per-query --include-standard-queries" } ], "flags": { "path": { "char": "p", "description": "The path to the schema file.", "name": "path", "required": true, "hasDynamicHelp": false, "multiple": false, "type": "option" }, "output": { "char": "o", "description": "The output path for the generated file(s). Must end with .graphql or .gql, unless --output-file-per-query is set. If set, the output path must be a directory.", "name": "output", "required": true, "hasDynamicHelp": false, "multiple": false, "type": "option" }, "output-file-per-query": { "description": "Output each query in a separate file instead of a single file.", "name": "output-file-per-query", "required": false, "allowNo": false, "type": "boolean" }, "include-standard-queries": { "description": "Include the set of standard queries in the output. This is required only if you are not using the Fragment SDK.", "name": "include-standard-queries", "required": false, "allowNo": false, "type": "boolean" } }, "hasDynamicHelp": false, "hiddenAliases": [], "id": "gen-graphql", "pluginAlias": "@fragment-dev/cli", "pluginName": "@fragment-dev/cli", "pluginType": "core", "strict": true, "summary": "Generate GraphQL queries from your Schema for your SDK.", "help": "Generate GraphQL queries from your Schema for your SDK." } }, "version": "2025.8.14" }