GithubHelp home page GithubHelp logo

tchigher / command-center Goto Github PK

View Code? Open in Web Editor NEW

This project forked from reibitto/command-center

0.0 0.0 0.0 768 KB

A CLI-based launcher and general productivity tool.

License: Apache License 2.0

Scala 96.90% AppleScript 2.06% Swift 1.03%

command-center's Introduction

Command Center

Scala CI

A CLI-based launcher and general productivity tool.

What is it?

Command Center is used to launch applications, find files, control music playback, search the web, run one-off CLI commands, and anything else you can imagine.

If you're familiar with tools like Alfred, Wox, ueli, Keypirinha, etc. you may already understand the concept. These tools already work great. Command Center aims to fill a slightly different niche though, targeting hackers/programmers who enjoy and are familiar with working in the command line.

Features/Goals

(Note: Command Center is still in active development. Some of these are still being worked on.)

  • Cross-platform (macOS, Windows, Linux)
  • Can be run purely from the command line, in both standalone and daemon modes.
  • Has its own terminal emulator that can be summoned with a hotkey (like a Quake console). Useful for running one-off commands when you're not already in a terminal window.
  • Focus on not being resource-heavy or draining battery. While Electron can do many things, it's not resource-friendly, which is one reason why Command Center doesn't use it.
  • Plugins are first-class. All the internal commands use the same plugin system a 3rd-party would use to integrate with Command Center. No scripting languages that only do a fraction of what the "real" thing can do.
  • Automatic language detection. For example, if you type Japanese text, you can open the Japanese version of Google, Wikipedia, etc. as opposed to the default (English) versions.

Example usage

recording

Finding files

Start typing the name of the file you're looking for. You can also use the following commands:

  • find filename - Find file by filename
  • in filename - Find file by its contents

Music controls

  • play - Start playing music (e.g. by default opens iTunes on macOS)
  • pause - Pause the current track
  • stop - Stop the current track
  • next - Switch to the next track in your playlist
  • previous - Switch to the previous track in your playlist
  • rate [1-5] - Rate the current track

Timer

If you want to start a simple countdown timer:

timer 15m -m "Call Sally"

This will pop up a notification after 15 minutes. Specifying a message is optional.

Installation

At the moment there is no simple "1-step install". You need to compile and generate an executable yourself (or run directly from SBT).

application.conf is needed to run Command Center. The following locations are searched (in order):

  1. COMMAND_CENTER_CONFIG_PATH (if defined)
  2. ~/.commandcenter/application.conf
  3. ./application.conf

Important note: For the pop-up emulator window to activate and come to the front properly on macOS you need to make sure you place the cc-tools executable in the proper location. Either place it in ~/.command-center/cc-tools or define the COMMAND_CENTER_TOOLS_PATH environment variable if you want to specify a custom location.

Development

Command Center mainly uses Scala with a strong focus on typed functional programming (via ZIO). Types make developing plugins a much more pleasant experience as you get feedback quicker and features are more discoverable. Writing a command is as simple as writing a single class like so.

Once you start SBT, you should be presented a list of common commands. For example:

  • ~compile - Compile all modules with file-watch enabled
  • cli-client/run - Run Command Center CLI client (interactive mode by default). Particularly useful for local development.
  • daemon/run - Run Command Center in daemon mode (cmd+space to summon terminal emulator)
  • daemon/assembly - Create an executable JAR for running in daemon mode
  • cli-client/assembly - Create an executable JAR for running command line utility
  • cli-client/graalvm-native-image:packageBin - Create a native executable of the CLI client

Configuration

All commands can be configured. You can disable any core command, rename them, change their options, add new commands, create aliases (useful for shortening argument passing), and so on.

Configuration format

Commands and options are configured with a single HOCON configuration file. To see an example, take a look at application.conf.

Creating your own plugins

If you created a plugin and it's general-purpose and doesn't bring in extra dependencies, feel free to create an issue or PR to get the command into Command Center's core commands. If not (or if you'd prefer to maintain the plugin yourself), you can create your own separate repository to host it. If you let me know, I can add it to a list of external plugins.

Eventually the goal is to make installing external plugins as simple as running a single install command. See this issue here. Until then, it's a matter of dropping your jar file in the plugins folder and restarting the app.

Contributing

There are a lot of issues marked as "good first issue" here. Feel free to take any that interest you. I'd also appreciate any help for OS-specific features. Help with Windows and Linux would be great since I've mainly been focusing on macOS for now.

Writing your own commands is a great way to begin learning ZIO. Each command can be developed, tested, and run in isolation. For more help with ZIO, the Discord channel is a great place to ask questions.

command-center's People

Contributors

davewm avatar reibitto avatar scala-steward avatar tuleism avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.