PHPackages                             spaceboy/nette-cli - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. spaceboy/nette-cli

ActiveLibrary[CLI &amp; Console](/categories/cli)

spaceboy/nette-cli
==================

Simple tool for easy creating CLI scripts in Nette PHP framework

v1.2(4y ago)1171MITPHPPHP &gt;=7.1

Since Feb 24Pushed 4y ago1 watchersCompare

[ Source](https://github.com/spaceboy/nette-cli)[ Packagist](https://packagist.org/packages/spaceboy/nette-cli)[ RSS](/packages/spaceboy-nette-cli/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (4)Used By (1)

NetteCli
========

[](#nettecli)

Simple tool for easy CLI apps creation in Nette framework

Installation
------------

[](#installation)

The best way to install into [Nette web application](https://github.com/nette/nette) is the easiest one. Open console, go to your app directory and execute following command:

```
composer require spaceboy/nette-cli

```

My first CLI application
------------------------

[](#my-first-cli-application)

I strongly recommend you to create a dedicated space for CLI applications in app root directory. For example `bin` for apps operated from command line and `cron` for apps runned from cron.

After installation copy (or link) file `nette-cli.php` from `vendor/spaceboy/nette-cli/bin` directory to folder dedicated for CLI scripts (e.g. `bin`).

Create a `PHP` file, f.e. `command.php` in `bin` directory:

```
root
 +- app   // Nette app directory
 +- bin   // CLI commands directory
 |    command.php   // Out first CLI aplication
 +- cron  // cron CLI commands directory
 +- log   // Nette log directory
 ...

```

Or create template script by simple running `nette-cli.php` in `bin` directory:

```
php nette-cli.php create --name command.php

```

In `command.php`, we at first must create app namespace and include required files and namespaces.

```
