FRAGMENT CLI
npm install @fragment-dev/cliFragment is the Ledger API for engineers that move money. Stop wrangling payment tables, debugging balance errors and hacking together data pipelines. Start shipping the features that make a difference.
* fragment add-ledger-entry
* [fragment autocomplete [SHELL]](#fragment-autocomplete-shell)
* fragment commands
* fragment create-custom-link
* fragment create-ledger
* fragment delete-custom-txs
* fragment delete-ledger
* fragment delete-schema
* fragment gen-graphql
* fragment get-schema
* [fragment help [COMMAND]](#fragment-help-command)
* fragment init
* fragment login
* fragment migrate-ledger-entry
* fragment query ledgerAccounts
* fragment query ledgers
* fragment query schema
* fragment query schemas
* fragment reverse-ledger-entry
* fragment start
* fragment store-schema
* fragment token
* fragment update
* fragment update-ledger-account
* fragment verify-schema
* fragment workspace
fragment add-ledger-entryAdd a Ledger Entry to a Ledger Account.
``
USAGE
$ fragment add-ledger-entry -i
FLAGS
-i, --ik=
-l, --ledger.ik=
-n, --type.version=
-p, --param=
-t, --type= of Ledger Entry you want to post.
-v, --verbose Enable verbose mode (prints GraphQL commands).
DESCRIPTION
Add a Ledger Entry to a Ledger Account.
This mirrors the addLedgerEntry mutation in the GraphQL API.
Only entries with type are allowed to be posted to a Ledger Account.
EXAMPLES
$ fragment add-ledger-entry
FLAG DESCRIPTIONS
-p, --param=
You may specify multiple parameters by repeating the flag.
`
Display autocomplete installation instructions.
`
USAGE
$ fragment autocomplete [SHELL] [-r]
ARGUMENTS
SHELL (zsh|bash|powershell) Shell type
FLAGS
-r, --refresh-cache Refresh cache (ignores displaying instructions)
DESCRIPTION
Display autocomplete installation instructions.
EXAMPLES
$ fragment autocomplete
$ fragment autocomplete bash
$ fragment autocomplete zsh
$ fragment autocomplete powershell
$ fragment autocomplete --refresh-cache
`
_See code: @oclif/plugin-autocomplete_
List all fragment commands.
`
USAGE
$ fragment commands [--json] [-c id|plugin|summary|type... | --tree] [--deprecated] [-x | ] [--hidden]
[--no-truncate | ] [--sort id|plugin|summary|type | ]
FLAGS
-c, --columns=
GLOBAL FLAGS
--json Format output as json.
DESCRIPTION
List all fragment commands.
`
_See code: @oclif/plugin-commands_
Create a Custom Link
`
USAGE
$ fragment create-custom-link -i
FLAGS
-i, --ik=
-v, --verbose Enable verbose mode (prints GraphQL commands).
--name=
DESCRIPTION
Create a Custom Link
This mirrors the CreateCustomLink API endpoint.
Read https://fragment.dev/docs/sync-payments#custom-link-onboarding to learn more about Custom Links.
EXAMPLES
$ fragment create-custom-link --ik
`
Create schematized Ledger within your Fragment workspace
`
USAGE
$ fragment create-ledger -i
FLAGS
-i, --ik=
-n, --name=
-s, --schema=
-v, --verbose Enable verbose mode (prints GraphQL commands).
DESCRIPTION
Create schematized Ledger within your Fragment workspace
EXAMPLES
$ fragment create-ledger
`
Delete Custom Txs.
`
USAGE
$ fragment delete-custom-txs --id
FLAGS
-v, --verbose Enable verbose mode (prints GraphQL commands).
--id=
DESCRIPTION
Delete Custom Txs.
This mirrors the deleteCustomTxs mutation in the GraphQL API.
EXAMPLES
$ fragment delete-custom-txs
`
Delete a Ledger.
`
USAGE
$ fragment delete-ledger [-v] [-l
FLAGS
-l, --ledger.ik=
-v, --verbose Enable verbose mode (prints GraphQL commands).
--ledger.id=
DESCRIPTION
Delete a Ledger.
This mirrors the deleteLedger mutation in the GraphQL API.
EXAMPLES
$ fragment delete-ledger
`
Delete a Schema.
`
USAGE
$ fragment delete-schema -k
FLAGS
-k, --key=
-v, --verbose Enable verbose mode (prints GraphQL commands).
DESCRIPTION
Delete a Schema.
This mirrors the deleteSchema mutation in the GraphQL API.
EXAMPLES
$ fragment delete-schema
`
Generate GraphQL queries from your Schema for your SDK.
`
USAGE
$ fragment gen-graphql -p
FLAGS
-o, --output=
unless --output-file-per-query is set. If set, the output path must be a directory.
-p, --path=
--include-standard-queries Include the set of standard queries in the output. This is required only if you are
not using the Fragment SDK.
--output-file-per-query Output each query in a separate file instead of a single file.
DESCRIPTION
Generate GraphQL queries from your Schema for your SDK.
This command generates a GraphQL query for each entry type in your ledger Schema.
Use this command with Fragment SDKs to create type-safe code to update your ledger.
EXAMPLES
Output the GraphQL queries from the schema file at
$ fragment gen-graphql --path
Output the GraphQL queries to a specific output path.
$ fragment gen-graphql --path
Output each GraphQL query in a separate file.
$ fragment gen-graphql --path
Include the standard GraphQL queries and output each in a separate file.
$ fragment gen-graphql --path
Retrieve a schema from the API for local use
`
USAGE
$ fragment get-schema [-v] [-k
FLAGS
-k, --key=
-o, --output=
and the schema key as the file name.
-v, --verbose Enable verbose mode (prints GraphQL commands).
--version=
DESCRIPTION
Retrieve a schema from the API for local use
EXAMPLES
$ fragment get-schema
`
Display help for fragment.
`
USAGE
$ fragment help [COMMAND...] [-n]
ARGUMENTS
COMMAND... Command to show help for.
FLAGS
-n, --nested-commands Include all nested commands in the output.
DESCRIPTION
Display help for fragment.
`
_See code: @oclif/plugin-help_
Initialize an example chart of accounts locally
`
USAGE
$ fragment init [-f
FLAGS
-f, --file=
DESCRIPTION
Initialize an example chart of accounts locally
EXAMPLES
$ fragment init
`
Authenticate with FRAGMENT.
`
USAGE
$ fragment login [--client-id
FLAGS
--api-url=
--client-id=
--client-secret=
--oauth-scope=
--oauth-url=
https://auth.fragment.dev/oauth2/token)
--test If set, tests stored credentials only
DESCRIPTION
Authenticate with FRAGMENT.
Authentication is scoped to one FRAGMENT Workspace.
If you want to authenticate with another Workspace, you must create another API Client and follow the authentication
flow again.
Credentials will be written to ~/.fragment/auth.json.
EXAMPLES
$ fragment login
$ fragment login --client-id
`
Migrate a Ledger Entry to a new type and version.
`
USAGE
$ fragment migrate-ledger-entry -e
FLAGS
-e, --entry.id=
-l, --ledger.ik=
-n, --new.entry.type.version=
-p, --param=
currency=USD)
-t, --new.entry.type=
-v, --verbose Enable verbose mode (prints GraphQL commands).
DESCRIPTION
Migrate a Ledger Entry to a new type and version.
This mirrors the migrateLedgerEntry mutation in the GraphQL API.
Migrates an existing Ledger Entry to a new type and version with new parameters.
EXAMPLES
$ fragment migrate-ledger-entry
FLAG DESCRIPTIONS
-p, --param=
You may specify multiple parameters by repeating the flag.
`
Get accounts for ledger within your workspace by ID
`
USAGE
$ fragment query ledgerAccounts -l
FLAGS
-l, --ledger=
-v, --verbose Enable verbose mode (prints GraphQL commands).
--after=
--first=
DESCRIPTION
Get accounts for ledger within your workspace by ID
EXAMPLES
$ fragment query ledgerAccounts
`
List all ledgers in your workspace
`
USAGE
$ fragment query ledgers [-v]
FLAGS
-v, --verbose Enable verbose mode (prints GraphQL commands).
DESCRIPTION
List all ledgers in your workspace
EXAMPLES
$ fragment query ledgers
`
Get schema from your workspace by key
`
USAGE
$ fragment query schema -k
FLAGS
-k, --key=
-v, --verbose Enable verbose mode (prints GraphQL commands).
--version=
DESCRIPTION
Get schema from your workspace by key
EXAMPLES
$ fragment query schema
`
List all schemas in your workspace
`
USAGE
$ fragment query schemas [-v]
FLAGS
-v, --verbose Enable verbose mode (prints GraphQL commands).
DESCRIPTION
List all schemas in your workspace
EXAMPLES
$ fragment query schemas
`
Reverse a Ledger Entry.
`
USAGE
$ fragment reverse-ledger-entry --id
FLAGS
-v, --verbose Enable verbose mode (prints GraphQL commands).
--id=
DESCRIPTION
Reverse a Ledger Entry.
This mirrors the reverseLedgerEntry mutation in the GraphQL API.
EXAMPLES
$ fragment reverse-ledger-entry
`
Develop your chart of accounts locally
`
USAGE
$ fragment start [-p
FLAGS
-f, --file=
-p, --port=
--websocket-port=
DESCRIPTION
Develop your chart of accounts locally
EXAMPLES
$ fragment start --file ./my-fragment-schema.json
`
Store schema within your Fragment workspace
`
USAGE
$ fragment store-schema [-v] [-p
FLAGS
-p, --path=
-v, --verbose Enable verbose mode (prints GraphQL commands).
DESCRIPTION
Store schema within your Fragment workspace
EXAMPLES
$ fragment store-schema
`
Get a FRAGMENT Authentication Token.
`
USAGE
$ fragment token [-v]
FLAGS
-v, --verbose Enable verbose mode (prints GraphQL commands).
EXAMPLES
$ fragment token
`
Update the FRAGMENT CLI
`
USAGE
$ fragment update [-y] [--dry-run]
FLAGS
-y, --yes
--dry-run
DESCRIPTION
Update the FRAGMENT CLI
EXAMPLES
$ fragment update
`
Update a Ledger Account within your Fragment Ledger.
`
USAGE
$ fragment update-ledger-account --update.name
[--ledger.id
FLAGS
-l, --ledger.ik=
-p, --ledgerAccount.path=
-v, --verbose Enable verbose mode (prints GraphQL commands).
--ledger.id=
--ledgerAccount.id=
--update.name=
DESCRIPTION
Update a Ledger Account within your Fragment Ledger.
This mirrors the updateLedgerAccount mutation in the GraphQL API.
EXAMPLES
$ fragment update-ledger-account
`
Verify that a schema file follows the Fragment JSON schema format
`
USAGE
$ fragment verify-schema [-p
FLAGS
-j, --json Output validation results as JSON for programmatic use
-p, --path=
-v, --verbose Show detailed validation output
DESCRIPTION
Verify that a schema file follows the Fragment JSON schema format
EXAMPLES
$ fragment verify-schema
$ fragment verify-schema --path ./my-schema.jsonc
$ fragment verify-schema -p fragment/fragment.json --verbose
$ fragment verify-schema --path ./my-schema.jsonc --json
`
Get the details of the workspace this CLI is authenticated to
`
USAGE
$ fragment workspace [-v]
FLAGS
-v, --verbose Enable verbose mode (prints GraphQL commands).
DESCRIPTION
Get the details of the workspace this CLI is authenticated to
EXAMPLES
$ fragment workspace
``