It is frustrating when we want to find some sophisticated unix commands right in the terminal. Right now, the process probably likes this:
- need some commands
- google / duckduckgo / wiki to find the some probably broken command
- copy and paste the command line
- tweak the command until it work, otherwise go back to step 2
- forget the knowledge days later
This process sucks. How about we keep commands where it belongs to -- terminal:
- Query for commands solving the problem right in the terminal
- Add your smart solutions back right from terminal
- Leverage the community power such as commandlinefu.com
git clone
the reponpm install
You can ask it for commands from remote server:
bin/ask query random number
[1]: strings /dev/urandom | grep -o '[:alnum:]]' | head -n 30 | tr -d '\n'; echo
Generate a random password 30 characters long
[2]: Random Number Between 1 And X
echo $[RANDOM%X+1]
You can also ask it from local server:
bin/ask query random number --local
Add new command to local storage
bin/ask add <command> --desc "it is an awesome command"
(work in progress) You could share more commands right from terminal with your $EDITOR
:
bin/ask add
(work in progress) You could exec the commands right in the terminal:
bin/ask exec <command id>
echo $[RANDOM%X+1]
(word in progress) Also paste to clipboard
bin/ask copy <command id>
bin/ask export cmd.json
bin/ask import backup.json
bin/ask --help
ask can query command from resources stored locally or remotely, and each resource models should share the same interface:
query(string) => [data, data, ...]
add(data) => data
get(id) => data
update(id, data) => data
remove(id) => data
The data
above is the data structure is defined as:
{
id: String,
command: String,
description: String,
private: Boolean
}
Like git
, ask cab be total local. By default, all the commands will be cached in ~/.ask
direcotry.
The structure of ~/.ask
directory will similar to a local .git
repository.
|-- index
`-- objects
|-- 0.json
|-- 1.json
|-- … …
|-- info
`-- pack
On version 1.0
- develop a local storage engine
- implement local
ask add
,ask exec <id>
,ask query 'grep'
- use your
$EDITOR
to add commands to your local storage engine - build a server model backed by postgreSQL
- build a server API interface
We follow the npm
code styles.
- yangchenyun [email protected]
- kuno [email protected]