@picahq/cli 1.9.0 → 1.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +32 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1797,7 +1797,34 @@ function colorMethod(method) {
|
|
|
1797
1797
|
var require2 = createRequire(import.meta.url);
|
|
1798
1798
|
var { version } = require2("../package.json");
|
|
1799
1799
|
var program = new Command();
|
|
1800
|
-
program.name("pica").description(
|
|
1800
|
+
program.name("pica").description(`Pica CLI \u2014 Connect AI agents to 200+ platforms through one interface.
|
|
1801
|
+
|
|
1802
|
+
Setup:
|
|
1803
|
+
pica init Set up API key and install MCP server
|
|
1804
|
+
pica add <platform> Connect a platform via OAuth (e.g. gmail, slack, shopify)
|
|
1805
|
+
pica config Configure access control (permissions, scoping)
|
|
1806
|
+
|
|
1807
|
+
Workflow (use these in order):
|
|
1808
|
+
1. pica list List your connected platforms and connection keys
|
|
1809
|
+
2. pica actions search <platform> <q> Search for actions using natural language
|
|
1810
|
+
3. pica actions knowledge <plat> <id> Get full docs for an action (ALWAYS do this before execute)
|
|
1811
|
+
4. pica actions execute <p> <id> <key> Execute the action
|
|
1812
|
+
|
|
1813
|
+
Example \u2014 send an email through Gmail:
|
|
1814
|
+
$ pica list
|
|
1815
|
+
# Find: gmail operational live::gmail::default::abc123
|
|
1816
|
+
|
|
1817
|
+
$ pica actions search gmail "send email" -t execute
|
|
1818
|
+
# Find: POST Send Email conn_mod_def::xxx::yyy
|
|
1819
|
+
|
|
1820
|
+
$ pica actions knowledge gmail conn_mod_def::xxx::yyy
|
|
1821
|
+
# Read the docs: required fields are to, subject, body, connectionKey
|
|
1822
|
+
|
|
1823
|
+
$ pica actions execute gmail conn_mod_def::xxx::yyy live::gmail::default::abc123 \\
|
|
1824
|
+
-d '{"to":"j@example.com","subject":"Hello","body":"Hi!","connectionKey":"live::gmail::default::abc123"}'
|
|
1825
|
+
|
|
1826
|
+
Platform names are always kebab-case (e.g. hub-spot, ship-station, google-calendar).
|
|
1827
|
+
Run 'pica platforms' to browse all 200+ available platforms.`).version(version);
|
|
1801
1828
|
program.command("init").description("Set up Pica and install MCP to your AI agents").option("-y, --yes", "Skip confirmations").option("-g, --global", "Install MCP globally (available in all projects)").option("-p, --project", "Install MCP for this project only (creates .mcp.json)").action(async (options) => {
|
|
1802
1829
|
await initCommand(options);
|
|
1803
1830
|
});
|
|
@@ -1814,14 +1841,14 @@ connection.command("list").alias("ls").description("List your connections").acti
|
|
|
1814
1841
|
program.command("platforms").alias("p").description("List available platforms").option("-c, --category <category>", "Filter by category").option("--json", "Output as JSON").action(async (options) => {
|
|
1815
1842
|
await platformsCommand(options);
|
|
1816
1843
|
});
|
|
1817
|
-
var actions = program.command("actions").alias("a").description("Search, explore, and execute platform actions");
|
|
1818
|
-
actions.command("search <platform> <query>").description(
|
|
1844
|
+
var actions = program.command("actions").alias("a").description("Search, explore, and execute platform actions (workflow: search \u2192 knowledge \u2192 execute)");
|
|
1845
|
+
actions.command("search <platform> <query>").description('Search for actions on a platform (e.g. pica actions search gmail "send email")').option("-t, --type <type>", "execute (to run it) or knowledge (to learn about it). Default: knowledge").action(async (platform, query, options) => {
|
|
1819
1846
|
await actionsSearchCommand(platform, query, options);
|
|
1820
1847
|
});
|
|
1821
|
-
actions.command("knowledge <platform> <actionId>").alias("k").description("Get
|
|
1848
|
+
actions.command("knowledge <platform> <actionId>").alias("k").description("Get full docs for an action \u2014 MUST call before execute to know required params").action(async (platform, actionId) => {
|
|
1822
1849
|
await actionsKnowledgeCommand(platform, actionId);
|
|
1823
1850
|
});
|
|
1824
|
-
actions.command("execute <platform> <actionId> <connectionKey>").alias("x").description(
|
|
1851
|
+
actions.command("execute <platform> <actionId> <connectionKey>").alias("x").description('Execute an action \u2014 pass connectionKey from "pica list", actionId from "actions search"').option("-d, --data <json>", "Request body as JSON").option("--path-vars <json>", "Path variables as JSON").option("--query-params <json>", "Query parameters as JSON").option("--headers <json>", "Additional headers as JSON").option("--form-data", "Send as multipart/form-data").option("--form-url-encoded", "Send as application/x-www-form-urlencoded").action(async (platform, actionId, connectionKey, options) => {
|
|
1825
1852
|
await actionsExecuteCommand(platform, actionId, connectionKey, {
|
|
1826
1853
|
data: options.data,
|
|
1827
1854
|
pathVars: options.pathVars,
|