---
title: "CLI Macro"
canonical: "https://support.appfire.com/space/CCLI/66716032/CLI%20Macro"
format: markdown
---
> Macro (aura-html)

## Parameters

| **Parameter** | **Default** | **Macro Browser Label** | **Description** |
| --- | --- | --- | --- |
| **profile** |  | Profile | Pre-configured profile defined by administrator used to provide some other parameters. This parameter may be restricted for security reasons. Administrators should see [Get started with Run CLI Actions in Confluence](https://appfire.atlassian.net/wiki/spaces/CCLI/pages/66715767) for more information. |
| **product** |  | Product | One of the Appfire CLI supported products: confluence, jira, bamboo, stash, crucible, or fisheye. This parameter may be restricted for security reasons. |
| **script** | macro body | Script location | Additional SQL statements can be added after the macro body sql by specifying another location:<br>- **#filename** - Data is read from the file located in confluence home directory/script/filename. Subdirectories can be specified.
- **global page template name** - Data is read from a global page template.
- **space:page template name** - Data is read from a space template.
- **^attachment** - Data is read from an attachment to the current page.
- **page^attachment** - Data is read from an attachment to the page name provided.
- **space:page^attachment** - Data is read from an attachment to the page name provided in the space indicated. |
| **data** | @DATA: in macro body | Data location | Specify the location if input data to be used by actions. Input data is provided to the script as standard input which is used directly by some actions (like **run**) or can be used for a few parameters like **file** to provide file like data. For instance, using: **--file -**. The dash for a CLI action indicates the file data is provided from standard input.<br>- **#filename** - Data is read from the file located in confluence home directory/script/filename. Subdirectories can be specified.
- **global page template name** - Data is read from a global page template.
- **space:page template name** - Data is read from a space template.
- **^attachment** - Data is read from an attachment to the current page.
- **page^attachment** - Data is read from an attachment to the page name provided.
- **space:page^attachment** - Data is read from an attachment to the page name provided in the space indicated. |
| **showCommand** | false | Show command in panel | Show the action command in a panel. |
| **panel** | true | Use panel for output | Use a no format panel to wrap the output. Output is shown by default unless **hideOutput** specifies otherwise. |
| **wrapMacro** | noformat | Wrap output with a macro | Macro used to wrap the output of the action. |
| **wrapMacroParameter** | none | Macro parameters added to the wrap macro | Macro parameter string (wiki format) added to the macro used to wrap the output. |
| **hideOutput** | false | Hide the output | Hide the output generated by the CLI command. Useful when the command produces file output that is accessed separately. |
| **macros** | false | Render macros | Render macros in the body before processing. |
| **server** |  | CLI server | CLI server equivalent to specifying the **--server** parameter on the CLI. |
| **user** |  | CLI user | CLI user equivalent to specifying **--user** parameter on the CLI. |
| **password** |  | CLI password | CLI password equivalent to specifying **--password** on the CLI. |
| **directory** |  | Directory | Directory used for server file access (read and write). Defaults to Confluence home directory/script. This parameter is restricted for security reasons. |
| **subDirectory** |  | Sub directory | Sub directory relative to the directory used for server file access. |
| **dataSource** |  | Data source | Specify application server provided SQL datasource for use in runFromSql actions. Directly provided database parameters can not be used. This parameter may be restricted for security reasons. |

> ⚠️ **Prerequisite for wrapMacro csv**: The `csv` wrap macro option requires [Advanced Tables for Confluence](https://marketplace.atlassian.com/apps/1219268/advanced-tables-for-confluence) to be installed on your site. Without it, the page displays `unknown macro: {csv}`.

### Example - Simple

```
{cli:profile=confluence}
--action getSpaceList
{cli}
```

### Example - Run Multiple Actions

```
{cli:profile=confluence}
--action run 
 
@DATA:
--action storePage --space Examples --title "My Example Page" --parent @home --content "{children}"
--action storePage --space Examples --title "My Example Detail Page" --parent "My Example Page" --content "..." 
{cli}
```

### Example - Using SQL

```
{run:titleRun=Add labels|replace=space:zcli,labels:test}
{cli:profile=confluence|datasource=confluenceDS}
--action runFromSql --continue
 
@DATA:
select '--action addLabels --labels "$labels" --space $space --title "' || title || '"' from content where spaceid in (select spaceid from spaces where spacekey = '$space')
{cli}
{run}
```