mParticle Command Line Interface
- Clone the repo and
cd
into the directory npm install
npm link
Run mp
Run npm unlink
in the directory. This will remove the link to mp
.
Note: Ignore the usage section below. That's for when we get into production)
npm -g install @mparticle/cli
$ npm install -g @mparticle/cli
$ mp COMMAND
running command...
$ mp (-v|--version|version)
@mparticle/cli/1.0.8 darwin-x64 node-v11.14.0
$ mp --help [COMMAND]
USAGE
$ mp COMMAND
...
mp autocomplete [SHELL]
mp help [COMMAND]
mp planning:batches:validate
mp planning:data-plan-versions:create
mp planning:data-plan-versions:delete
mp planning:data-plan-versions:fetch
mp planning:data-plan-versions:update
mp planning:data-plans:create
mp planning:data-plans:delete
mp planning:data-plans:fetch
mp planning:data-plans:fetch-all
mp planning:data-plans:update
mp planning:events:validate
display autocomplete installation instructions
USAGE
$ mp autocomplete [SHELL]
ARGUMENTS
SHELL shell type
OPTIONS
-r, --refresh-cache Refresh cache (ignores displaying instructions)
EXAMPLES
$ mp autocomplete
$ mp autocomplete bash
$ mp autocomplete zsh
$ mp autocomplete --refresh-cache
See code: @oclif/plugin-autocomplete
display help for mp
USAGE
$ mp help [COMMAND]
ARGUMENTS
COMMAND command to show help for
OPTIONS
--all see all commands in CLI
See code: @oclif/plugin-help
Validates Event Batches
USAGE
$ mp planning:batches:validate
OPTIONS
-o, --outFile=outFile (optional) Output file for results (defaults to standard output)
--batch=batch Batch as Stringified JSON
--batchFile=batchFile Path to saved JSON file of a Batch
--clientId=clientId Client ID for Platform API
--clientSecret=clientSecret Client Secret for Platform API
--config=config mParticle Config JSON File
--dataPlan=dataPlan Data Plan as Stringified JSON
--dataPlanFile=dataPlanFile Path to saved JSON file of a Data Plan
--dataPlanVersion=dataPlanVersion Data Plan Version Document as Stringified JSON
--dataPlanVersionFile=dataPlanVersionFile Path to saved JSON file of a Data Plan Version
--logLevel=error|warn|info|debug|silent [default: info] Log Level
--serverMode Validate using mParticle Server-side validation
--versionNumber=versionNumber Data Plan Version Number
--workspaceId=workspaceId mParticle Workspace ID
DESCRIPTION
Data Plans are comprised of one or more Version Documents and are used to validate a Batch.
A Data Plan Version can be directly referenced by using either the --dataPlanVersion or --dataPlanVersionFile flags
Otherwise, a --dataPlan or --dataPlanFile must be accompanied by a --versionNumber.
For more information, visit: https://github.com/mParticle/mparticle-cli
ALIASES
$ mp plan:b:val
EXAMPLES
$ mp planning:batches:validate --batch=[BATCH] --dataPlan=[DATA_PLAN] --versionNumber=[VERSION_NUMBER]
$ mp planning:batches:validate --batch=[BATCH] --dataPlanVersion=[DATA_PLAN_VERSION]
$ mp planning:batches:validate --batchFile=/path/to/batch --dataPlanFile=/path/to/dataplan
--versionNumber=[VERSION_NUMBER]
$ mp planning:batches:validate --batchFile=/path/to/batch --dataPlanVersion=/path/to/dataplanversion
See code: src/commands/planning/batches/validate.ts
Creates a Data Plan Version and uploads to mParticle
USAGE
$ mp planning:data-plan-versions:create
OPTIONS
-o, --outFile=outFile (optional) Output file for results (defaults to standard output)
--clientId=clientId Client ID for Platform API
--clientSecret=clientSecret Client Secret for Platform API
--config=config mParticle Config JSON File
--dataPlanId=dataPlanId Data Plan ID
--dataPlanVersion=dataPlanVersion Data Plan Version as Stringified JSON
--dataPlanVersionFile=dataPlanVersionFile Path to saved JSON file of a Data Plan Version
--logLevel=error|warn|info|debug|silent [default: info] Log Level
--workspaceId=workspaceId mParticle Workspace ID
DESCRIPTION
Data Plans are comprised of one or more Data Plan Versions.
A Version Document can be fetched by using your account credentials and a --versionNumber and --dataPlanId.
For more information, visit: https://github.com/mParticle/mparticle-cli
ALIASES
$ mp plan:dpv:create
EXAMPLE
$ mp planning:data-plan-versions:create --workspaceId=[WORKSPACE_ID] --dataPlanId=[DATA_PLAN_ID]
--dataPlan=[DATA_PLAN]
See code: src/commands/planning/data-plan-versions/create.ts
Deletes a Data Plan Version and uploads to mParticle
USAGE
$ mp planning:data-plan-versions:delete
OPTIONS
-o, --outFile=outFile (optional) Output file for results (defaults to standard output)
--clientId=clientId Client ID for Platform API
--clientSecret=clientSecret Client Secret for Platform API
--config=config mParticle Config JSON File
--dataPlanId=dataPlanId Data Plan ID
--logLevel=error|warn|info|debug|silent [default: info] Log Level
--versionNumber=versionNumber Data Plan Version Number
--workspaceId=workspaceId mParticle Workspace ID
DESCRIPTION
Data Plans are comprised of one or more Data Plan Versions.
A Version Document can be fetched by using your account credentials and a --versionNumber and --dataPlanId.
Note: Delete will NOT read dataPlanId or versionNumber from config as a precaution to prevent accidental deletion
of records
For more information, visit: https://github.com/mParticle/mparticle-cli
ALIASES
$ mp plan:dpv:delete
EXAMPLE
$ mp planning:data-plan-versions:delete --workspaceId=[WORKSPACE_ID] --dataPlanId=[DATA_PLAN_ID]
--versionNumber=[VERSION_NUMBER]
See code: src/commands/planning/data-plan-versions/delete.ts
Fetches a Data Plan Version
USAGE
$ mp planning:data-plan-versions:fetch
OPTIONS
-o, --outFile=outFile (optional) Output file for results (defaults to standard output)
--clientId=clientId Client ID for Platform API
--clientSecret=clientSecret Client Secret for Platform API
--config=config mParticle Config JSON File
--dataPlanId=dataPlanId Data Plan ID
--logLevel=error|warn|info|debug|silent [default: info] Log Level
--versionNumber=versionNumber Data Plan Version Number
--workspaceId=workspaceId mParticle Workspace ID
DESCRIPTION
Data Plan Versions are a subset of Data Plans and are used to validate batches.
A Version Document can be fetched by using your account credentials and a --versionNumber and --dataPlanId.
For more information, visit: https://github.com/mParticle/mparticle-cli
ALIASES
$ mp plan:dpv:fetch
EXAMPLE
$ mp planning:data-plan-versions:fetch --dataPlanId=[DATA_PLAN_ID] --versionNumber=[VERSION_NUMBER]
--workspaceId=[WORKSPACE_ID]
See code: src/commands/planning/data-plan-versions/fetch.ts
Updates a Data Plan Version and uploads to mParticle
USAGE
$ mp planning:data-plan-versions:update
OPTIONS
-o, --outFile=outFile (optional) Output file for results (defaults to standard output)
--clientId=clientId Client ID for Platform API
--clientSecret=clientSecret Client Secret for Platform API
--config=config mParticle Config JSON File
--dataPlanId=dataPlanId Data Plan ID
--dataPlanVersion=dataPlanVersion Data Plan Version as Stringified JSON
--dataPlanVersionFile=dataPlanVersionFile Path to saved JSON file of a Data Plan Version
--logLevel=error|warn|info|debug|silent [default: info] Log Level
--versionNumber=versionNumber Data Plan Version Number
--workspaceId=workspaceId mParticle Workspace ID
DESCRIPTION
Data Plans are comprised of one or more Data Plan Versions.
A Version Document can be fetched by using your account credentials and a --versionNumber and --dataPlanId.
For more information, visit: https://github.com/mParticle/mparticle-cli
ALIASES
$ mp plan:dpv:update
EXAMPLE
$ mp planning:data-plan-versions:update --workspaceId=[WORKSPACE_ID] --dataPlanId=[DATA_PLAN_ID]
--versionNumber=[VERSION_NUMBER] --dataPlanVersion=[DATA_PLAN_VERSION]
See code: src/commands/planning/data-plan-versions/update.ts
Creates a Data Plan and uploads to mParticle
USAGE
$ mp planning:data-plans:create
OPTIONS
-o, --outFile=outFile (optional) Output file for results (defaults to standard output)
--clientId=clientId Client ID for Platform API
--clientSecret=clientSecret Client Secret for Platform API
--config=config mParticle Config JSON File
--dataPlan=dataPlan Data Plan as Stringified JSON
--dataPlanFile=dataPlanFile Path to saved JSON file of a Data Plan
--logLevel=error|warn|info|debug|silent [default: info] Log Level
--workspaceId=workspaceId mParticle Workspace ID
DESCRIPTION
Data Plans are comprised of one or more Data Plan Versions.
A Data Plan can be fetched using your account credentials and using a valid --dataPlanId
For more information, visit: https://github.com/mParticle/mparticle-cli
ALIASES
$ mp plan:dp:create
EXAMPLE
$ mp planning:data-plan:create --workspaceId=[WORKSPACE_ID] --dataPlan=[DATA_PLAN]
See code: src/commands/planning/data-plans/create.ts
Deletes a Data Plan and uploads to mParticle
USAGE
$ mp planning:data-plans:delete
OPTIONS
-o, --outFile=outFile (optional) Output file for results (defaults to standard output)
--clientId=clientId Client ID for Platform API
--clientSecret=clientSecret Client Secret for Platform API
--config=config mParticle Config JSON File
--dataPlanId=dataPlanId Data Plan ID
--logLevel=error|warn|info|debug|silent [default: info] Log Level
--workspaceId=workspaceId mParticle Workspace ID
DESCRIPTION
Data Plans are comprised of one or more Data Plan Versions.
A Data Plan can be fetched using your account credentials and using a valid --dataPlanId
Note: Delete will NOT read dataPlanId from config as a precaution to prevent accidental deletion of records
For more information, visit: https://github.com/mParticle/mparticle-cli
ALIASES
$ mp plan:dp:delete
EXAMPLE
$ mp planning:data-plan:delete --workspaceId=[WORKSPACE_ID] --dataPlanId=[DATA_PLAN_ID]
See code: src/commands/planning/data-plans/delete.ts
Fetches a Data Plan
USAGE
$ mp planning:data-plans:fetch
OPTIONS
-o, --outFile=outFile (optional) Output file for results (defaults to standard output)
--clientId=clientId Client ID for Platform API
--clientSecret=clientSecret Client Secret for Platform API
--config=config mParticle Config JSON File
--dataPlanId=dataPlanId Data Plan ID
--logLevel=error|warn|info|debug|silent [default: info] Log Level
--workspaceId=workspaceId mParticle Workspace ID
DESCRIPTION
Data Plans are comprised of one or more Data Plan Versions.
A Data Plan can be fetched using your account credentials and using a valid --dataPlanId
For more information, visit: https://github.com/mParticle/mparticle-cli
ALIASES
$ mp plan:dp:fetch
EXAMPLE
$ mp planning:data-plan:fetch --dataPlanId=[DATA_PLAN_ID] --workspaceId=[WORKSPACE_ID]
See code: src/commands/planning/data-plans/fetch.ts
Fetches All Data Plans
USAGE
$ mp planning:data-plans:fetch-all
OPTIONS
-o, --outFile=outFile (optional) Output file for results (defaults to standard output)
-s, --split Split Data Plans into Data Plan Version files
--clientId=clientId Client ID for Platform API
--clientSecret=clientSecret Client Secret for Platform API
--config=config mParticle Config JSON File
--logLevel=error|warn|info|debug|silent [default: info] Log Level
--outPath=outPath Output path for split files
--workspaceId=workspaceId mParticle Workspace ID
DESCRIPTION
Data Plans are comprised of one or more Data Plan Versions.
All of your Data Plans will be fetched using your account credentials
and saved with the filename format of: <data_plan_id>.<version_number>.json
For more information, visit: https://github.com/mParticle/mparticle-cli
ALIASES
$ mp plan:dp:fetchAll
EXAMPLE
$ mp planning:data-plan:fetch-all --workspaceId=[WORKSPACE_ID]
See code: src/commands/planning/data-plans/fetch-all.ts
Updates a Data Plan and uploads to mParticle
USAGE
$ mp planning:data-plans:update
OPTIONS
-o, --outFile=outFile (optional) Output file for results (defaults to standard output)
--clientId=clientId Client ID for Platform API
--clientSecret=clientSecret Client Secret for Platform API
--config=config mParticle Config JSON File
--dataPlan=dataPlan Data Plan as Stringified JSON
--dataPlanFile=dataPlanFile Path to saved JSON file of a Data Plan
--dataPlanId=dataPlanId Data Plan ID
--logLevel=error|warn|info|debug|silent [default: info] Log Level
--workspaceId=workspaceId mParticle Workspace ID
DESCRIPTION
Data Plans are comprised of one or more Data Plan Versions.
A Data Plan can be fetched using your account credentials and using a valid --dataPlanId
For more information, visit: https://github.com/mParticle/mparticle-cli
ALIASES
$ mp plan:dp:update
EXAMPLE
$ mp planning:data-plan:update --workspaceId=[WORKSPACE_ID] --dataPlanId=[DATA_PLAN_ID] --dataPlan=[DATA_PLAN]
See code: src/commands/planning/data-plans/update.ts
Validates an Event
USAGE
$ mp planning:events:validate
OPTIONS
-o, --outFile=outFile (optional) Output file for results (defaults to standard output)
--clientId=clientId Client ID for Platform API
--clientSecret=clientSecret Client Secret for Platform API
--config=config mParticle Config JSON File
--dataPlan=dataPlan Data Plan as Stringified JSON
--dataPlanFile=dataPlanFile Path to saved JSON file of a Data Plan
--dataPlanVersion=dataPlanVersion Data Plan Version Document as Stringified JSON
--dataPlanVersionFile=dataPlanVersionFile Path to saved JSON file of a Data Plan Version
--event=event Event as Stringified JSON
--eventFile=eventFile Path to saved JSON file of an Event
--logLevel=error|warn|info|debug|silent [default: info] Log Level
--serverMode Validate using mParticle Server-side validation
--translateEvents Translate minified event into standard event
--versionNumber=versionNumber Data Plan Version Number
--workspaceId=workspaceId mParticle Workspace ID
DESCRIPTION
Data Plans are comprised of one or more Data Plan Versions and are used to validate an Event.
A Data Plan Version can be directly referenced by using either the --dataPlanVersion or --dataPlanVersionFile flags
Otherwise, a --dataPlan or --dataPlanFile must be accompanied by a --versionNumber.
For more information, visit: https://github.com/mParticle/mparticle-cli
ALIASES
$ mp plan:e:val
EXAMPLES
$ mp planning:events:validate --event=[EVENT] --dataPlan=[DATA_PLAN] --versionNumber=[VERSION_NUMBER]
$ mp planning:events:validate --event=[EVENT] --dataPlanVersion=[DATA_PLAN_VERSION]
$ mp planning:events:validate --event=[EVENT] --dataPlanVersion=[DATA_PLAN_VERSION] --translateEvents
$ mp planning:events:validate --eventFile=/path/to/event --dataPlanFile=/path/to/dataplan
--versionNumber=[VERSION_NUMBER]
$ mp planning:events:validate --eventFile=/path/to/event --dataPlanVersionFile=/path/to/dataplanversion
$ mp planning:events:validate --eventFile=/path/to/event --dataPlanVersionFile=/path/to/dataplanversion
--translateEvents
See code: src/commands/planning/events/validate.ts