command line personal assistant
Command line tool which basically does nothing, yet it can do anything (as long as you implement it).
-
Fork this repository or create a new from template
-
Clone your new repository into
~/.ae
git clone $YOUR-REPOSITORY-URL ~/.ae
-
Run installation script to build & deploy ae into
/usr/local/bin
cd ~/.ae && sh ~/.ae/Resources/install.sh
-
Run "ae" to check that the installation went fine
ae
It should display instructions and active domains (only "core" is there by default)
command line personal assistant USAGE: ae [domain] [command] [parameters] DOMAINS: core
-
Run "ae core" to display its instructions
ae core
This domain also has a few commands
domain which drives this thing USAGE: core [command] [options] COMMANDS: edit config reload update branch: any (default: master) version
-
Run "ae core edit" to open this project in Xcode
ae core edit
-
Create
Sources/My/Hello.swift
with this sampleTaskDomain
import AECli struct Hello: TaskDomain { func handle(_ task: Task, in cli: Cli) throws { cli.output.text("hello world") } }
-
Create
Sources/My/My+Cli.swift
to activateHello
sampleimport AECli extension My.Cli { func domains() -> [TaskDomain] { [Hello()] } }
-
Run "ae core reload" to build & deploy again
ae core reload
It's also possible to use a shortcut
ae --reload
(prefix "--" is reserved for core commands) -
Run "ae" again
ae
Active domains now also include previously added "hello" domain
command line personal assistant USAGE: ae [domain] [command] [parameters] DOMAINS: core | hello
-
Run a new domain
ae hello
It will output "hello world"
hello world
That's pretty much all there is to it. You may use this tool for whatever needs you can think of. Now go and make yourself a bunch of useful "domains" which optionally handle some commands with whatever parameters!
This code is released under the MIT license. See LICENSE for details.
#done-for-fun
#keep-it-simple
#think-different