# Route from command line

**URL:** <https://discourse.slimframework.com/t/route-from-command-line/194>\
**Category:** Questions\
**Created:** [April 30, 2016, 9:33pm UTC](https://discourse.slimframework.com/t/route-from-command-line/194 "2016-04-30T21:33:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![russia](https://avatars.discourse-cdn.com/v4/letter/r/c4cdca/32.png) [@russia](https://discourse.slimframework.com/u/russia)\
**Post date:** [April 30, 2016, 9:33pm UTC](https://discourse.slimframework.com/t/route-from-command-line/194/1 "2016-04-30T21:33:04Z")

</div>

Hi,

Can I call routers from the command line? For example,

```
$ php ./public/index.php xml
<html>
    <head>
        <title>Method not allowed</title>
        <style>
            body{
                margin:0;
                padding:30px;
                font:12px/1.5 Helvetica,Arial,Verdana,sans-serif;
            }
            h1{
                margin:0;
                font-size:48px;
                font-weight:normal;
                line-height:48px;
            }
        </style>
    </head>
    <body>
        <h1>Method not allowed</h1>
        <p>Method not allowed. Must be one of: <strong>GET</strong></p>
    </body>
</html>
```

---

<div class="post-metadata">

**Author:** ![clmnsk](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.slimframework.com/clmnsk/32/92_2.png) [@clmnsk](https://discourse.slimframework.com/u/clmnsk)\
**Post date:** [May 9, 2016, 8:47am UTC](https://discourse.slimframework.com/t/route-from-command-line/194/2 "2016-05-09T08:47:55Z")

</div>

Hi, you can’t do this out of the box, as Slim relies on a proper HTTP Method being used.  
Actually not Slim but Fast-Route.

There is a [PSR7 Slim-Cli Middleware](https://github.com/pavlakis/slim-cli), which detects a CLI call and Sets the Request method to GET.  
While i think it’s debatable to simulate being an HTTP call, rather than a proper implementation of a CLI call, this is what would work right now.
