diff --git a/README.md b/README.md index e362d8c..33e5da3 100644 --- a/README.md +++ b/README.md @@ -1,55 +1,7 @@ -**NOTE: This template for sf plugins is not yet official. Please consult with the Platform CLI team before using this template.** - -# plugin-template-sf - -[![NPM](https://img.shields.io/npm/v/@salesforce/plugin-template-sf.svg?label=@salesforce/plugin-template-sf)](https://www.npmjs.com/package/@salesforce/plugin-template-sf) [![Downloads/week](https://img.shields.io/npm/dw/@salesforce/plugin-template-sf.svg)](https://npmjs.org/package/@salesforce/plugin-template-sf) [![License](https://img.shields.io/badge/License-BSD%203--Clause-brightgreen.svg)](https://raw.githubusercontent.com/salesforcecli/plugin-template-sf/main/LICENSE.txt) - -## Using the template - -This repository provides a template for creating a plugin for the Salesforce CLI. To convert this template to a working plugin: - -1. Please get in touch with the Platform CLI team. We want to help you develop your plugin. -2. Generate your plugin: - - ``` - sf plugins install dev - sf dev generate plugin - - git init -b main - git add . && git commit -m "chore: initial commit" - ``` - -3. Create your plugin's repo in the salesforcecli github org -4. When you're ready, replace the contents of this README with the information you want. - -## Learn about `sf` plugins - -Salesforce CLI plugins are based on the [oclif plugin framework](https://oclif.io/docs/introduction). Read the [plugin developer guide](https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_plugins.meta/sfdx_cli_plugins/cli_plugins_architecture_sf_cli.htm) to learn about Salesforce CLI plugin development. - -This repository contains a lot of additional scripts and tools to help with general Salesforce node development and enforce coding standards. You should familiarize yourself with some of the [node developer packages](#tooling) used by Salesforce. There is also a default circleci config using the [release management orb](https://github.com/forcedotcom/npm-release-management-orb) standards. - -Additionally, there are some additional tests that the Salesforce CLI will enforce if this plugin is ever bundled with the CLI. These test are included by default under the `posttest` script and it is required to keep these tests active in your plugin if you plan to have it bundled. - -### Tooling - -- [@salesforce/core](https://github.com/forcedotcom/sfdx-core) -- [@salesforce/kit](https://github.com/forcedotcom/kit) -- [@salesforce/sf-plugins-core](https://github.com/salesforcecli/sf-plugins-core) -- [@salesforce/ts-types](https://github.com/forcedotcom/ts-types) -- [@salesforce/ts-sinon](https://github.com/forcedotcom/ts-sinon) -- [@salesforce/dev-config](https://github.com/forcedotcom/dev-config) -- [@salesforce/dev-scripts](https://github.com/forcedotcom/dev-scripts) - -# Everything past here is only a suggestion as to what should be in your specific plugin's description - -This plugin is bundled with the [Salesforce CLI](https://developer.salesforce.com/tools/sfdxcli). For more information on the CLI, read the [getting started guide](https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_intro.htm). - -We always recommend using the latest version of these commands bundled with the CLI, however, you can install a specific version or tag if needed. - ## Install ```bash -sf plugins install @salesforce/plugin-template-sf@x.y.z +sf plugins install @salesforce/plugin-api ``` ## Issues @@ -107,52 +59,112 @@ sf plugins +- [`sf api request graphql`](#sf-api-request-graphql) - [`sf api request rest ENDPOINT`](#sf-api-request-rest-endpoint) -## `sf api request rest ENDPOINT` +## `sf api request graphql` -Make an authenticated HTTP request to Salesforce REST API and print the response. +Execute GraphQL statements ```` USAGE - $ sf api request rest ENDPOINT -o [--flags-dir ] [--api-version ] [-i | -S Example: - report.xlsx] [-X GET|POST|PUT|PATCH|HEAD|DELETE|OPTIONS|TRACE] [-H key:value...] [--body file] - -ARGUMENTS - ENDPOINT Salesforce API endpoint + $ sf api request graphql -o --body file [--json] [--flags-dir ] [-S Example: report.xlsx | -i] FLAGS - -H, --header=key:value... HTTP header in "key:value" format. -S, --stream-to-file=Example: report.xlsx Stream responses to a file. - -X, --method=