Development

The power of custom CLI's

Koen Van Looveren

25/9/2024

An illustration of a terminal screen

In today's fast-moving software development landscape, efficiency is critical. Teams often find themselves performing the same repetitive tasks, navigating between multiple tools and platforms, which results in wasted time and potential for human error. A custom Command Line Interface (CLI) can transform this reality by automating workflows, reducing context switching, and streamlining operations. This is exactly what impaktfull_cli offers—a powerful, customizable solution to simplify tasks and increase productivity.

A CLI (Command Line Interface) allows users to interact with software through text commands. In the case of Dart and Flutter, even everyday commands like:

flutter doctor

are examples of CLI usage.

Why Automate with a Custom CLI?

Companies often rely on various tools to manage operations, from code deployment to testing and creating test builds. Without a unified system, developers must manually execute repetitive tasks, which can lead to inefficiencies and errors. A custom CLI automates these tasks, significantly reducing the time spent on them and allowing developers to focus on high-priority work.

For example, imagine deploying your app across different environments—staging, production, or testing. A task like this requires numerous steps, and without automation, each step has to be executed manually. By implementing a custom CLI, this entire process can be condensed into a single command, dramatically speeding up the workflow and minimising the chances for mistakes.

Fastlane or fastpain?

Fastlane is exactly built to solve this issue. But why are we not using this? In the past we used it because it is quite easy to setup. But in the long run it will drag you down. Why? Here are 3 reasons.

Ruby

It uses ruby to write all the config code. If you never used ruby it can be quite challanging to write your "build to production" scripts. This will maybe result in less confidence to use the cli to automate your tasks.

Context switching

You are constantly context switching between your day to day programming language (for us that is dart) and ruby. Which will lower your productivity.

Dev environment

It is important how you installed fastlane and all of it's dependencies. Otherwise you are not able to access other tools, like cocoapods or flutter. We have lost multiple hours debugging why fastlane can not access a certain tool.

Stop the pain

So for us it was quite clear! Fastlane quite fast results in fastpain. So we went for our own solution, a custom dart cli that can be extended at any time and runs anywhere.

The Power of the impaktfull_cli

Dart stands out for CLI development due to its ability to handle everything in one programming language, eliminating context switching. Unlike Fastlane, Dart allows for Ahead of Time (AOT) compilation, meaning your CLI will run on any platform without dependency problems. It simplifies your workflow and avoids the environment issues you might face with tools like Fastlane.

Built with Dart, impaktfull_cli provides the flexibility to customize their workflows to suit their specific needs. Unlike generic tools that may require complex setup, this CLI framework is designed to be simple, efficient, and highly adaptable.

Some of its key advantages include:

  • Cross-Platform Flexibility: Dart allows you to create tools that work seamlessly across different platforms, whether it’s Windows, macOS, or Linux.
  • Automation of Repetitive Tasks: The CLI automates everything from code deployment to running tests, reducing the manual workload and improving efficiency.
  • Ease of Use: With simple commands and the ability to customise operations, developers of all levels can quickly become proficient with the tool.
  • Improved Consistency: By automating tasks, you ensure that processes are handled in a consistent manner, reducing the chances for human error.

Sharing knowledge at Flutter Belgium

During a talk for Flutter Belgium (impaktfull_talk_cli repository), Koen emphasised the importance of custom solutions like the impaktfull_cli. It covers how you can create a custom cli from scratch and some nice tips and tricks. Whether it’s integrating third-party services, running tests, or compiling code for different platforms, a CLI simplifies the process, making it seamless and efficient. Koen demonstrated how a CLI can cut down on operational overhead, improve consistency across platforms, and streamline processes that would otherwise take far longer.

Some really useful packages to simplify your cli development process are:

When Not to Use a Custom CLI

While a custom CLI is powerful, there are situations where it might not be ideal:

  • If you don’t have the resources or time for ongoing maintenance.
  • When Fastlane or another tool already works perfectly for your needs.
  • If you don’t require heavy customization or automation.
  • Or simply, if you don’t enjoy working on side projects like building a CLI.

Conclusion

A custom CLI like impaktfull_cli is more than just a tool—it’s a productivity multiplier. It empowers teams to automate mundane tasks, ensuring operations are handled swiftly and accurately, without the overhead of manual interventions. Whether you are deploying code, running tests, or managing databases, a custom CLI centralises these processes into a single, unified interface.

By integrating impaktfull_talk_cli into your development workflow, you are not only saving time but also fostering a more efficient, error-free environment that allows your team to focus on innovation and growth.

Interested in learning more? Explore the impaktfull_talk_cli repository to see how you can transform your company’s workflow today.

Also checkout the impaktfull_cli repository on github.

A laptop inside a heath shape. The background of the laptop is a heath shape as well
Development

A love letter to Open-Source

Flutter vs reactjs, angular, vuejs and svelte
Development

Flutter web vs "actual web frameworks"

let's talk

Ready for take off?

Rocket Icon