Posts tagged with cli

Join 9,000+ developers

Every month, I share practical tips, tutorials, and behind-the-scenes insights from maintaining 300+ open source packages.

No spam. Unsubscribe anytime. You can also follow me on X.

Introducing Visit: a CLI tool made for humans to make network requests

I'm happy to announce that we have released Visit. This tool can display the response of any URL. Think of it as curl for humans. By default, the output will be colourized, and the response code and time will be displayed after the response.

screenshot

JSON responses will be colourized by default as well.

screenshot

And there's integration with Laravel: it can log in any user, report the numbers of queries used to build up the response, and more.

screenshot

I'd like to tell you all about it in this blog post.

Read more

How to check which version of PHP you are running original

by Freek Van der Herten – 1 minute read

When working on open source code, I like using the latest version of PHP. When developers that are not on the latest version use the package, they might see syntax errors.

You might ask why Composer doesn't protect against this? When composer.json requires the latest version, how do devs, not on the latest version, can even install the package?

Well, there seemingly are a lot of people that only upgrade the PHP version on the command line. For handling web requests, they are unknowingly using an older version of PHP. Here's how to make sure you are on the latest version of PHP on both the CLI and for handling web requests.

Read more

Replacing standard CLI tools with better ones

remysharp.com

Remy Sharp, a well known JavaScript developer, published a cool list of standard CLI tools replacements.

I'm not sure many web developers can get away without visiting the command line. As for me, I've been using the command line since 1997, first at university when I felt both super cool l33t-hacker and simultaneously utterly out of my depth. Over the years my command line habits have improved and I often search for smarter tools for the jobs I commonly do. With that said, here's my current list of improved CLI tools.

Read more [remysharp.com]

Advancing in the Bash Shell

If you want to learn some neat bash tricks, read this excellent read by Sam Rowe.

If you’ve ever used GNU/Linux, chances are good that you’ve used bash. Some people hold the belief that using a GUI is faster than using a CLI. These people have obviously never seen someone who uses a shell proficiently. In this tutorial, I hope to show you just a few of the amazing features bash provides that will increase your productivity in the shell.

http://samrowe.com/wordpress/advancing-in-the-bash-shell/

Read more

Easy file sharing from the command line

Transfer.sh is a free service by Dutchcoders that allows you to easily share files from the command line. Here's an example of how you can use it:

transfer my-favorite-file.txt

The given file will be uploaded to the transfer.sh-servers and the command will respond with a short url linking to that file. Pretty neat!

The only thing you need to do is set up a bash function called "transfer" (you can name it anything you want really).

Don't trust the transfer.sh with your supersecret files? Then you can set up your own server to transfer the files to.

Read more

A better way to style the output of console commands

When creating output from a Symfony based console command you might have created a title using code like this:

$output->writeln('');
$output->writeln('<info>Lorem Ipsum Dolor Sit Amet</>');
$output->writeln('<info>==========================</>');
$output->writeln('');

Starting from Symfony 2.7 there's a nice way to style the output of console commands. This code produces the same output as the example above

$io = new SymfonyStyle($input, $output)
$io->title('Lorem Ipsum Dolor Sit Amet');

There are styles for titles, sections, questions, tables, and so on. Take a look at the documention to learn what's possible.

Read more

The Art of Command Line

Fluency on the command line is a skill often neglected or considered arcane, but it improves your flexibility and productivity as an engineer in both obvious and subtle ways. This is a selection of notes and tips on using the command-line that we've found useful when working on Linux. Some tips are elementary, and some are fairly specific, sophisticated, or obscure. This page is not long, but if you can use and recall all the items here, you know a lot.
https://github.com/jlevy/the-art-of-command-line/blob/master/README.md

Read more

A package to check all links in a Laravel app original

by Freek Van der Herten – 1 minute read

A few weeks ago I made a cli tool to check the status code of all links on a site. It made use of a home grown crawler. Today the Laravel integration gets released. The new package called laravel-link-checker can log all broken links. By default, a link is considered broken if the status code of…

Read more