1.1.7 • Published 3 years ago

fark v1.1.7

Weekly downloads
3
License
MIT
Repository
github
Last release
3 years ago

fark

A command line tool to work with the mess that is your projects folder.

You would fark by typing in your terminal, for example:

# Lists all your projects
/home/wvbe/projects> fark

# Lists all projects that have uncommitted changes
/home/wvbe/projects> fark -f status:dirty

# Pull-rebase all projects that have a clean git state
/home/wvbe/projects> fark -f status:clean -$ git pull -r

# Create an npm package out of every project that isn't already
/home/wvbe/projects> fark -f ~has-file:package.json -$ npm init --yes

The power of fark lies in combining small easy to use filters (-f) with column output (-c) or a shell command you want to repeat over the results (-$, --run).

  • Filters narrow down the scope of projects that are logged back to you, or used for --run.
  • Columns simply log more stuff in an invention called "table".
  • Run a command to gain additional skill points in crafting unicorn blockchain hacks. Use responsibly.

Output of fark could be something like:

/home/wvbe/projects> fark --filters is-npm --columns name npm-prop:version is-git status is-git-ahead
╔══════════════╤═════════════╤════════╤════════╤══════════════╗
║ name         │ npm-prop    │ is-git │ status │ is-git-ahead ║
╟──────────────┼─────────────┼────────┼────────┼──────────────╢
║ ask-nicely   │ 3.0.1       │ yes    │        │ no           ║
║ fark         │ 1.0.2       │ yes    │ M      │ no           ║
║ luggage      │ 1.0.0       │ yes    │        │ no           ║
║ oxee         │ 4.0.0-alpha │ yes    │ UDM    │ no           ║
║ poseidon     │ 0.1.0       │ yes    │        │ no           ║
║ react-world  │ 0.1.0       │ yes    │ UDM    │ no           ║
║ wyb.be       │ 0.1.0       │ yes    │ UDM    │ no           ║
║ xml-renderer │ 1.2.0       │ yes    │ UADM   │ no           ║
╟──────────────┼─────────────┼────────┼────────┼──────────────╢
║ name         │ npm-prop    │ is-git │ status │ is-git-ahead ║
╚══════════════╧═════════════╧════════╧════════╧══════════════╝

Directories:  8
Filters:      is-npm
Props:        name, npm-prop, is-git, status, is-git-ahead
Time:         217ms

# If you use --run, the execution results for each project listed above are shown here

Install

npm install fark -g

Extending

Building an Informer is pretty easy, see any of the informers in the api/ directory. You can make fark load additional informers by creating a directory .fark in your home folder, and in it a file called myInformer.js (or something that matches *Informer.js). Feel free to npm install additional stuff that you need.

Help

Type fark -h in your terminal to get the following summary of options, columns and filters you have available. If you have any custom informers, they will be included too. An installation of fark that is not extended includes the the following:

Options

shortlongdescriptionrequired
-c--columnsAdditional properties to show for each directory, see also the available Columns.no
-C--concurrentThe amount of execution tasks to perform concurrentlyno
-f--filtersShow only results that match all given Filters. Use "~" to invert the filter response, and ":" for additional filter arguments.no
-g--globGlobbing pattern(s) for finding your projects. Defaults to "*".no
-h--helpShows you this help pageno
-W--nowrapDo not stretch or shrink the results table to terminal widthno
-$--runRun this command in every result directoryno
-s--sortSort on this column. Use the negation character ("~") to inversely sort. Defaults to the first column.no
-v--versionGives the fark versionno

Columns

namedescription
accessedThe last time this file was accessed
changedThe last time the file status was changed
git-branchThe branch name that is currently checked out
git-remote-namesThe names of repository git remotes
git-remote-urlThe URL of a specific git remote
git-remote-urlsThe URLs of repository git remotes
has-additionWether the repository has any, or a file $1 marked as addition
has-branchAssert wether $1 is a branch on the local machine or any of the remotes
has-deletionWether the repository has any, or a file $1 marked as deletion
has-fileAssert wether file $1 exists
has-local-branchAssert wether $1 is a branch on the local machine
has-modificationWether the repository has any, or a file $1 marked as modification
has-npm-keywordThe package has been labelled with keyword $1
has-npm-scriptThe package has an npm script called $1
has-remote-branchAssert wether $1 is a branch on any of the remotes, or on remote $2 if the second argument is used.
has-unstagedWether the repository has any, or a file $1 marked as unstaged
is-gitThis is a git versioned repository
is-git-aheadThe repository has a commit that has not been pushed to remote.
is-git-behindThe remote has a commit that has not been pulled.
is-linkSymbolic link, or no
is-npmThis is an npm package
is-npm-privateIs this a private package
modifiedThe last time this file was modified
nameThe directory name
name-ends-withOnly repositories whose directory ends with $1
name-starts-withOnly repositories whose directory starts with $1
npm-propProperty $1 of package.json
pathThe full path to repo
path-containsOnly repositories whose full path contains $1
remote-statusThe number of commits ahead and behind on the tracked remote branch
statusClean status, or any combination of (U) unstaged, (A) additions, (M) modifications and (D) deletions.

Filters

namedescription
has-additionWether the repository has any, or a file $1 marked as addition
has-branchAssert wether $1 is a branch on the local machine or any of the remotes
has-deletionWether the repository has any, or a file $1 marked as deletion
has-fileAssert wether file $1 exists
has-local-branchAssert wether $1 is a branch on the local machine
has-modificationWether the repository has any, or a file $1 marked as modification
has-npm-keywordThe package has been labelled with keyword $1
has-npm-scriptThe package has an npm script called $1
has-remote-branchAssert wether $1 is a branch on any of the remotes, or on remote $2 if the second argument is used.
has-unstagedWether the repository has any, or a file $1 marked as unstaged
is-gitThis is a git versioned repository
is-git-aheadThe repository has a commit that has not been pushed to remote.
is-git-behindThe remote has a commit that has not been pulled.
is-linkSymbolic link, or no
is-npmThis is an npm package
is-npm-privateIs this a private package
name-ends-withOnly repositories whose directory ends with $1
name-starts-withOnly repositories whose directory starts with $1
path-containsOnly repositories whose full path contains $1
statusfilter by clean, dirty, or any combination of U (unstaged), A (added), M (modded) or D (deleted)
1.1.7

3 years ago

1.1.6

3 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago

0.0.1

6 years ago