# Running scripts with parameters

**URL:** <https://forum.flow.com/t/running-scripts-with-parameters/1156>\
**Category:** Flow CLI\
**Created:** [March 3, 2021, 1:58pm UTC](https://forum.flow.com/t/running-scripts-with-parameters/1156 "2021-03-03T13:58:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![JapaneseCatGuy](https://avatars.discourse-cdn.com/v4/letter/j/82dd89/32.png) [@JapaneseCatGuy](https://forum.flow.com/u/JapaneseCatGuy)\
**Post date:** [March 3, 2021, 1:58pm UTC](https://forum.flow.com/t/running-scripts-with-parameters/1156/1 "2021-03-03T13:58:53Z")

</div>

Hello, I’m a new developer learning flow particularly interested in making a 3rd party application for nba top shot. I’ve been following the readme from the [nba top shot smart contract repo](https://github.com/dapperlabs/nba-smart-contracts) and so far I’ve been able to run the scripts which require no params fine. However for scripts that require a parameter such as

```auto

pub fun main(playID: UInt32): {String:String} {
    let metadata = TopShot.getPlayMetaData(playID: playID) ?? panic("Play doesn't exist")
    log(metadata)
    return metadata
}

```

what is the correct way to pass this param if we are using the flow CLI? I’m currently calling the script from the cli as such `flow scripts execute transactions/scripts/plays/get_play_metadata.cdc --host access.mainnet.nodes.onflow.org:9000`

If I overlooked something please let me know, thank you!

---

<div class="post-metadata">

**Author:** ![sideninja](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.flow.com/sideninja/32/363_2.png) [@sideninja](https://forum.flow.com/u/sideninja)\
**Post date:** [March 3, 2021, 3:24pm UTC](https://forum.flow.com/t/running-scripts-with-parameters/1156/2 "2021-03-03T15:24:09Z")

</div>

> [@JapaneseCatGuy](#):
>
> flow scripts execute transactions/scripts/plays/get\_play\_metadata.cdc --host [access.mainnet.nodes.onflow.org:9000](http://access.mainnet.nodes.onflow.org:9000)

Hi @JapaneseCatGuy you can pass arguments like so:

```auto
flow scripts execute script.cdc --args="[{\"type\": \"String\", \"value\": \"Hello, Cadence\"}]"

```

We will make sure to update the docs.

---

<div class="post-metadata">

**Author:** ![JapaneseCatGuy](https://avatars.discourse-cdn.com/v4/letter/j/82dd89/32.png) [@JapaneseCatGuy](https://forum.flow.com/u/JapaneseCatGuy)\
**Post date:** [March 3, 2021, 3:49pm UTC](https://forum.flow.com/t/running-scripts-with-parameters/1156/3 "2021-03-03T15:49:12Z")

</div>

Thank you for the response @sideninja . Is this already in the current version of the `flow-cli`?  
I’m using `v0.14.0` of flow cli, and get the error `unknown flag: --args` when I try to run the script using the flag. I saw [Pass arguments to scripts and transactions by MaxStalker · Pull Request #51 · onflow/flow-cli · GitHub](https://github.com/onflow/flow-cli/pull/51) was merged, but wasn’t sure if it’s already released.

---

<div class="post-metadata">

**Author:** ![sideninja](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.flow.com/sideninja/32/363_2.png) [@sideninja](https://forum.flow.com/u/sideninja)\
**Post date:** [March 3, 2021, 5:52pm UTC](https://forum.flow.com/t/running-scripts-with-parameters/1156/4 "2021-03-03T17:52:50Z")

</div>

@JapaneseCatGuy You’re right, the release with this new functionality is not yet released but will be soon 🤞 - feel free to provide any feedback on CLI or your development experience. It’s important to us to hear it.
