Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request: more friendly CLI UX #52

Open
kevinSuttle opened this issue Feb 18, 2014 · 3 comments · May be fixed by X-oss-byte/grunt-cli#1 or Hawthorne001/grunt-cli#1
Open

Request: more friendly CLI UX #52

kevinSuttle opened this issue Feb 18, 2014 · 3 comments · May be fixed by X-oss-byte/grunt-cli#1 or Hawthorne001/grunt-cli#1

Comments

@kevinSuttle
Copy link

❯ grunt init
grunt-cli: The grunt command line interface. (v0.1.13)

Fatal error: Unable to find local grunt.

If you're seeing this message, either a Gruntfile wasn't found or grunt
hasn't been installed locally to your project. For more information about
installing and configuring grunt, please see the Getting Started guide:

http://gruntjs.com/getting-started

Shouldn't this just generate a Gruntfile for the user?
The same error is displayed with grunt help and grunt --help.

I understand that at some point, this functionality was removed from Grunt, but I cannot figure out why. The links are broken in the current docs.

It'd also be great if there was a CLI UI like Bower or Yeoman.

❯ bower help init

Usage:
    bower init [<options>]

Options:
    -h, --help              Show this help message
    Additionally all global options listed in 'bower help' are available

Description:
    Creates a bower.json file based on answers to questions.
❯ yo
[?] What would you like to do? (Use arrow keys)
❯ Run the Angular generator (0.7.1)
  Run the Bootstrap3-less generator (3.0.1)
  Run the Pure generator (0.2.0)
  Run the Static generator (0.0.8)
  Run the Webapp generator (0.4.7)
  Run the Zurb-foundation generator (0.3.5)
  Run the Karma generator (0.6.0)
(Move up and down to reveal more choices)

Even further,

❯ grunt-init
Running "init" task

A valid init template name must be specified.

Available templates

(No templates found)

Templates that exist in the /Users/kevinsuttle/.grunt-init directory may be run
with "grunt-init TEMPLATE". Templates that exist in another location may be run
with "grunt-init /path/to/TEMPLATE". A template is a directory that must
contain, at the very minimum, a template.js file.

For more information, see http://gruntjs.com/project-scaffolding

This is an opportunity to do work on the user's behalf, not give them a chore.

@vladikoff
Copy link
Member

Thanks for creating this issue.
We need to brainstorm this in the future.
Here's some examples of how other tools handle it:

~/dev
$ rake
rake aborted!
No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, Rakefile.rb)

(See full trace by running task with --trace)
$ make
make: *** No targets specified and no makefile found.  Stop.

@kevinSuttle
Copy link
Author

Yeah, those could be improved also. I don't use them much anymore, but the (anti-)patterns are the same.

@chromeo
Copy link

chromeo commented Nov 15, 2017

Nearly 4 years later this issue still exists. Luckily this is a very popular search topic on Stackoverflow. How about this message instead of/in addition to '...please see the Getting Started Guide'

Working with an existing grunt project? Try this:
Change to the project's root directory.
Install project dependencies with npm install.
Run Grunt with grunt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants