# Change a containers CMD via the fly.toml file

**URL:** <https://community.fly.io/t/change-a-containers-cmd-via-the-fly-toml-file/2536>\
**Category:** Build debugging\
**Created:** [September 14, 2021, 4:31pm UTC](https://community.fly.io/t/change-a-containers-cmd-via-the-fly-toml-file/2536 "2021-09-14T16:31:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![adrian1](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/adrian1/32/1183_2.png) [@adrian1](https://community.fly.io/u/adrian1)\
**Post date:** [September 14, 2021, 4:31pm UTC](https://community.fly.io/t/change-a-containers-cmd-via-the-fly-toml-file/2536/1 "2021-09-14T16:31:34Z")

</div>

There is a `build.args` section for setting build arguments ([fly.io/docs/reference/configuration](https://fly.io/docs/reference/configuration/#build-args)), but how can I change the `CMD` to execute in the container?

---

<div class="post-metadata">

**Author:** ![jerome](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/jerome/32/17_2.png) [@jerome](https://community.fly.io/u/jerome)\
**Post date:** [September 14, 2021, 4:35pm UTC](https://community.fly.io/t/change-a-containers-cmd-via-the-fly-toml-file/2536/2 "2021-09-14T16:35:05Z")

</div>

You can set this:

```auto
app = "your-app"

[experimental]
cmd = ["path/to/command", "arg1", "arg2"]

```

---

<div class="post-metadata">

**Author:** ![jbergstroem](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/jbergstroem/32/15860_2.png) [@jbergstroem](https://community.fly.io/u/jbergstroem)\
**Post date:** [September 15, 2021, 12:17pm UTC](https://community.fly.io/t/change-a-containers-cmd-via-the-fly-toml-file/2536/3 "2021-09-15T12:17:12Z")

</div>

Added a PR to update documentation: [Add `cmd` section to experimental by jbergstroem · Pull Request #25 · superfly/docs · GitHub](https://github.com/superfly/docs/pull/25)

---

<div class="post-metadata">

**Author:** ![jerome](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/jerome/32/17_2.png) [@jerome](https://community.fly.io/u/jerome)\
**Post date:** [September 15, 2021, 12:19pm UTC](https://community.fly.io/t/change-a-containers-cmd-via-the-fly-toml-file/2536/4 "2021-09-15T12:19:55Z")

</div>

Thinking about it, I think the new preferred way to do this would be using the new [Preview: multi process apps (get your workers here!)](https://community.fly.io/t/preview-multi-process-apps-get-your-workers-here/2316).

Something like:

```auto
app = "your-app"

[processes]
app = "path/to/command arg1 arg2"

```

By default, an `app` process will be infered if you don’t have one.
